def unquote_plus(s):
"""unquote('%7e/abc+def') -> '~/abc def'"""
s = s.replace('+', ' ')
return unquote(s)
def do_GET(self):
path, query = urllib.splitquery(self.path)
path = [urllib.unquote_plus(x) for x in path.split("/")]
query = cgi.parse_qs(query or "")
print path, query
app = path[1]
args = path[2:]
src/b/t/btdaemon-HEAD/BTDaemon4.0.1/btdaemon.py btdaemon(Download)
def stop(self, *args, **kwargs):
global scanflag
f = kwargs['f']
os.remove(os.path.join(config['torrent_dir'], urllib.unquote_plus(f)))
scanflag = True
time.sleep(2)
return httptools.redirect("/")
@cpg.expose
@passwordProtected
def pause(self, *args, **kwargs):
global scanflag
f = kwargs['f']
os.rename(os.path.join(config['torrent_dir'], urllib.unquote_plus(f)), os.path.join(config['paused_torrent_dir'], urllib.unquote_plus(f)))
def resume(self, *args, **kwargs):
global scanflag
f = kwargs['f']
os.rename(os.path.join(config['paused_torrent_dir'], urllib.unquote_plus(f)), os.path.join(config['torrent_dir'], urllib.unquote_plus(f)))
scanflag = True
time.sleep(2)
return httptools.redirect("/")
def addhttp(self, *args, **kwargs):
global scanflag
filename = kwargs['url'].split('/')[-1]
inf = urllib.urlopen(kwargs['url'])
outf = open(os.path.join(config['torrent_dir'], urllib.unquote_plus(filename)), 'wb')
outf.write(inf.read())
outf.close()
def addfile(self, *args, **kwargs):
global scanflag
outf = open(os.path.join(config['torrent_dir'], urllib.unquote_plus(cpg.request.filenameMap['thefile'])), 'wb')
outf.write(kwargs['thefile'])
outf.close()
scanflag = True
time.sleep(2)
src/u/l/uliweb-HEAD/uliweb/lib/werkzeug/utils.py uliweb(Download)
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
"""
return _decode_unicode(urllib.unquote_plus(s), charset, errors)
def url_fix(s, charset='utf-8'):
src/p/a/parklife-HEAD/app/google/gdata/gauth.py parklife(Download)
Returns:
A list of unescaped strings.
"""
return [urllib.unquote_plus(part) or None for part in blob.split('|')]
def token_to_blob(token):
src/p/y/pyallegro-HEAD/web/rest2web/rest2web/pythonutils/cgiutils.py pyallegro(Download)
def formdecode(thestring):
"""Decode a single string back into a form like dictionary."""
from cgi import parse_qs
from urllib import unquote_plus
return parse_qs(unquote_plus(thestring), True)
src/b/a/badger-lib-HEAD/packages/gdata/src/atom/http_core.py badger-lib(Download)
for pair in param_pairs:
pair_parts = pair.split('=')
if len(pair_parts) > 1:
uri.query[urllib.unquote_plus(pair_parts[0])] = (
urllib.unquote_plus(pair_parts[1]))
elif len(pair_parts) == 1:
uri.query[urllib.unquote_plus(pair_parts[0])] = None
src/p/a/parklife-HEAD/app/google/atom/http_core.py parklife(Download)
for pair in param_pairs:
pair_parts = pair.split('=')
if len(pair_parts) > 1:
uri.query[urllib.unquote_plus(pair_parts[0])] = (
urllib.unquote_plus(pair_parts[1]))
elif len(pair_parts) == 1:
uri.query[urllib.unquote_plus(pair_parts[0])] = None
src/s/o/somnambulism-HEAD/trunk/util/libs/thirdpart/gdata/gauth.py somnambulism(Download)
Returns:
A list of unescaped strings.
"""
return [urllib.unquote_plus(part) or None for part in blob.split('|')]
def token_to_blob(token):
src/k/a/karrigell-HEAD/trunk/common/admin/editor/editor.py karrigell(Download)
def index(folder = None):
if folder is None:
folder = CONFIG.root_dir
folder = urllib.unquote_plus(folder)
files = os.listdir(folder)
for _dir in [ d for d in files
if os.path.isdir(os.path.join(folder,d)) ]:
def edit(script):
script = urllib.unquote_plus(script)
header = HEAD(TITLE("Editing script %s" %script)+
SCRIPT(language="javascript", Type="text/javascript",
src="/editarea/edit_area/edit_area_full.js")+
SCRIPT("""editAreaLoader.init({
id : "textarea_1" // textarea id
def save_changes(script,content):
script = urllib.unquote_plus(script)
out = open(script,'wb')
out.write(content)
out.close()
print "Changes saved"
src/g/d/gdata-python-client-HEAD/src/gdata/gauth.py gdata-python-client(Download)
Returns:
A list of unescaped strings.
"""
return [urllib.unquote_plus(part) or None for part in blob.split('|')]
def token_to_blob(token):
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next