reformat code with black

This commit is contained in:
Martin
2019-10-30 13:44:04 +01:00
parent 354e959cc5
commit 0dd8d619b4
28 changed files with 1236 additions and 689 deletions
+7 -7
View File
@@ -13,14 +13,14 @@ def slugify(text):
text = text.lower()
# replace unwanted chars
numbers = re.compile('(?<=\d),(?=\d)')
text = numbers.sub('', text)
unwanted_chars = re.compile(r'[^_a-z0-9/]+')
text = unwanted_chars.sub('_', text)
numbers = re.compile("(?<=\d),(?=\d)")
text = numbers.sub("", text)
unwanted_chars = re.compile(r"[^_a-z0-9/]+")
text = unwanted_chars.sub("_", text)
# remove redundant _
duplicated_underscores = re.compile('_{2,}')
text = duplicated_underscores.sub('_', text)
text = text.strip('_')
duplicated_underscores = re.compile("_{2,}")
text = duplicated_underscores.sub("_", text)
text = text.strip("_")
return text