fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor changes in search
[wolnelektury.git]
/
src
/
wolnelektury
/
utils.py
diff --git
a/src/wolnelektury/utils.py
b/src/wolnelektury/utils.py
index
8c5ead6
..
d20039c
100644
(file)
--- a/
src/wolnelektury/utils.py
+++ b/
src/wolnelektury/utils.py
@@
-12,6
+12,7
@@
from functools import wraps
import pytz
from inspect import getargspec
import pytz
from inspect import getargspec
+import re
from django.core.mail import send_mail
from django.http import HttpResponse
from django.template import RequestContext
from django.core.mail import send_mail
from django.http import HttpResponse
from django.template import RequestContext
@@
-149,3
+150,8
@@
class UnicodeCSVWriter(object):
def writerows(self, rows):
for row in rows:
self.writerow(row)
def writerows(self, rows):
for row in rows:
self.writerow(row)
+
+
+# the original re.escape messes with unicode
+def re_escape(s):
+ return re.sub(r"[(){}\[\].*?|^$\\+-]", r"\\\g<0>", s)