예제 #1
0
 def unquote_v(self, nv):
     """
     TODO: Do we need this?
     """
     if len(nv) == 1:
         return nv
     else:
         return (nv[0], unquote(nv[1]))
예제 #2
0
파일: auth.py 프로젝트: ttacon/awsebcli
 def unquote_v(self, nv):
     """
     TODO: Do we need this?
     """
     if len(nv) == 1:
         return nv
     else:
         return (nv[0], unquote(nv[1]))
예제 #3
0
파일: auth.py 프로젝트: ttacon/awsebcli
 def _canonical_query_string_url(self, parts):
     buf = ''
     if parts.query:
         qsa = parts.query.split('&')
         qsa = [a.split('=', 1) for a in qsa]
         quoted_qsa = []
         for q in qsa:
             if len(q) == 2:
                 quoted_qsa.append('%s=%s' % (quote(
                     q[0], safe='-_.~'), quote(unquote(q[1]), safe='-_.~')))
             elif len(q) == 1:
                 quoted_qsa.append('%s=' % quote(q[0], safe='-_.~'))
         if len(quoted_qsa) > 0:
             quoted_qsa.sort()
             buf += '&'.join(quoted_qsa)
     return buf
예제 #4
0
 def _canonical_query_string_url(self, parts):
     buf = ''
     if parts.query:
         qsa = parts.query.split('&')
         qsa = [a.split('=', 1) for a in qsa]
         quoted_qsa = []
         for q in qsa:
             if len(q) == 2:
                 quoted_qsa.append(
                     '%s=%s' % (quote(q[0], safe='-_.~'),
                                quote(unquote(q[1]), safe='-_.~')))
             elif len(q) == 1:
                 quoted_qsa.append('%s=' % quote(q[0], safe='-_.~'))
         if len(quoted_qsa) > 0:
             quoted_qsa.sort()
             buf += '&'.join(quoted_qsa)
     return buf
예제 #5
0
파일: handlers.py 프로젝트: ttacon/awsebcli
def decode_quoted_jsondoc(value):
    try:
        value = json.loads(unquote(value))
    except (ValueError, TypeError):
        logger.debug('Error loading quoted JSON', exc_info=True)
    return value
def decode_quoted_jsondoc(value):
    try:
        value = json.loads(unquote(value))
    except (ValueError, TypeError):
        logger.debug('Error loading quoted JSON', exc_info=True)
    return value