Revision 2761
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/strings.py | ||
---|---|---|
41 | 41 |
|
42 | 42 |
def overlaps(str0, str1): return str0.find(str1) >= 0 or str1.find(str0) >= 0 |
43 | 43 |
|
44 |
##### Escaping |
|
45 |
|
|
46 |
def esc_for_mogrify(query): |
|
47 |
'''Escapes a query right before being passed to a mogrifying function.''' |
|
48 |
return query.replace('%', '%%') |
|
49 |
|
|
44 | 50 |
##### Unicode |
45 | 51 |
|
46 | 52 |
unicode_reader = codecs.getreader('utf_8') |
Also available in: Unified diff
strings.py: Added esc_for_mogrify()