

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):
    "\n        Store an object in GS using the name of the Key object as the\n        key in GS and the contents of the file named by 'filename'.\n        See set_contents_from_file method for details about the\n        parameters.\n\n        :type filename: string\n        :param filename: The name of the file that you want to put onto GS\n\n        :type headers: dict\n        :param headers: Additional headers to pass along with the request to GS.\n\n        :type replace: bool\n        :param replace: If True, replaces the contents of the file if it\n            already exists.\n\n        :type cb: function\n        :param cb: (optional) a callback function that will be called to report\n            progress on the download. The callback should accept two integer\n            parameters, the first representing the number of bytes that have\n            been successfully transmitted from GS and the second representing\n            the total number of bytes that need to be transmitted.\n\n        :type cb: int\n        :param num_cb: (optional) If a callback is specified with the cb\n            parameter this parameter determines the granularity of the callback\n            by defining the maximum number of times the callback will be called\n            during the file transfer.\n\n        :type policy: :class:`boto.gs.acl.CannedACLStrings`\n        :param policy: A canned ACL policy that will be applied to the new key\n            in GS.\n\n        :type md5: A tuple containing the hexdigest version of the MD5 checksum\n            of the file as the first element and the Base64-encoded version of\n            the plain checksum as the second element. This is the same format\n            returned by the compute_md5 method.\n        :param md5: If you need to compute the MD5 for any reason prior to\n            upload, it's silly to have to do it twice so this param, if present,\n            will be used as the MD5 values of the file. Otherwise, the checksum\n            will be computed.\n\n        :type res_upload_handler: ResumableUploadHandler\n        :param res_upload_handler: If provided, this handler will perform the\n            upload.\n        "
    fp = open(filename, 'rb')
    replace.set_contents_from_file(fp, headers, replace, cb, num_cb, policy, md5, res_upload_handler)
    fp.close()

dataset/ETHPy150Open yyuu/botornado/boto/gs/key.py Key.set_contents_from_filename/VarMisuse@55/847 `self`->`replace`