diff -r ccc6dff1b7b4 beancount/scripts/bake.py
--- a/beancount/scripts/bake.py Mon Dec 31 18:13:23 2018 +0000
+++ b/beancount/scripts/bake.py Fri Jan 04 13:36:57 2019 +0700
@@ -17,6 +17,15 @@
import re
from os import path
import zipfile
+import importlib
+if importlib.util.find_spec('lzma'):
+ ZIP_COMPRESSION = zipfile.ZIP_LZMA
+elif importlib.util.find_spec('bz2'):
+ ZIP_COMPRESSION = zipfile.ZIP_BZIP2
+elif importlib.util.find_spec('zlib'):
+ ZIP_COMPRESSION = zipfile.ZIP_DEFLATED
+else:
+ ZIP_COMPRESSION = zipfile.ZIP_STORED
import lxml.html
@@ -200,7 +209,7 @@
directory: A string, the name of the directory to archive.
archive: A string, the name of the file to output.
"""
- with file_utils.chdir(directory), zipfile.ZipFile(archive, 'w') as archfile:
+ with file_utils.chdir(directory), zipfile.ZipFile(archive, 'w', compression=ZIP_COMPRESSION) as archfile:
for root, dirs, files in os.walk(directory):
for filename in files:
relpath = path.relpath(path.join(root, filename), directory)
--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/de75671d-532a-4deb-bd0f-fd9377e63753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.