From e93408af9d66bd9e6f6ea197d433b2d881978d41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Nov 2014 11:27:12 +0100 Subject: [PATCH] Cleanup: *picky*, prefer 'dir' over 'folder' --- webservice/bam/application/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webservice/bam/application/__init__.py b/webservice/bam/application/__init__.py index 430b450..a0c5740 100644 --- a/webservice/bam/application/__init__.py +++ b/webservice/bam/application/__init__.py @@ -219,18 +219,19 @@ class FileAPI(Resource): # files on a filesystem level and subsequently as svn commands) import zipfile - tmp_extracted_folder = os.path.splitext(tmp_filepath)[0] + extract_tmp_dir = os.path.splitext(tmp_filepath)[0] with open(tmp_filepath, 'rb') as zip_file: zip_handle = zipfile.ZipFile(zip_file) - zip_handle.extractall(tmp_extracted_folder) + zip_handle.extractall(extract_tmp_dir) del zip_file, zip_handle + del zipfile - with open(os.path.join(tmp_extracted_folder, '.bam_paths_remap.json'), 'r') as path_remap: + with open(os.path.join(extract_tmp_dir, '.bam_paths_remap.json'), 'r') as path_remap: path_remap = json.load(path_remap) import shutil for source_file_path, destination_file_pah in path_remap.items(): - shutil.move(os.path.join(tmp_extracted_folder, source_file_path), destination_file_pah) + shutil.move(os.path.join(extract_tmp_dir, source_file_path), destination_file_pah) # TODO, dry run commit (using committ message) # Seems not easily possible with SVN