fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kindle promo
[wolnelektury.git]
/
lib
/
sortify.py
diff --git
a/lib/sortify.py
b/lib/sortify.py
index
c64668b
..
46e72d2
100755
(executable)
--- a/
lib/sortify.py
+++ b/
lib/sortify.py
@@
-25,7
+25,7
@@
def sortify(value):
Examples :
Examples :
- >>> sortify('a
a') < sortify('a
a') < sortify('ą') < sortify('b')
+ >>> sortify('a
a') < sortify('a
a') < sortify('ą') < sortify('b')
True
>>> sortify('ź') < sortify('ż')
True
>>> sortify('ź') < sortify('ż')
@@
-39,6
+39,6
@@
def sortify(value):
# try to replace chars
value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value)
value = value.lower()
# try to replace chars
value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value)
value = value.lower()
- value = re.sub(r'[^a-z0-9~]+', '
|
', value)
+ value = re.sub(r'[^a-z0-9~]+', '
', value)
return value.encode('ascii', 'ignore')
return value.encode('ascii', 'ignore')