@@ -61,19 +61,23 @@ def delete_object(storage_service, bucket_name, object_name):
6161@retry (wait_exponential_multiplier = 1000 , wait_exponential_max = 10000 )
6262def upload_file (storage_service ,bucket ,bucket_path ,file_name ,verbose = True ):
6363 '''get_folder will return the folder with folder_name, and if create=True,
64- will create it if not found. If folder is found or created, the metadata is
65- returned, otherwise None is returned
66- :param storage_service: the drive_service created from get_storage_service
67- :param bucket: the bucket object from get_bucket
68- :param file_name: the name of the file to upload
69- :param bucket_path: the path to upload to
64+ will create it if not found. If folder is found or created, the metadata is
65+ returned, otherwise None is returned
66+
67+ Parameters
68+ ==========
69+ storage_service: the drive_service created from get_storage_service
70+ bucket: the bucket object from get_bucket
71+ file_name: the name of the file to upload
72+ bucket_path: the path to upload to
7073 '''
7174 # Set up path on bucket
7275 upload_path = "%s/%s" % (bucket ['id' ],bucket_path )
7376 if upload_path [- 1 ] != '/' :
7477 upload_path = "%s/" % (upload_path )
7578 upload_path = "%s%s" % (upload_path ,os .path .basename (file_name ))
76- body = {'name' : upload_path }
79+ body = {'name' : upload_path }
80+
7781 # Create media object with correct mimetype
7882 if os .path .exists (file_name ):
7983 mimetype = sniff_extension (file_name ,verbose = verbose )
0 commit comments