Do "compress" the archive when creating zip.
authorCheng Zhao <zcbenz@gmail.com>
Sat, 26 Oct 2013 09:42:12 +0000 (17:42 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 26 Oct 2013 09:42:12 +0000 (17:42 +0800)
By default the zipfile module doesn't do the compression unless we
explictly specify the method.

script/lib/util.py

index af71468..7c890bf 100644 (file)
@@ -70,7 +70,7 @@ def make_zip(zip_file_path, files, dirs):
     files += dirs
     subprocess.check_call(['zip', '-r', '-y', zip_file_path] + files)
   else:
-    zip_file = zipfile.ZipFile(zip_file_path, "w")
+    zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED)
     for filename in files:
       zip_file.write(filename, filename)
     for dirname in dirs: