예제 #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 프로젝트: ledmonster/botocore
 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 프로젝트: j3tm0t0/botocore
 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(key=itemgetter(0))
             buf += "&".join(quoted_qsa)
     return buf
예제 #4
0
파일: auth.py 프로젝트: ctingwai/botocore
 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
파일: auth.py 프로젝트: ledmonster/botocore
 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
예제 #6
0
파일: auth.py 프로젝트: biochimia/botocore
 def canonical_query_string(self, request):
     split = urlsplit(request.url)
     buf = ''
     if split.query:
         qsa = split.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(key=itemgetter(0))
             buf += '&'.join(quoted_qsa)
     return buf
예제 #7
0
 def copy_object(self, kwargs):
     """
     This operation copies one s3 object to another location in s3.
     If either the bucket of the source or the destination does not
     exist, an error message will be sent stating that the bucket does
     not exist.
     """
     bucket = kwargs['bucket']
     key = kwargs['key']
     copy_source = kwargs['copy_source']
     src_bucket, src_key = find_bucket_key(copy_source)
     src_key = unquote(src_key)
     if hasattr(src_key, 'decode'):
         src_key = src_key.decode('utf-8')
     response_data = {}
     etag = ''
     if bucket in self.session.s3 or src_bucket in self.session.s3:
         src = self.session.s3[src_bucket][src_key]
         self.session.s3[bucket][key] = src
     else:
         response_data['Errors'] = [{'Message': 'Bucket does not exist'}]
     return FakeHttp(etag), response_data
예제 #8
0
 def copy_object(self, kwargs):
     """
     This operation copies one s3 object to another location in s3.
     If either the bucket of the source or the destination does not
     exist, an error message will be sent stating that the bucket does
     not exist.
     """
     bucket = kwargs['bucket']
     key = kwargs['key']
     copy_source = kwargs['copy_source']
     src_bucket, src_key = find_bucket_key(copy_source)
     src_key = unquote(src_key)
     if hasattr(src_key, 'decode'):
         src_key = src_key.decode('utf-8')
     response_data = {}
     etag = ''
     if bucket in self.session.s3 or src_bucket in self.session.s3:
         src = self.session.s3[src_bucket][src_key]
         self.session.s3[bucket][key] = src
     else:
         response_data['Errors'] = [{'Message': 'Bucket does not exist'}]
     response_data['ETag'] = '"%s"' % etag
     return FakeHttp(), response_data
예제 #9
0
파일: handlers.py 프로젝트: kkung/botocore
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
예제 #10
0
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
예제 #11
0
def decode_quoted_jsondoc(event_name, shape, value, **kwargs):
    try:
        value = json.loads(unquote(value))
    except (ValueError, TypeError):
        logger.debug('Error loading quoted JSON', exc_info=True)
    return value
예제 #12
0
def decode_quoted_jsondoc(event_name, shape, value, **kwargs):
    try:
        value = json.loads(unquote(value))
    except (ValueError, TypeError):
        logger.debug('Error loading quoted JSON', exc_info=True)
    return value