diff --git a/upload_files.py b/upload_files.py index d54c195..60d549e 100644 --- a/upload_files.py +++ b/upload_files.py @@ -212,9 +212,7 @@ def get_total_files_in_dir(file_dir): total number of files (int) """ # Get count of all files recursively in all subdirectories - total_files = 0 - for root,d_names,f_names in os.walk(file_dir): - total_files += len(UploadSession.get_filepaths(root)) + total_files = sum((len(UploadSession.get_filepaths(root)) for (root, d_names, f_names) in os.walk(file_dir))) return total_files @@ -580,9 +578,9 @@ def main(): # Upload files uploader.run() - total_file_counter = total_file_counter + uploader.counter + total_file_counter += uploader.counter print('-- Total Files Uploaded: %s of %s' % (total_file_counter, total_n_files)) if __name__ == '__main__': - main() + main() \ No newline at end of file