mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-14 06:18:42 +00:00
b09cea6db6
Use usr bot id to check for recursion instead of hardcoded name More error handling during log parse Post log analysis results even if it wasn't finished for some reason (e.g. truncated log) Fix log summary alignment for GPU settings Tweak product id reges: allow more formats, restrict to known product IDs
20 lines
441 B
Python
20 lines
441 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:
|
|
try:
|
|
rv = dec.decompress(chunk)
|
|
if rv:
|
|
yield rv
|
|
del rv
|
|
except zlib.error as zlr:
|
|
pass
|
|
del dec
|