Cleanup: *picky*, prefer 'dir' over 'folder'

This commit is contained in:
2014-11-05 11:27:12 +01:00
parent 9157ed1dc0
commit e93408af9d

View File

@@ -219,18 +219,19 @@ class FileAPI(Resource):
# files on a filesystem level and subsequently as svn commands) # files on a filesystem level and subsequently as svn commands)
import zipfile 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: with open(tmp_filepath, 'rb') as zip_file:
zip_handle = zipfile.ZipFile(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 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) path_remap = json.load(path_remap)
import shutil import shutil
for source_file_path, destination_file_pah in path_remap.items(): 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) # TODO, dry run commit (using committ message)
# Seems not easily possible with SVN # Seems not easily possible with SVN