upip: upip_gzip.py no longer used, remove.

pull/106/head
Paul Sokolovsky 2016-09-29 08:53:09 -07:00
rodzic 6764d27d78
commit 62671a4795
1 zmienionych plików z 0 dodań i 28 usunięć

Wyświetl plik

@ -1,28 +0,0 @@
#import zlib
import uzlib as zlib
FTEXT = 1
FHCRC = 2
FEXTRA = 4
FNAME = 8
FCOMMENT = 16
def decompress(data):
assert data[0] == 0x1f and data[1] == 0x8b
assert data[2] == 8
flg = data[3]
assert flg & 0xe0 == 0
i = 10
if flg & FEXTRA:
i += data[11] << 8 + data[10] + 2
if flg & FNAME:
while data[i]:
i += 1
i += 1
if flg & FCOMMENT:
while data[i]:
i += 1
i += 1
if flg & FHCRC:
i += 2
return zlib.decompress(memoryview(data)[i:], -15)