diff options
author | keis <keijser@gmail.com> | 2011-01-23 21:57:16 +0100 |
---|---|---|
committer | keis <keijser@gmail.com> | 2011-02-15 21:17:16 +0100 |
commit | 3594f35e565ebf210b583bcc3c4df042e0dc4191 (patch) | |
tree | 614eab8b78bc09cc16a642783064ae119ee573c9 /examples/data/plugins/cookies.py | |
parent | bed2433630f6d0d78e8b829c46b00c3ab301b512 (diff) |
move common function related to escaping to Plugin
Diffstat (limited to 'examples/data/plugins/cookies.py')
-rw-r--r-- | examples/data/plugins/cookies.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/examples/data/plugins/cookies.py b/examples/data/plugins/cookies.py index 05a8901..e29ee36 100644 --- a/examples/data/plugins/cookies.py +++ b/examples/data/plugins/cookies.py @@ -7,17 +7,6 @@ import os, re # these are symbolic names for the components of the cookie tuple symbolic = {'domain': 0, 'path':1, 'name':2, 'value':3, 'scheme':4, 'expires':5} -_unquote = re.compile("'(.*?)'|\"(.*?)\"") -def unquote(s): - m = _unquote.match(s) - if m is not None: - return unicode(m.group(1)).decode('string_escape') - return unicode(s).decode('string_escape') - -_splitquoted = re.compile("( |\"(?:\\\\.|[^\"])*?\"|'(?:\\\\.|[^'])*?')") -def splitquoted(text): - return [unquote(p) for p in _splitquoted.split(text) if p.strip()] - # allows for partial cookies # ? allow wildcard in key def match(key, cookie): |