1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-20 13:11:27 +02:00

Removed polyglots unicode_type usage

This commit is contained in:
2020-04-20 19:25:28 +02:00
parent ef7e2b10be
commit 128705f258
130 changed files with 657 additions and 716 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ from functools import partial
from ebook_converter.ebooks.htmlz.oeb2html import OEB2HTML
from ebook_converter.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace, rewrite_links
from ebook_converter.ebooks.oeb.stylizer import Stylizer
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes
from ebook_converter.polyglot.builtins import string_or_bytes
__license__ = 'GPL 3'
@@ -225,7 +225,7 @@ class MarkdownMLizer(OEB2HTML):
text.append('+ ')
elif li['name'] == 'ol':
li['num'] += 1
text.append(unicode_type(li['num']) + '. ')
text.append(str(li['num']) + '. ')
# Process tags that contain text.
if hasattr(elem, 'text') and elem.text:
+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, unicode_type, long_type
from ebook_converter.polyglot.builtins import iteritems, long_type
__license__ = 'GPL v3'
@@ -58,7 +58,7 @@ def split_txt(txt, epub_split_size_kb=0):
'''
# Takes care if there is no point to split
if epub_split_size_kb > 0:
if isinstance(txt, unicode_type):
if isinstance(txt, str):
txt = txt.encode('utf-8')
length_byte = len(txt)
# Calculating the average chunk value for easy splitting as EPUB (+2 as a safe margin)