/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tuned_gzip.py

  • Committer: Jelmer Vernooij
  • Date: 2017-12-04 23:01:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6839.
  • Revision ID: jelmer@jelmer.uk-20171204230139-1sc3c18ikwewdejm
Remove bytes_to_gzip; work with chunks instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import struct
23
23
import zlib
24
24
 
25
 
__all__ = ["bytes_to_gzip", "chunks_to_gzip"]
 
25
__all__ = ["chunks_to_gzip"]
26
26
 
27
27
 
28
28
def U32(i):
40
40
    return i & 0xFFFFFFFF
41
41
 
42
42
 
43
 
def bytes_to_gzip(bytes, factory=zlib.compressobj,
44
 
    level=zlib.Z_DEFAULT_COMPRESSION, method=zlib.DEFLATED,
45
 
    width=-zlib.MAX_WBITS, mem=zlib.DEF_MEM_LEVEL,
46
 
    crc32=zlib.crc32):
47
 
    """Create a gzip file containing bytes and return its content."""
48
 
    return chunks_to_gzip([bytes])
49
 
 
50
 
 
51
43
def chunks_to_gzip(chunks, factory=zlib.compressobj,
52
44
    level=zlib.Z_DEFAULT_COMPRESSION, method=zlib.DEFLATED,
53
45
    width=-zlib.MAX_WBITS, mem=zlib.DEF_MEM_LEVEL,