• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(3277)  |  Call(2849)  |  Derive(0)  |  Import(428)
unquote('abc%20def') -> 'abc def'.

        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
        


src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/webapi.py   braintree_python_examples(Download)
    try:
        d = storify(cookie, *requireds, **defaults)
        for k, v in d.items():
            d[k] = v and urllib.unquote(v)
        return d
    except KeyError:
        badrequest()

src/m/e/mendeley-oapi-example-HEAD/oauth2/__init__.py   mendeley-oapi-example(Download)
            # Split key-value.
            param_parts = param.split('=', 1)
            # Remove quotes and unescape the value.
            params[param_parts[0]] = urllib.unquote(param_parts[1].strip('\"'))
        return params
 
    @staticmethod
    def _split_url_string(param_str):
        """Turn URL string into parameters."""
        parameters = parse_qs(param_str, keep_blank_values=False)
        for k, v in parameters.iteritems():
            parameters[k] = urllib.unquote(v[0])

src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/application.py   braintree_python_examples(Download)
            ctx.path = lstrips(env.get('REQUEST_URI').split('?')[0], ctx.homepath)
            # Apache and CherryPy webservers unquote the url but lighttpd doesn't. 
            # unquote explicitly for lighttpd to make ctx.path uniform across all servers.
            ctx.path = urllib.unquote(ctx.path)
 
        if env.get('QUERY_STRING'):
            ctx.query = '?' + env.get('QUERY_STRING', '')

src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/wsgiserver/__init__.py   braintree_python_examples(Download)
import threading
import time
import traceback
from urllib import unquote
from urlparse import urlparse
import warnings
 
        # But note that "...a URI must be separated into its components
        # before the escaped characters within those components can be
        # safely decoded." http://www.ietf.org/rfc/rfc2396.txt, sec 2.4.2
        atoms = [unquote(x) for x in quoted_slash.split(path)]
        path = "%2F".join(atoms)
        environ["PATH_INFO"] = path
 

src/g/e/gevent-0.13.1/examples/webproxy.py   gevent(Download)
import urllib2
from urlparse import urlparse
from cgi import escape
from urllib import unquote
 
PORT = 8088
 
    elif (method, path) == ('POST', ''):
        key, value = env['wsgi.input'].read().strip().split('=')
        assert key == 'url', repr(key)
        start_response('302 Found', [('Location', join(proxy_url, unquote(value)))])
    elif method == 'POST':
        start_response('404 Not Found', [])
    else:

src/m/y/myspaceid-python-sdk-HEAD/myspaceid-python-sdk/samples/google-app-engine/oauth/consumer.py   myspaceid-python-sdk(Download)
            self.response.out.write("No un-authed token found in session")
            return
        token = oauth.OAuthToken.from_string(unauthed_token)       
        if token.key != urllib.unquote( self.request.get('oauth_token', 'no-token') ):
            self.response.out.write("Something went wrong! Tokens do not match")
            return
        ms = MySpace(ckeynsecret.CONSUMER_KEY, ckeynsecret.CONSUMER_SECRET)

src/r/e/REST-Client-HEAD/sample/webapi/parser_obj/URLParser.py   REST-Client(Download)
    def execute(self,response):
      ret = {}  
      for param in response.split('&'):
          (key, value) = param.split('=')
          ret[key] = urllib.unquote(value)
      return ret

src/y/o/yos-social-python-HEAD/examples/appengine/yosdemo.py   yos-social-python(Download)
                self.response.out.write("No un-authed token found in session")
                return
            token = oauth.OAuthToken.from_string(request_token)
            if token.key != urllib.unquote( self.request.get('oauth_token', 'no-token') ):
                self.response.out.write("Something went wrong! Tokens do not match")
                return
            session.save()

src/m/o/modu-HEAD/examples/file-upload/modu/sites/file_upload.py   modu(Download)
	def prepare_content(self, req):
		tree = req.app.tree
		session = req.session
		if(tree.postpath):
			if(tree.postpath[0] == 'status' and len(tree.postpath) >= 2):
				selected_file = urllib.unquote(tree.postpath[1])
				if('modu.file' in session):

src/p/y/pyjamas-0.7/examples/swfupload/server.py   Pyjamas(Download)
    def translate_path(self, path):
        path = path.decode('utf-8')
        path = urlparse.urlparse(path)[2]
        path = posixpath.normpath(urllib.unquote(path))
        words = path.split('/')
        words = filter(None, words)
        path = os.getcwd()

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next