Files
archived-discord-bot/stream_handlers.py
Nicba1010 52d9b19ea0 Log Analysis Implementation
7Z Stream reader is broken
Zip Stream reader doesn't exist
Supported formats:
 - .gz
 - .log

Add manual library load report.
Last problems still not fixed.

Disable .zip and .7z logs.
Turn on feedback for invalid/non-tested serials.

Fixup

Log Analysis
2018-02-15 20:05:00 +01:00

17 lines
361 B
Python

import zlib
def stream_text_log(stream):
for chunk in stream.iter_content(chunk_size=1024):
yield chunk
def stream_gzip_decompress(stream):
dec = zlib.decompressobj(32 + zlib.MAX_WBITS) # offset 32 to skip the header
for chunk in stream:
rv = dec.decompress(chunk)
if rv:
yield rv
del rv
del dec