mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix chunking
This commit is contained in:
parent
6bd4c506bb
commit
4684c87497
@ -17,9 +17,10 @@ def split_into_chunks(marked_text, chunk_size):
|
|||||||
sz = len(x)
|
sz = len(x)
|
||||||
if tlen + sz > chunk_size:
|
if tlen + sz > chunk_size:
|
||||||
mark = None
|
mark = None
|
||||||
if chunk and isinstance(chunk[-1], int):
|
if chunk:
|
||||||
mark = chunk[-1]
|
if isinstance(chunk[-1], int):
|
||||||
del chunk[-1]
|
mark = chunk[-1]
|
||||||
|
del chunk[-1]
|
||||||
yield chunk
|
yield chunk
|
||||||
chunk = [] if mark is None else [mark]
|
chunk = [] if mark is None else [mark]
|
||||||
tlen = sz
|
tlen = sz
|
||||||
@ -38,7 +39,7 @@ class Client:
|
|||||||
min_rate = 0.5
|
min_rate = 0.5
|
||||||
max_rate = 6.0
|
max_rate = 6.0
|
||||||
default_system_rate = 1.0
|
default_system_rate = 1.0
|
||||||
chunk_size = 128 * 1024
|
chunk_size = 64 * 1024
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def escape_marked_text(cls, text):
|
def escape_marked_text(cls, text):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user