parameters: (self, filename, headers=None, replace=True,
                                     cb=None, num_cb=10, policy=None, md5=None,
                                     reduced_redundancy=None,
                                     res_upload_handler=None,
                                     if_generation=None)
docstring: Store an object in GS using the name of the Key object as the
          key in GS and the contents of the file named by 'filename'.
          See set_contents_from_file method for details about the
          parameters.
  
          :type filename: string
          :param filename: The name of the file that you want to put onto GS.
  
          :type headers: dict
          :param headers: (optional) Additional headers to pass along with the
              request to GS.
  
          :type replace: bool
          :param replace: (optional) If True, replaces the contents of the file
              if it already exists.
  
          :type cb: function
          :param cb: (optional) Callback function that will be called to report
              progress on the upload. The callback should accept two integer
              parameters, the first representing the number of bytes that have
              been successfully transmitted to GS and the second representing the
              total number of bytes that need to be transmitted.
  
          :type num_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 policy: :py:attribute:`boto.gs.acl.CannedACLStrings`
          :param policy: (optional) A canned ACL policy that will be applied to
              the new key in GS.
  
          :type md5: tuple
          :param md5: (optional) A tuple containing the hexdigest version of the
              MD5 checksum of the file as the first element and the
              Base64-encoded version of the plain checksum as the second element.
              This is the same format returned by the compute_md5 method.
  
              If you need to compute the MD5 for any reason prior to upload, it's
              silly to have to do it twice so this param, if present, will be
              used as the MD5 values of the file. Otherwise, the checksum will be
              computed.
  
          :type res_upload_handler: :py:class:`boto.gs.resumable_upload_handler.ResumableUploadHandler`
          :param res_upload_handler: (optional) If provided, this handler will
              perform the upload.
  
          :type if_generation: int
          :param if_generation: (optional) If set to a generation number, the
              object will only be written to if its current generation number is
              this value. If set to the value 0, the object will only be written
              if it doesn't already exist.
docstring_summary: Store an object in GS using the name of the Key object as the
          key in GS and the contents of the file named by 'filename'.
          See set_contents_from_file method for details about the
          parameters.
docstring_tokens: Store an object in GS using the name of the Key object as the key in GS and the contents of the file named by filename . See set_contents_from_file method for details about the parameters .
function: def set_contents_from_filename(self, filename, headers=None, replace=True,
                                     cb=None, num_cb=10, policy=None, md5=None,
                                     reduced_redundancy=None,
                                     res_upload_handler=None,
                                     if_generation=None):
          """
          Store an object in GS using the name of the Key object as the
          key in GS and the contents of the file named by 'filename'.
          See set_contents_from_file method for details about the
          parameters.
  
          :type filename: string
          :param filename: The name of the file that you want to put onto GS.
  
          :type headers: dict
          :param headers: (optional) Additional headers to pass along with the
              request to GS.
  
          :type replace: bool
          :param replace: (optional) If True, replaces the contents of the file
              if it already exists.
  
          :type cb: function
          :param cb: (optional) Callback function that will be called to report
              progress on the upload. The callback should accept two integer
              parameters, the first representing the number of bytes that have
              been successfully transmitted to GS and the second representing the
              total number of bytes that need to be transmitted.
  
          :type num_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 policy: :py:attribute:`boto.gs.acl.CannedACLStrings`
          :param policy: (optional) A canned ACL policy that will be applied to
              the new key in GS.
  
          :type md5: tuple
          :param md5: (optional) A tuple containing the hexdigest version of the
              MD5 checksum of the file as the first element and the
              Base64-encoded version of the plain checksum as the second element.
              This is the same format returned by the compute_md5 method.
  
              If you need to compute the MD5 for any reason prior to upload, it's
              silly to have to do it twice so this param, if present, will be
              used as the MD5 values of the file. Otherwise, the checksum will be
              computed.
  
          :type res_upload_handler: :py:class:`boto.gs.resumable_upload_handler.ResumableUploadHandler`
          :param res_upload_handler: (optional) If provided, this handler will
              perform the upload.
  
          :type if_generation: int
          :param if_generation: (optional) If set to a generation number, the
              object will only be written to if its current generation number is
              this value. If set to the value 0, the object will only be written
              if it doesn't already exist.
          """
          # Clear out any previously computed hashes, since we are setting the
          # content.
          self.local_hashes = {}
  
          with open(filename, 'rb') as fp:
              self.set_contents_from_file(fp, headers, replace, cb, num_cb,
                                          policy, md5, res_upload_handler,
                                          if_generation=if_generation)
function_tokens: def set_contents_from_filename ( self , filename , headers = None , replace = True , cb = None , num_cb = 10 , policy = None , md5 = None , reduced_redundancy = None , res_upload_handler = None , if_generation = None ) : # Clear out any previously computed hashes, since we are setting the # content. self . local_hashes = { } with open ( filename , 'rb' ) as fp : self . set_contents_from_file ( fp , headers , replace , cb , num_cb , policy , md5 , res_upload_handler , if_generation = if_generation )