Logo Search packages:      
Sourcecode: s3ql version File versions  Download package

def s3ql::backends::boto::s3::key::Key::get_contents_as_string (   self,
  headers = None,
  cb = None,
  num_cb = 10,
  torrent = False,
  version_id = None 
)
Retrieve an object from S3 using the name of the Key object as the
key in S3.  Return the contents of the object as a string.
See get_contents_to_file method for details about the
parameters.

:type headers: dict
:param headers: Any additional headers to send in the request

:type cb: function
:param cb: (optional) a callback function that will be called to report
     progress on the download.  The callback should accept two integer
     parameters, the first representing the number of bytes that have
     been successfully transmitted from S3 and the second representing
     the total number of bytes that need to be transmitted.

:type cb: int
:param num_cb: (optional) If a callback is specified with the cb parameter
     this parameter determines the granularity of the callback by defining
     the maximum number of times the callback will be called during the file transfer.  
     
    
:type cb: int
:param num_cb: (optional) If a callback is specified with the cb parameter
     this parameter determines the granularity of the callback by defining
     the maximum number of times the callback will be called during the file transfer.  
     
:type torrent: bool
:param torrent: If True, returns the contents of a torrent file as a string.

:rtype: string
:returns: The contents of the file as a string

Definition at line 821 of file key.py.

                                               :
        """
        Retrieve an object from S3 using the name of the Key object as the
        key in S3.  Return the contents of the object as a string.
        See get_contents_to_file method for details about the
        parameters.
        
        :type headers: dict
        :param headers: Any additional headers to send in the request
        
        :type cb: function
        :param cb: (optional) a callback function that will be called to report
             progress on the download.  The callback should accept two integer
             parameters, the first representing the number of bytes that have
             been successfully transmitted from S3 and the second representing
             the total number of bytes that need to be transmitted.

        :type cb: int
        :param num_cb: (optional) If a callback is specified with the cb parameter
             this parameter determines the granularity of the callback by defining
             the maximum number of times the callback will be called during the file transfer.  
             
                    
        :type cb: int
        :param num_cb: (optional) If a callback is specified with the cb parameter
             this parameter determines the granularity of the callback by defining
             the maximum number of times the callback will be called during the file transfer.  
             
        :type torrent: bool
        :param torrent: If True, returns the contents of a torrent file as a string.
        
        :rtype: string
        :returns: The contents of the file as a string
        """
        fp = StringIO.StringIO()
        self.get_contents_to_file(fp, headers, cb, num_cb, torrent=torrent,
                                  version_id=version_id)
        return fp.getvalue()


Generated by  Doxygen 1.6.0   Back to index