Get chunked loading working with frames

This commit is contained in:
Kovid Goyal
2021-02-04 21:04:44 +05:30
parent 5d2baaac38
commit 7a1785e1e8
5 changed files with 41 additions and 24 deletions

View File

@@ -198,15 +198,20 @@ def set_cursor_for_place(place: 'Place', cmd: GraphicsCommand, width: int, heigh
def write_chunked(cmd: GraphicsCommand, data: bytes) -> None:
cmd = cmd.clone()
if cmd.f != 100:
data = zlib.compress(data)
cmd.o = 'z'
data = standard_b64encode(data)
ac = cmd.a
quiet = cmd.q
while data:
chunk, data = data[:4096], data[4096:]
cmd.m = 1 if data else 0
write_gr_cmd(cmd, chunk)
cmd.clear()
cmd.a = ac
cmd.q = quiet
def show(