Lines Matching refs:compresslevel
25 def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST,
34 "rb", and the default compresslevel is 9.
37 GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
58 binary_file = GzipFile(filename, gz_mode, compresslevel)
60 binary_file = GzipFile(None, gz_mode, compresslevel, filename)
135 compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None):
158 The compresslevel argument is an integer from 0 to 9 controlling the
201 self.compress = zlib.compressobj(compresslevel,
213 self._write_gzip_header(compresslevel)
240 def _write_gzip_header(self, compresslevel):
261 if compresslevel == _COMPRESS_LEVEL_BEST:
263 elif compresslevel == _COMPRESS_LEVEL_FAST:
555 def _create_simple_gzip_header(compresslevel: int,
559 :param compresslevel: Compresslevel used to determine the xfl bytes.
565 if compresslevel == _COMPRESS_LEVEL_BEST:
567 elif compresslevel == _COMPRESS_LEVEL_FAST:
576 def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
579 compresslevel sets the compression level in range of 0-9.
586 return zlib.compress(data, level=compresslevel, wbits=31)
587 header = _create_simple_gzip_header(compresslevel, mtime)
590 return (header + zlib.compress(data, level=compresslevel, wbits=-15) +
633 compresslevel = _COMPRESS_LEVEL_TRADEOFF
635 compresslevel = _COMPRESS_LEVEL_FAST
637 compresslevel = _COMPRESS_LEVEL_BEST
653 compresslevel=compresslevel)