def unquote(s):
"""unquote('abc%20def') -> 'abc def'."""
res = s.split('%')
# fastpath
if len(res) == 1:
return s
s = res[0]
for item in res[1:]:
try:
s += _hextochr[item[:2]] + item[2:]
except KeyError:
s += '%' + item
except UnicodeDecodeError:
s += unichr(int(item[:2], 16)) + item[2:]
return s
import sys import urllib import getopt from urlparse import unquote from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from simpleodspy.sodsspreadsheet import SodsSpreadSheet
for arg in full_path[1].split('&'):
arg_t = arg.split('=')
if len(arg_t) == 2:
self.parameters[arg_t[0]] = unquote(arg_t[1])
else:
self.parameters[arg] = ""