From 244f426f2deb8fb9d11f55f4ad5bbadc9571477c Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Tue, 26 Mar 2019 23:38:06 +0000 Subject: [PATCH] publish muk_utils - 12.0 --- muk_utils/__manifest__.py | 2 +- muk_utils/tools/file.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index 7a8a6a3..2627653 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -19,7 +19,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.1.6.13', + "version": '12.0.1.6.14', "category": 'Extra Tools', "license": "AGPL-3", "author": "MuK IT", diff --git a/muk_utils/tools/file.py b/muk_utils/tools/file.py index a4d3d47..6200804 100644 --- a/muk_utils/tools/file.py +++ b/muk_utils/tools/file.py @@ -40,13 +40,13 @@ _logger = logging.getLogger(__name__) # File Helper #---------------------------------------------------------- -def slugify(value): +def slugify(value, lower=True): value = str(unicodedata.normalize('NFKD', value)) value = str(value.encode('ascii', 'ignore')) value = str(re.sub('[^\w\s-]', '', value)) value = str(re.sub('[-\s]+', '-', value)) - value = value.strip().lower() - return value + value = value.lower() if lower else value + return value.strip() def check_name(name): tmp_dir = tempfile.mkdtemp()