-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move slow code to async QThread workers (WIP)
- Loading branch information
Showing
13 changed files
with
422 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import unicodedata | ||
import re | ||
|
||
def slugify(value): | ||
""" | ||
Converts to lowercase, removes non-word characters (alphanumerics and | ||
underscores) and converts spaces to hyphens. Also strips leading and | ||
trailing whitespace. | ||
Copied from Django. | ||
""" | ||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') | ||
value = re.sub(r'[^\w\s-]', '', value).strip().lower() | ||
return re.sub(r'[-\s]+', '-', value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.