1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-02-13 20:35:55 +01:00

Moved misc functions from polyglot package to single polyglot module.

This commit is contained in:
2021-05-25 19:06:31 +02:00
parent f46984267e
commit f47376830f
32 changed files with 244 additions and 219 deletions

View File

@@ -11,7 +11,7 @@
import operator
import re
from ebook_converter.polyglot.binary import from_hex_bytes
from ebook_converter import polyglot
__all__ = ['decode'] # Everything else is implementation detail
@@ -94,7 +94,8 @@ def try_encoding(css_bytes, encoding, fallback=True):
def hex2re(hex_data):
return re.escape(from_hex_bytes(hex_data.replace(' ', '').encode('ascii')))
return re.escape(polyglot.from_hex_bytes(hex_data.replace(' ', '')
.encode('ascii')))
class Slicer(object):