1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-24 23:31:29 +02:00

Removing couple of "buildins" polyglot types

This commit is contained in:
2020-04-20 20:22:50 +02:00
parent eac0b98d6f
commit c867f0321b
36 changed files with 85 additions and 109 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ from ebook_converter.ebooks.metadata.opf2 import OPFCreator
from ebook_converter.ebooks.conversion.preprocess import DocAnalysis
from ebook_converter.utils.cleantext import clean_ascii_chars
from ebook_converter.polyglot.builtins import iteritems, long_type
from ebook_converter.polyglot.builtins import iteritems
__license__ = 'GPL v3'
@@ -62,7 +62,7 @@ def split_txt(txt, epub_split_size_kb=0):
txt = txt.encode('utf-8')
length_byte = len(txt)
# Calculating the average chunk value for easy splitting as EPUB (+2 as a safe margin)
chunk_size = long_type(length_byte / (int(length_byte / (epub_split_size_kb * 1024)) + 2))
chunk_size = int(length_byte / (int(length_byte / (epub_split_size_kb * 1024)) + 2))
# if there are chunks with a superior size then go and break
parts = txt.split(b'\n\n')
lengths = tuple(map(len, parts))