Skip to content

Commit

Permalink
Merge tag '0.41.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed Aug 27, 2018
2 parents 2d647dc + f863547 commit eb96dfc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
ChangeLog
*********

0.41.3 (2018-08-27)
===================
- Feature: Make download-as-zip compression level a tunable configuration parameter.

0.41.2 (2018-08-27)
===================
- Fix: Brown-paper-bag release: Check in settings file needed for last fix.
Expand Down
8 changes: 8 additions & 0 deletions waterbutler/core/streams/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import zlib

from waterbutler import settings


config = settings.child('STREAMS_CONFIG')


ZIP_EXTENSIONS = config.get('ZIP_EXTENSIONS', '.zip .gz .bzip .bzip2 .rar .xz .bz2 .7z').split(' ')

# Compression level to apply to zipped files. Value must be an integer from 0 to 9, where
# lower values represent less compression. -1 is also allowed, meaning the default level
# (approximately equivalent to a 6). See the zlib docs for more:
# https://docs.python.org/3/library/zlib.html#zlib.compressobj
ZIP_COMPRESSION_LEVEL = int(config.get('ZIP_COMPRESSION_LEVEL', zlib.Z_DEFAULT_COMPRESSION))
2 changes: 1 addition & 1 deletion waterbutler/core/streams/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(self, file_tuple):
self.zinfo.external_attr = 0o600 << 16 # -rw-------
self.zinfo.compress_type = zipfile.ZIP_DEFLATED
self.compressor = zlib.compressobj(
zlib.Z_DEFAULT_COMPRESSION,
settings.ZIP_COMPRESSION_LEVEL,
zlib.DEFLATED,
-15,
)
Expand Down
2 changes: 1 addition & 1 deletion waterbutler/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.41.2'
__version__ = '0.41.3'

0 comments on commit eb96dfc

Please sign in to comment.