Cleanup: use file-context

This commit is contained in:
2014-11-04 17:59:19 +01:00
parent fdeaefed10
commit 833032e5e8

View File

@@ -183,12 +183,9 @@ class FileAPI(Resource):
# TODO, once all files are uploaded, unpack and run the tasklist (copy, add, remove
# files on a filesystem level and subsequently as svn commands)
import zipfile
zipped_file = open(tmp_filepath, 'rb')
z = zipfile.ZipFile(zipped_file)
z.extractall(os.path.splitext(tmp_filepath)[0])
zipped_file.close()
with open(tmp_filepath, 'rb') as zipped_file:
z = zipfile.ZipFile(zipped_file)
z.extractall(os.path.splitext(tmp_filepath)[0])
# TODO, dry run commit (using committ message)
# Seems not easily possible with SVN