@@ -2229,8 +2229,8 @@ def upload_files(self, request, resources, folder, quiet=False):
2229
2229
full_path = os .path .join (folder , file_name )
2230
2230
2231
2231
if os .path .isfile (full_path ):
2232
- retval = self ._upload_file (file_name , full_path , quiet , request , resources )
2233
- if retval :
2232
+ exitcode = self ._upload_file (file_name , full_path , quiet , request , resources )
2233
+ if exitcode :
2234
2234
return
2235
2235
if os .path .isdir (full_path ):
2236
2236
temp_dir = tempfile .mkdtemp ()
@@ -2239,17 +2239,28 @@ def upload_files(self, request, resources, folder, quiet=False):
2239
2239
archive_path = shutil .make_archive (os .path .join (temp_dir , dir_name ), "zip" ,
2240
2240
full_path )
2241
2241
_ , archive_name = os .path .split (archive_path )
2242
- retval = self ._upload_file (archive_name , archive_path , quiet , request ,
2243
- resources )
2242
+ exitcode = self ._upload_file (archive_name , archive_path , quiet , request ,
2243
+ resources )
2244
2244
finally :
2245
2245
shutil .rmtree (temp_dir )
2246
- if retval :
2246
+ if exitcode :
2247
2247
return
2248
2248
else :
2249
2249
if not quiet :
2250
2250
print ('Skipping: ' + file_name )
2251
2251
2252
2252
def _upload_file (self , file_name , full_path , quiet , request , resources ):
2253
+ """ Helper function to upload a single file
2254
+ Parameters
2255
+ ==========
2256
+ file_name: name of the file to upload
2257
+ full_path: path to the file to upload
2258
+ request: the prepared request
2259
+ resources: the files to upload
2260
+ quiet: suppress verbose output
2261
+ :return: True - upload unsuccessful; False - upload successful
2262
+ """
2263
+
2253
2264
if not quiet :
2254
2265
print ('Starting upload for file ' + file_name )
2255
2266
0 commit comments