1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-02-22 10:05:47 +01:00

Convert calibre modules to ebook_converter.

Here is the first batch of modules, which are needed for converting
several formats to LRF. Some of the logic has been change, more cleanups
will follow.
This commit is contained in:
2020-04-11 19:33:43 +02:00
parent 69d2e536c5
commit 0f9792df36
252 changed files with 1925 additions and 2344 deletions

View File

@@ -5,8 +5,8 @@ from __future__ import absolute_import, division, print_function, unicode_litera
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
from css_selectors.parser import parse
from css_selectors.select import Select, INAPPROPRIATE_PSEUDO_CLASSES
from css_selectors.errors import SelectorError, SelectorSyntaxError, ExpressionError
from ebook_converter.css_selectors.parser import parse
from ebook_converter.css_selectors.select import Select, INAPPROPRIATE_PSEUDO_CLASSES
from ebook_converter.css_selectors.errors import SelectorError, SelectorSyntaxError, ExpressionError
__all__ = ['parse', 'Select', 'INAPPROPRIATE_PSEUDO_CLASSES', 'SelectorError', 'SelectorSyntaxError', 'ExpressionError']

View File

@@ -6,7 +6,7 @@ __license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import collections
from polyglot.builtins import string_or_bytes
from ebook_converter.polyglot.builtins import string_or_bytes
SLICE_ALL = slice(None)

View File

@@ -14,8 +14,8 @@ import re
import operator
import string
from css_selectors.errors import SelectorSyntaxError, ExpressionError
from polyglot.builtins import unicode_type, codepoint_to_chr, range
from ebook_converter.css_selectors.errors import SelectorSyntaxError, ExpressionError
from ebook_converter.polyglot.builtins import unicode_type, codepoint_to_chr, range
utab = {c:c+32 for c in range(ord(u'A'), ord(u'Z')+1)}

View File

@@ -12,11 +12,11 @@ from itertools import chain
from lxml import etree
from css_selectors.errors import ExpressionError
from css_selectors.parser import parse, ascii_lower, Element, FunctionalPseudoElement
from css_selectors.ordered_set import OrderedSet
from ebook_converter.css_selectors.errors import ExpressionError
from ebook_converter.css_selectors.parser import parse, ascii_lower, Element, FunctionalPseudoElement
from ebook_converter.css_selectors.ordered_set import OrderedSet
from polyglot.builtins import iteritems, itervalues
from ebook_converter.polyglot.builtins import iteritems, itervalues
PARSE_CACHE_SIZE = 200
parse_cache = OrderedDict()

View File

@@ -9,9 +9,9 @@ import unittest, sys, argparse
from lxml import etree, html
from css_selectors.errors import SelectorSyntaxError, ExpressionError
from css_selectors.parser import tokenize, parse
from css_selectors.select import Select
from ebook_converter.css_selectors.errors import SelectorSyntaxError, ExpressionError
from ebook_converter.css_selectors.parser import tokenize, parse
from ebook_converter.css_selectors.select import Select
class TestCSSSelectors(unittest.TestCase):