Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def is_gzip_file(file_handle):
    signature = file_handle.read(2)
    file_handle.seek(-len(signature),1)
    return signature == '\x1f\x8b'
        


src/h/a/hanzo-warc-tools-0.2/hanzo/warctools/stream.py   hanzo-warc-tools(Download)
 
from .log import debug
from .archive_detect import is_gzip_file, guess_record_type
 
def open_record_stream(record_class=None, filename=None, file_handle=None, mode="rb+", gzip="auto"):
 
        if gzip == 'auto':
            if is_gzip_file(file_handle):
                gzip = 'record'
                #debug('autodetect: record gzip')