예제 #1
0
 def _pack(self, body, content_type, content_encoding, signer, signature,
           sep=str_to_bytes('\x00\x01')):
     fields = sep.join(
         ensure_bytes(s) for s in [signer, signature, content_type,
                                   content_encoding, body]
     )
     return b64encode(fields)
예제 #2
0
 def _pack(self, body, content_type, content_encoding, signer, signature,
           sep=str_to_bytes('\x00\x01')):
     fields = sep.join(
         ensure_bytes(s) for s in [signer, signature, content_type,
                                   content_encoding, body]
     )
     return b64encode(fields)
예제 #3
0
 def encode_content(self, data):
     content_type, content_encoding, content = self._encode(data)
     if content_encoding == 'binary':
         content = b64encode(content)
     return content_type, content_encoding, content
예제 #4
0
파일: database.py 프로젝트: cloudera/hue
 def encode_content(self, data):
     content_type, content_encoding, content = self._encode(data)
     if content_encoding == 'binary':
         content = b64encode(content)
     return content_type, content_encoding, content