Mercurial > repos > yating-l > jbrowsearchivecreator
diff TrackHub.py @ 10:91b3558fa73f draft
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit 479fc6490e24ca0e5034ae6c3579882e97e095e6-dirty
author | yating-l |
---|---|
date | Wed, 31 May 2017 13:38:46 -0400 |
parents | 8d1cf7ce65cd |
children | 45b5cb50c29e |
line wrap: on
line diff
--- a/TrackHub.py Fri May 19 16:32:23 2017 -0400 +++ b/TrackHub.py Wed May 31 13:38:46 2017 -0400 @@ -3,6 +3,7 @@ import os import subprocess import shutil +import zipfile import json import utils @@ -72,7 +73,14 @@ print "finished name index \n" def makeArchive(self): - shutil.make_archive(self.out_path, 'zip', self.out_path) + #shutil.make_archive(self.out_path, 'zip', self.out_path) + os.chdir(os.path.dirname(self.out_path)) + with zipfile.ZipFile(self.out_path + '.zip', 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as zf: + for root, _, filenames in os.walk(os.path.basename(self.out_path)): + for name in filenames: + name = os.path.join(root, name) + name = os.path.normpath(name) + zf.write(name, name) file_dir = os.path.abspath(self.outfile) source_dir = os.path.dirname(file_dir) folder_name = os.path.basename(self.outfolder)