mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-24 15:11:30 +02:00
Removing unneeded from __future__ import statements.
Since we are on Python 3.6 and up, we don't need those anymore.
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from ebook_converter.css_selectors.parser import parse
|
from ebook_converter.css_selectors.parser import parse
|
||||||
from ebook_converter.css_selectors.select import Select, INAPPROPRIATE_PSEUDO_CLASSES
|
from ebook_converter.css_selectors.select import Select, INAPPROPRIATE_PSEUDO_CLASSES
|
||||||
from ebook_converter.css_selectors.errors import SelectorError, SelectorSyntaxError, ExpressionError
|
from ebook_converter.css_selectors.errors import SelectorError, SelectorSyntaxError, ExpressionError
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
__all__ = ['parse', 'Select', 'INAPPROPRIATE_PSEUDO_CLASSES', 'SelectorError', 'SelectorSyntaxError', 'ExpressionError']
|
__all__ = ['parse', 'Select', 'INAPPROPRIATE_PSEUDO_CLASSES', 'SelectorError', 'SelectorSyntaxError', 'ExpressionError']
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class SelectorError(ValueError):
|
class SelectorError(ValueError):
|
||||||
|
|
||||||
"""Common parent for SelectorSyntaxError and ExpressionError"""
|
"""Common parent for SelectorSyntaxError and ExpressionError"""
|
||||||
|
|
||||||
|
|
||||||
class SelectorSyntaxError(SelectorError):
|
class SelectorSyntaxError(SelectorError):
|
||||||
|
|
||||||
"""Parsing a selector that does not match the grammar."""
|
"""Parsing a selector that does not match the grammar."""
|
||||||
|
|
||||||
|
|
||||||
class ExpressionError(SelectorError):
|
class ExpressionError(SelectorError):
|
||||||
|
|
||||||
"""Unknown or unsupported selector (eg. pseudo-class)."""
|
"""Unknown or unsupported selector (eg. pseudo-class)."""
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
#!/usr/bin/env python2
|
import collections
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import string_or_bytes
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import collections
|
|
||||||
from ebook_converter.polyglot.builtins import string_or_bytes
|
|
||||||
|
|
||||||
SLICE_ALL = slice(None)
|
SLICE_ALL = slice(None)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re, itertools
|
import re, itertools
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
@@ -18,6 +11,10 @@ from ebook_converter.css_selectors.ordered_set import OrderedSet
|
|||||||
|
|
||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
PARSE_CACHE_SIZE = 200
|
PARSE_CACHE_SIZE = 200
|
||||||
parse_cache = OrderedDict()
|
parse_cache = OrderedDict()
|
||||||
XPATH_CACHE_SIZE = 30
|
XPATH_CACHE_SIZE = 30
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import unittest, sys, argparse
|
import unittest, sys, argparse
|
||||||
|
|
||||||
from lxml import etree, html
|
from lxml import etree, html
|
||||||
@@ -14,6 +7,10 @@ from ebook_converter.css_selectors.parser import tokenize, parse
|
|||||||
from ebook_converter.css_selectors.select import Select
|
from ebook_converter.css_selectors.select import Select
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class TestCSSSelectors(unittest.TestCase):
|
class TestCSSSelectors(unittest.TestCase):
|
||||||
|
|
||||||
# Test data {{{
|
# Test data {{{
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, sys, zipfile, importlib
|
import os, sys, zipfile, importlib
|
||||||
|
|
||||||
from ebook_converter.constants import numeric_version, iswindows, isosx
|
from ebook_converter.constants import numeric_version, iswindows, isosx
|
||||||
from ebook_converter.ptempfile import PersistentTemporaryFile
|
from ebook_converter.ptempfile import PersistentTemporaryFile
|
||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
platform = 'linux'
|
platform = 'linux'
|
||||||
if iswindows:
|
if iswindows:
|
||||||
platform = 'windows'
|
platform = 'windows'
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, glob, re
|
import os, glob, re
|
||||||
|
|
||||||
from ebook_converter import guess_type
|
from ebook_converter import guess_type
|
||||||
from ebook_converter.customize import (FileTypePlugin, MetadataReaderPlugin,
|
from ebook_converter.customize import (FileTypePlugin, MetadataReaderPlugin,
|
||||||
MetadataWriterPlugin, PreferencesPlugin, InterfaceActionBase, StoreBase)
|
MetadataWriterPlugin, PreferencesPlugin, InterfaceActionBase, StoreBase)
|
||||||
@@ -12,6 +7,10 @@ from ebook_converter.constants import numeric_version
|
|||||||
from ebook_converter.ebooks.metadata.archive import ArchiveExtract, KPFExtract, get_comic_metadata
|
from ebook_converter.ebooks.metadata.archive import ArchiveExtract, KPFExtract, get_comic_metadata
|
||||||
from ebook_converter.ebooks.html.to_zip import HTML2ZIP
|
from ebook_converter.ebooks.html.to_zip import HTML2ZIP
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
plugins = []
|
plugins = []
|
||||||
|
|
||||||
# To archive plugins {{{
|
# To archive plugins {{{
|
||||||
@@ -1945,7 +1944,6 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
subprocess.check_call(['python', '-c', textwrap.dedent(
|
subprocess.check_call(['python', '-c', textwrap.dedent(
|
||||||
'''
|
'''
|
||||||
from __future__ import print_function
|
|
||||||
import time, sys, init_calibre
|
import time, sys, init_calibre
|
||||||
st = time.time()
|
st = time.time()
|
||||||
import ebook_converter.customize.builtins
|
import ebook_converter.customize.builtins
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
"""
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
'''
|
|
||||||
Defines the plugin system for conversions.
|
Defines the plugin system for conversions.
|
||||||
'''
|
"""
|
||||||
import re, os, shutil, numbers
|
import re, os, shutil, numbers
|
||||||
|
|
||||||
from ebook_converter import CurrentDir
|
from ebook_converter import CurrentDir
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
from ebook_converter.customize import Plugin as _Plugin
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import zip
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.customize import Plugin as _Plugin
|
|
||||||
from ebook_converter.polyglot.builtins import zip
|
|
||||||
|
|
||||||
FONT_SIZES = [('xx-small', 1),
|
FONT_SIZES = [('xx-small', 1),
|
||||||
('x-small', None),
|
('x-small', None),
|
||||||
('small', 2),
|
('small', 2),
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, shutil, traceback, functools, sys
|
import os, shutil, traceback, functools, sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
@@ -24,6 +20,10 @@ from ebook_converter.utils.config import (make_config_dir, Config, ConfigProxy,
|
|||||||
from ebook_converter.constants import DEBUG, numeric_version
|
from ebook_converter.constants import DEBUG, numeric_version
|
||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, itervalues, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
builtin_names = frozenset(p.name for p in builtin_plugins)
|
builtin_names = frozenset(p.name for p in builtin_plugins)
|
||||||
BLACKLISTED_PLUGINS = frozenset({'Marvin XD', 'iOS reader applications'})
|
BLACKLISTED_PLUGINS = frozenset({'Marvin XD', 'iOS reader applications'})
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
#!/usr/bin/env python2
|
"""
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
PEP 302 based plugin loading mechanism, works around the bug in zipimport in
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
python 2.x that prevents importing from zip files in locations whose paths
|
||||||
|
have non ASCII characters
|
||||||
__license__ = 'GPL v3'
|
"""
|
||||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, zipfile, posixpath, importlib, threading, re, imp, sys
|
import os, zipfile, posixpath, importlib, threading, re, imp, sys
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@@ -17,9 +14,10 @@ from ebook_converter.customize import (Plugin, numeric_version, platform,
|
|||||||
from ebook_converter.polyglot.builtins import (itervalues, map, string_or_bytes,
|
from ebook_converter.polyglot.builtins import (itervalues, map, string_or_bytes,
|
||||||
unicode_type, reload)
|
unicode_type, reload)
|
||||||
|
|
||||||
# PEP 302 based plugin loading mechanism, works around the bug in zipimport in
|
|
||||||
# python 2.x that prevents importing from zip files in locations whose paths
|
__license__ = 'GPL v3'
|
||||||
# have non ASCII characters
|
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
def get_resources(zfp, name_or_list_of_names):
|
def get_resources(zfp, name_or_list_of_names):
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
# License: GPLv3 Copyright: 2010, Kovid Goyal <kovid at kovidgoyal.net>
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
# Contains various tweaks that affect calibre behavior. Only edit this file if
|
# Contains various tweaks that affect calibre behavior. Only edit this file if
|
||||||
# you know what you are doing. If you delete this file, it will be recreated from
|
# you know what you are doing. If you delete this file, it will be recreated from
|
||||||
# defaults.
|
# defaults.
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
import os
|
import os
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -10,6 +6,10 @@ from ebook_converter.constants import iswindows
|
|||||||
from ebook_converter.customize import Plugin
|
from ebook_converter.customize import Plugin
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class DevicePlugin(Plugin):
|
class DevicePlugin(Plugin):
|
||||||
"""
|
"""
|
||||||
Defines the interface that should be implemented by backends that
|
Defines the interface that should be implemented by backends that
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
|
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
import bs4
|
import bs4
|
||||||
from bs4 import ( # noqa
|
from bs4 import ( # noqa
|
||||||
CData, Comment, Declaration, NavigableString, ProcessingInstruction,
|
CData, Comment, Declaration, NavigableString, ProcessingInstruction,
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
#!/usr/bin/env python2
|
import re, codecs
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re, codecs
|
|
||||||
from ebook_converter.polyglot.builtins import unicode_type
|
|
||||||
|
|
||||||
_encoding_pats = (
|
_encoding_pats = (
|
||||||
# XML declaration
|
# XML declaration
|
||||||
r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import io
|
import io
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
from ebook_converter.constants import plugins
|
|
||||||
from ebook_converter.ebooks.compression import cPalmdoc
|
from ebook_converter.ebooks.compression import cPalmdoc
|
||||||
from ebook_converter.polyglot.builtins import range
|
from ebook_converter.polyglot.builtins import range
|
||||||
#cPalmdoc = plugins['cPalmdoc'][0]
|
|
||||||
#if not cPalmdoc:
|
|
||||||
# raise RuntimeError(('Failed to load required cPalmdoc module: '
|
__license__ = 'GPL v3'
|
||||||
# '%s')%plugins['cPalmdoc'][1])
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def decompress_doc(data):
|
def decompress_doc(data):
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
from ebook_converter.polyglot.builtins import native_string_type
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.polyglot.builtins import native_string_type
|
|
||||||
|
|
||||||
|
|
||||||
class ConversionUserFeedBack(Exception):
|
class ConversionUserFeedBack(Exception):
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
'''
|
|
||||||
Command line interface to conversion sub-system
|
Command line interface to conversion sub-system
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import sys, os, numbers
|
import sys, os, numbers
|
||||||
from optparse import OptionGroup, Option
|
from optparse import OptionGroup, Option
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
@@ -20,6 +13,11 @@ from ebook_converter.ebooks.conversion import ConversionUserFeedBack
|
|||||||
from ebook_converter.utils.localization import localize_user_manual_link
|
from ebook_converter.utils.localization import localize_user_manual_link
|
||||||
from ebook_converter.polyglot.builtins import iteritems
|
from ebook_converter.polyglot.builtins import iteritems
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
USAGE = '%prog ' + _('''\
|
USAGE = '%prog ' + _('''\
|
||||||
input_file output_file [options]
|
input_file output_file [options]
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
|
||||||
from ebook_converter.polyglot.builtins import getcwd
|
|
||||||
|
|
||||||
|
|
||||||
class AZW4Input(InputFormatPlugin):
|
class AZW4Input(InputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
CHM File decoding support
|
||||||
''' CHM File decoding support '''
|
"""
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>,' \
|
|
||||||
' and Alex Bramley <a.bramley at gmail.com>.'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
@@ -12,6 +8,10 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter.constants import filesystem_encoding
|
from ebook_converter.constants import filesystem_encoding
|
||||||
from ebook_converter.polyglot.builtins import unicode_type, as_bytes
|
from ebook_converter.polyglot.builtins import unicode_type, as_bytes
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = ('2008, Kovid Goyal <kovid at kovidgoyal.net>, '
|
||||||
|
'and Alex Bramley <a.bramley at gmail.com>.')
|
||||||
|
|
||||||
|
|
||||||
class CHMInput(InputFormatPlugin):
|
class CHMInput(InputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
'''
|
|
||||||
Based on ideas from comiclrf created by FangornUK.
|
Based on ideas from comiclrf created by FangornUK.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import shutil, textwrap, codecs, os
|
import shutil, textwrap, codecs, os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
@@ -16,6 +9,11 @@ from ebook_converter.ptempfile import PersistentTemporaryDirectory
|
|||||||
from ebook_converter.polyglot.builtins import getcwd, map
|
from ebook_converter.polyglot.builtins import getcwd, map
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class ComicInput(InputFormatPlugin):
|
class ComicInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'Comic Input'
|
name = 'Comic Input'
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2011, Anthon van der Neut <anthon@mnt.org>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
@@ -13,6 +5,11 @@ from ebook_converter.customize.conversion import InputFormatPlugin
|
|||||||
from ebook_converter.polyglot.builtins import getcwd
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2011, Anthon van der Neut <anthon@mnt.org>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class DJVUInput(InputFormatPlugin):
|
class DJVUInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'DJVU Input'
|
name = 'DJVU Input'
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
|
||||||
|
|
||||||
|
|
||||||
class DOCXInput(InputFormatPlugin):
|
class DOCXInput(InputFormatPlugin):
|
||||||
name = 'DOCX Input'
|
name = 'DOCX Input'
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
|
||||||
|
|
||||||
PAGE_SIZES = ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1',
|
PAGE_SIZES = ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1',
|
||||||
'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'letter']
|
'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'letter']
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, re, posixpath
|
import os, re, posixpath
|
||||||
from itertools import cycle
|
from itertools import cycle
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
from ebook_converter.polyglot.builtins import getcwd
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
ADOBE_OBFUSCATION = 'http://ns.adobe.com/pdf/enc#RC'
|
ADOBE_OBFUSCATION = 'http://ns.adobe.com/pdf/enc#RC'
|
||||||
IDPF_OBFUSCATION = 'http://www.idpf.org/2008/embedding'
|
IDPF_OBFUSCATION = 'http://www.idpf.org/2008/embedding'
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, shutil, re
|
import os, shutil, re
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
||||||
@@ -14,6 +6,11 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter import CurrentDir
|
from ebook_converter import CurrentDir
|
||||||
from ebook_converter.polyglot.builtins import unicode_type, filter, map, zip, range, as_bytes
|
from ebook_converter.polyglot.builtins import unicode_type, filter, map, zip, range, as_bytes
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
block_level_tags = (
|
block_level_tags = (
|
||||||
'address',
|
'address',
|
||||||
'body',
|
'body',
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Anatoly Shipitsin <norguhtar at gmail.com>'
|
|
||||||
"""
|
"""
|
||||||
Convert .fb2 files to .lrf
|
Convert .fb2 files to .lrf
|
||||||
"""
|
"""
|
||||||
@@ -12,6 +8,10 @@ from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecomm
|
|||||||
from ebook_converter import guess_type
|
from ebook_converter import guess_type
|
||||||
from ebook_converter.polyglot.builtins import iteritems, getcwd
|
from ebook_converter.polyglot.builtins import iteritems, getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Anatoly Shipitsin <norguhtar at gmail.com>'
|
||||||
|
|
||||||
FB2NS = 'http://www.gribuser.ru/xml/fictionbook/2.0'
|
FB2NS = 'http://www.gribuser.ru/xml/fictionbook/2.0'
|
||||||
FB21NS = 'http://www.gribuser.ru/xml/fictionbook/2.1'
|
FB21NS = 'http://www.gribuser.ru/xml/fictionbook/2.1'
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
import os
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
|
||||||
|
|
||||||
|
|
||||||
class FB2Output(OutputFormatPlugin):
|
class FB2Output(OutputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import re, tempfile, os
|
import re, tempfile, os
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
@@ -18,6 +10,11 @@ from ebook_converter.utils.imghdr import what
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type, zip, getcwd, as_unicode
|
from ebook_converter.polyglot.builtins import unicode_type, zip, getcwd, as_unicode
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
def sanitize_file_name(x):
|
def sanitize_file_name(x):
|
||||||
ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.')
|
ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.')
|
||||||
ans, ext = ans.rpartition('.')[::2]
|
ans, ext = ans.rpartition('.')[::2]
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2010, Fabian Grassl <fg@jusmeum.de>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, re, shutil
|
import os, re, shutil
|
||||||
from os.path import dirname, abspath, relpath as _relpath, exists, basename
|
from os.path import dirname, abspath, relpath as _relpath, exists, basename
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
@@ -14,6 +8,11 @@ from ebook_converter.ptempfile import PersistentTemporaryDirectory
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2010, Fabian Grassl <fg@jusmeum.de>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
def relpath(*args):
|
def relpath(*args):
|
||||||
return _relpath(*args).replace(os.sep, '/')
|
return _relpath(*args).replace(os.sep, '/')
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter import guess_type
|
from ebook_converter import guess_type
|
||||||
@@ -13,6 +5,11 @@ from ebook_converter.customize.conversion import InputFormatPlugin
|
|||||||
from ebook_converter.polyglot.builtins import getcwd
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class HTMLZInput(InputFormatPlugin):
|
class HTMLZInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'HTLZ Input'
|
name = 'HTLZ Input'
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -15,6 +7,11 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class HTMLZOutput(OutputFormatPlugin):
|
class HTMLZOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'HTMLZ Output'
|
name = 'HTMLZ Output'
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
|
||||||
|
|
||||||
|
|
||||||
class LITInput(InputFormatPlugin):
|
class LITInput(InputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.customize.conversion import OutputFormatPlugin
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin
|
|
||||||
|
|
||||||
|
|
||||||
class LITOutput(OutputFormatPlugin):
|
class LITOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'LIT Output'
|
name = 'LIT Output'
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class LRFInput(InputFormatPlugin):
|
class LRFInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'LRF Input'
|
name = 'LRF Input'
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin
|
from ebook_converter.customize.conversion import OutputFormatPlugin
|
||||||
@@ -13,6 +5,11 @@ from ebook_converter.customize.conversion import OptionRecommendation
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class LRFOptions(object):
|
class LRFOptions(object):
|
||||||
|
|
||||||
def __init__(self, output, opts, oeb):
|
def __init__(self, output, opts, oeb):
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class MOBIInput(InputFormatPlugin):
|
class MOBIInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'MOBI Input'
|
name = 'MOBI Input'
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
OptionRecommendation)
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
|
||||||
OptionRecommendation)
|
|
||||||
from ebook_converter.polyglot.builtins import unicode_type
|
|
||||||
|
|
||||||
|
|
||||||
def remove_html_cover(oeb, log):
|
def remove_html_cover(oeb, log):
|
||||||
from ebook_converter.ebooks.oeb.base import OEB_DOCS
|
from ebook_converter.ebooks.oeb.base import OEB_DOCS
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
Convert an ODT file into a Open Ebook
|
||||||
|
"""
|
||||||
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
'''
|
|
||||||
Convert an ODT file into a Open Ebook
|
|
||||||
'''
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
|
||||||
|
|
||||||
|
|
||||||
class ODTInput(InputFormatPlugin):
|
class ODTInput(InputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, re
|
import os, re
|
||||||
|
|
||||||
|
|
||||||
@@ -12,6 +6,11 @@ from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
|||||||
from ebook_converter import CurrentDir
|
from ebook_converter import CurrentDir
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class OEBOutput(OutputFormatPlugin):
|
class OEBOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'OEB Output'
|
name = 'OEB Output'
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
|
||||||
from ebook_converter.polyglot.builtins import getcwd
|
|
||||||
|
|
||||||
|
|
||||||
class PDBInput(InputFormatPlugin):
|
class PDBInput(InputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
||||||
@@ -12,6 +5,11 @@ from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
|||||||
from ebook_converter.ebooks.pdb import PDBError, get_writer, ALL_FORMAT_WRITERS
|
from ebook_converter.ebooks.pdb import PDBError, get_writer, ALL_FORMAT_WRITERS
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class PDBOutput(OutputFormatPlugin):
|
class PDBOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'PDB Output'
|
name = 'PDB Output'
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
from ebook_converter.polyglot.builtins import as_bytes, getcwd
|
from ebook_converter.polyglot.builtins import as_bytes, getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class PDFInput(InputFormatPlugin):
|
class PDFInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'PDF Input'
|
name = 'PDF Input'
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
"""
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
'''
|
|
||||||
Convert OEB ebook format to PDF.
|
Convert OEB ebook format to PDF.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import glob, os
|
import glob, os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
||||||
@@ -16,6 +8,11 @@ from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
|||||||
from ebook_converter.ptempfile import TemporaryDirectory
|
from ebook_converter.ptempfile import TemporaryDirectory
|
||||||
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
UNITS = ('millimeter', 'centimeter', 'point', 'inch' , 'pica' , 'didot',
|
UNITS = ('millimeter', 'centimeter', 'point', 'inch' , 'pica' , 'didot',
|
||||||
'cicero', 'devicepixel')
|
'cicero', 'devicepixel')
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
@@ -14,6 +7,11 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter.polyglot.builtins import getcwd
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class PMLInput(InputFormatPlugin):
|
class PMLInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'PML Input'
|
name = 'PML Input'
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, io
|
import os, io
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
from ebook_converter.customize.conversion import (OutputFormatPlugin,
|
||||||
@@ -13,6 +6,11 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class PMLOutput(OutputFormatPlugin):
|
class PMLOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'PML Output'
|
name = 'PML Output'
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
|
||||||
from ebook_converter.polyglot.builtins import getcwd
|
|
||||||
|
|
||||||
|
|
||||||
class RBInput(InputFormatPlugin):
|
class RBInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'RB Input'
|
name = 'RB Input'
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
import os
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
|
||||||
|
|
||||||
|
|
||||||
class RBOutput(OutputFormatPlugin):
|
class RBOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
@@ -14,6 +6,11 @@ from ebook_converter import walk
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class RecipeDisabled(Exception):
|
class RecipeDisabled(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
from __future__ import with_statement, unicode_literals
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, glob, re, textwrap
|
import os, glob, re, textwrap
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
from ebook_converter.polyglot.builtins import iteritems, filter, getcwd, as_bytes
|
from ebook_converter.polyglot.builtins import iteritems, filter, getcwd, as_bytes
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
border_style_map = {
|
border_style_map = {
|
||||||
'single' : 'solid',
|
'single' : 'solid',
|
||||||
'double-thickness-border' : 'double',
|
'double-thickness-border' : 'double',
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
import os
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
from ebook_converter.customize.conversion import OutputFormatPlugin
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin
|
|
||||||
|
|
||||||
|
|
||||||
class RTFOutput(OutputFormatPlugin):
|
class RTFOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
@@ -12,6 +5,11 @@ from ebook_converter.ptempfile import TemporaryDirectory
|
|||||||
from ebook_converter.utils.filenames import ascii_filename
|
from ebook_converter.utils.filenames import ascii_filename
|
||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
HTML_TEMPLATE = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>%s</title></head><body>\n%s\n</body></html>'
|
HTML_TEMPLATE = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>%s</title></head><body>\n%s\n</body></html>'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
||||||
@@ -13,6 +6,11 @@ from ebook_converter.constants import __appname__, __version__
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class SNBOutput(OutputFormatPlugin):
|
class SNBOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'SNB Output'
|
name = 'SNB Output'
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin
|
from ebook_converter.customize.conversion import InputFormatPlugin
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class TCRInput(InputFormatPlugin):
|
class TCRInput(InputFormatPlugin):
|
||||||
|
|
||||||
name = 'TCR Input'
|
name = 'TCR Input'
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
||||||
OptionRecommendation
|
OptionRecommendation
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class TCROutput(OutputFormatPlugin):
|
class TCROutput(OutputFormatPlugin):
|
||||||
|
|
||||||
name = 'TCR Output'
|
name = 'TCR Output'
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ebook_converter import _ent_pat, walk, xml_entity_to_unicode
|
from ebook_converter import _ent_pat, walk, xml_entity_to_unicode
|
||||||
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
from ebook_converter.polyglot.builtins import getcwd
|
from ebook_converter.polyglot.builtins import getcwd
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
MD_EXTENSIONS = {
|
MD_EXTENSIONS = {
|
||||||
'abbr': _('Abbreviations'),
|
'abbr': _('Abbreviations'),
|
||||||
'admonition': _('Support admonitions'),
|
'admonition': _('Support admonitions'),
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
from ebook_converter.customize.conversion import OutputFormatPlugin, \
|
||||||
OptionRecommendation
|
OptionRecommendation
|
||||||
from ebook_converter.ptempfile import TemporaryDirectory, TemporaryFile
|
from ebook_converter.ptempfile import TemporaryDirectory, TemporaryFile
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
NEWLINE_TYPES = ['system', 'unix', 'old_mac', 'windows']
|
NEWLINE_TYPES = ['system', 'unix', 'old_mac', 'windows']
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os, re, sys, shutil, pprint, json
|
import os, re, sys, shutil, pprint, json
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
@@ -22,6 +15,11 @@ from ebook_converter import (extract, walk, isbytestring, filesystem_encoding,
|
|||||||
from ebook_converter.constants import __version__
|
from ebook_converter.constants import __version__
|
||||||
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes, map
|
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes, map
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
DEBUG_README=b'''
|
DEBUG_README=b'''
|
||||||
This debug directory contains snapshots of the e-book as it passes through the
|
This debug directory contains snapshots of the e-book as it passes through the
|
||||||
various stages of conversion. The stages are:
|
various stages of conversion. The stages are:
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import functools, re, json
|
import functools, re, json
|
||||||
from math import ceil
|
from math import ceil
|
||||||
|
|
||||||
from ebook_converter import entity_to_unicode, as_unicode
|
from ebook_converter import entity_to_unicode, as_unicode
|
||||||
from ebook_converter.polyglot.builtins import unicode_type, range
|
from ebook_converter.polyglot.builtins import unicode_type, range
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>')
|
XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>')
|
||||||
SVG_NS = 'http://www.w3.org/2000/svg'
|
SVG_NS = 'http://www.w3.org/2000/svg'
|
||||||
XLINK_NS = 'http://www.w3.org/1999/xlink'
|
XLINK_NS = 'http://www.w3.org/1999/xlink'
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from ebook_converter.ebooks.conversion.preprocess import DocAnalysis, Dehyphenator
|
from ebook_converter.ebooks.conversion.preprocess import DocAnalysis, Dehyphenator
|
||||||
@@ -14,6 +6,11 @@ from ebook_converter.utils.wordcount import get_wordcount_obj
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class HeuristicProcessor(object):
|
class HeuristicProcessor(object):
|
||||||
|
|
||||||
def __init__(self, extra_opts=None, log=None):
|
def __init__(self, extra_opts=None, log=None):
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re, random, unicodedata, numbers
|
import re, random, unicodedata, numbers
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
@@ -27,6 +20,10 @@ from ebook_converter.gui2 import ensure_app, config, load_builtin_fonts, pixmap_
|
|||||||
from ebook_converter.utils.cleantext import clean_ascii_chars, clean_xml_chars
|
from ebook_converter.utils.cleantext import clean_ascii_chars, clean_xml_chars
|
||||||
from ebook_converter.utils.config import JSONConfig
|
from ebook_converter.utils.config import JSONConfig
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
# Default settings {{{
|
# Default settings {{{
|
||||||
cprefs = JSONConfig('cover_generation')
|
cprefs = JSONConfig('cover_generation')
|
||||||
cprefs.defaults['title_font_size'] = 120 # px
|
cprefs.defaults['title_font_size'] = 120 # px
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class InvalidDOCX(ValueError):
|
class InvalidDOCX(ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import numbers
|
import numbers
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from ebook_converter.polyglot.builtins import iteritems
|
from ebook_converter.polyglot.builtins import iteritems
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class Inherit(object):
|
class Inherit(object):
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from ebook_converter.ebooks.docx.block_styles import ( # noqa
|
from ebook_converter.ebooks.docx.block_styles import ( # noqa
|
||||||
inherit, simple_color, LINE_STYLES, simple_float, binary_property, read_shd)
|
inherit, simple_color, LINE_STYLES, simple_float, binary_property, read_shd)
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
# Read from XML {{{
|
# Read from XML {{{
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env python2
|
import os
|
||||||
# vim:fileencoding=utf-8
|
from ebook_converter.polyglot.builtins import itervalues, range
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import os
|
|
||||||
from ebook_converter.polyglot.builtins import itervalues, range
|
|
||||||
|
|
||||||
NBSP = '\xa0'
|
NBSP = '\xa0'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, sys, shutil
|
import os, sys, shutil
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
@@ -21,6 +14,10 @@ from ebook_converter.utils.zipfile import ZipFile
|
|||||||
from ebook_converter.utils.xml_parse import safe_xml_fromstring
|
from ebook_converter.utils.xml_parse import safe_xml_fromstring
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def fromstring(raw, parser=None):
|
def fromstring(raw, parser=None):
|
||||||
return safe_xml_fromstring(raw)
|
return safe_xml_fromstring(raw)
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from ebook_converter.ebooks.docx.index import process_index, polish_index_markup
|
from ebook_converter.ebooks.docx.index import process_index, polish_index_markup
|
||||||
from ebook_converter.polyglot.builtins import iteritems, native_string_type
|
from ebook_converter.polyglot.builtins import iteritems, native_string_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class Field(object):
|
class Field(object):
|
||||||
|
|
||||||
def __init__(self, start):
|
def __init__(self, start):
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os, re
|
import os, re
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
@@ -15,6 +8,10 @@ from ebook_converter.utils.fonts.utils import panose_to_css_generic_family, is_t
|
|||||||
from ebook_converter.utils.icu import ord_string
|
from ebook_converter.utils.icu import ord_string
|
||||||
from ebook_converter.polyglot.builtins import codepoint_to_chr, iteritems, range
|
from ebook_converter.polyglot.builtins import codepoint_to_chr, iteritems, range
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
Embed = namedtuple('Embed', 'name key subsetted')
|
Embed = namedtuple('Embed', 'name key subsetted')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env python2
|
from collections import OrderedDict
|
||||||
# vim:fileencoding=utf-8
|
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from collections import OrderedDict
|
|
||||||
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
|
||||||
|
|
||||||
|
|
||||||
class Note(object):
|
class Note(object):
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from lxml.html.builder import IMG, HR
|
from lxml.html.builder import IMG, HR
|
||||||
@@ -17,6 +10,10 @@ from ebook_converter.utils.imghdr import what
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class LinkedImageNotFound(ValueError):
|
class LinkedImageNotFound(ValueError):
|
||||||
|
|
||||||
def __init__(self, fname):
|
def __init__(self, fname):
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
@@ -13,6 +6,10 @@ from ebook_converter.utils.icu import partition_by_first_letter, sort_key
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, filter
|
from ebook_converter.polyglot.builtins import iteritems, filter
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def get_applicable_xe_fields(index, xe_fields, XPath, expand):
|
def get_applicable_xe_fields(index, xe_fields, XPath, expand):
|
||||||
iet = index.get('entry-type', None)
|
iet = index.get('entry-type', None)
|
||||||
xe_fields = [xe for xe in xe_fields if xe.get('entry-type', None) == iet]
|
xe_fields = [xe for xe in xe_fields if xe.get('entry-type', None) == iet]
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from lxml.etree import XPath as X
|
from lxml.etree import XPath as X
|
||||||
@@ -12,6 +5,10 @@ from lxml.etree import XPath as X
|
|||||||
from ebook_converter.utils.filenames import ascii_text
|
from ebook_converter.utils.filenames import ascii_text
|
||||||
from ebook_converter.polyglot.builtins import iteritems
|
from ebook_converter.polyglot.builtins import iteritems
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
# Names {{{
|
# Names {{{
|
||||||
TRANSITIONAL_NAMES = {
|
TRANSITIONAL_NAMES = {
|
||||||
'DOCUMENT' : 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',
|
'DOCUMENT' : 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re, string
|
import re, string
|
||||||
from collections import Counter, defaultdict
|
from collections import Counter, defaultdict
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@@ -16,6 +9,10 @@ from ebook_converter.ebooks.docx.char_styles import RunStyle, inherit
|
|||||||
from ebook_converter.ebooks.metadata import roman
|
from ebook_converter.ebooks.metadata import roman
|
||||||
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
STYLE_MAP = {
|
STYLE_MAP = {
|
||||||
'aiueo': 'hiragana',
|
'aiueo': 'hiragana',
|
||||||
'aiueoFullWidth': 'hiragana',
|
'aiueoFullWidth': 'hiragana',
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from collections import OrderedDict, Counter
|
from collections import OrderedDict, Counter
|
||||||
|
|
||||||
@@ -14,6 +7,10 @@ from ebook_converter.ebooks.docx.tables import TableStyle
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class PageProperties(object):
|
class PageProperties(object):
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from lxml.html.builder import TABLE, TR, TD
|
from lxml.html.builder import TABLE, TR, TD
|
||||||
|
|
||||||
from ebook_converter.ebooks.docx.block_styles import inherit, read_shd as rs, read_border, binary_property, border_props, ParagraphStyle, border_to_css
|
from ebook_converter.ebooks.docx.block_styles import inherit, read_shd as rs, read_border, binary_property, border_props, ParagraphStyle, border_to_css
|
||||||
from ebook_converter.ebooks.docx.char_styles import RunStyle
|
from ebook_converter.ebooks.docx.char_styles import RunStyle
|
||||||
from ebook_converter.polyglot.builtins import filter, iteritems, itervalues, range, unicode_type
|
from ebook_converter.polyglot.builtins import filter, iteritems, itervalues, range, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
# Read from XML {{{
|
# Read from XML {{{
|
||||||
read_shd = rs
|
read_shd = rs
|
||||||
edges = ('left', 'top', 'right', 'bottom')
|
edges = ('left', 'top', 'right', 'bottom')
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import sys, os, re, math, errno, uuid, numbers
|
import sys, os, re, math, errno, uuid, numbers
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
|
|
||||||
@@ -31,6 +24,9 @@ from ebook_converter.utils.localization import canonicalize_lang, lang_as_iso639
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues, filter, getcwd, map, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, itervalues, filter, getcwd, map, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
NBSP = '\xa0'
|
NBSP = '\xa0'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from itertools import count
|
from itertools import count
|
||||||
|
|
||||||
@@ -15,6 +8,10 @@ from ebook_converter.ebooks.oeb.polish.toc import elem_to_toc_text
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, range
|
from ebook_converter.polyglot.builtins import iteritems, range
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def from_headings(body, log, namespace, num_levels=3):
|
def from_headings(body, log, namespace, num_levels=3):
|
||||||
' Create a TOC from headings in the document '
|
' Create a TOC from headings in the document '
|
||||||
tocroot = TOC()
|
tocroot = TOC()
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import textwrap, os
|
import textwrap, os
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
@@ -21,6 +14,10 @@ from ebook_converter.utils.zipfile import ZipFile
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, map, unicode_type, native_string_type
|
from ebook_converter.polyglot.builtins import iteritems, map, unicode_type, native_string_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def xml2str(root, pretty_print=False, with_tail=False):
|
def xml2str(root, pretty_print=False, with_tail=False):
|
||||||
if hasattr(etree, 'cleanup_namespaces'):
|
if hasattr(etree, 'cleanup_namespaces'):
|
||||||
etree.cleanup_namespaces(root)
|
etree.cleanup_namespaces(root)
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
@@ -13,6 +6,10 @@ from ebook_converter.ebooks.oeb.transforms.subset import find_font_face_rules
|
|||||||
from ebook_converter.polyglot.builtins import range
|
from ebook_converter.polyglot.builtins import range
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def obfuscate_font_data(data, key):
|
def obfuscate_font_data(data, key):
|
||||||
prefix = bytearray(data[:32])
|
prefix = bytearray(data[:32])
|
||||||
key = bytearray(reversed(key.bytes))
|
key = bytearray(reversed(key.bytes))
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
@@ -21,6 +14,10 @@ from ebook_converter.utils.localization import lang_as_iso639_1
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes
|
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def lang_for_tag(tag):
|
def lang_for_tag(tag):
|
||||||
for attr in ('lang', '{http://www.w3.org/XML/1998/namespace}lang'):
|
for attr in ('lang', '{http://www.w3.org/XML/1998/namespace}lang'):
|
||||||
val = lang_as_iso639_1(tag.get(attr))
|
val = lang_as_iso639_1(tag.get(attr))
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
@@ -19,6 +12,10 @@ from ebook_converter.ebooks.docx.images import pt_to_emu
|
|||||||
from ebook_converter.utils.filenames import ascii_filename
|
from ebook_converter.utils.filenames import ascii_filename
|
||||||
from ebook_converter.utils.imghdr import identify
|
from ebook_converter.utils.imghdr import identify
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
Image = namedtuple('Image', 'rid fname width height fmt item')
|
Image = namedtuple('Image', 'rid fname width height fmt item')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import posixpath, re
|
import posixpath, re
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
@@ -13,6 +6,10 @@ from ebook_converter.polyglot.builtins import unicode_type
|
|||||||
from ebook_converter.polyglot.urllib import urlparse
|
from ebook_converter.polyglot.urllib import urlparse
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def start_text(tag, prefix_len=0, top_level=True):
|
def start_text(tag, prefix_len=0, top_level=True):
|
||||||
ans = tag.text or ''
|
ans = tag.text or ''
|
||||||
limit = 50 - prefix_len
|
limit = 50 - prefix_len
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
|
|
||||||
from ebook_converter.polyglot.builtins import iteritems, itervalues, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, itervalues, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
LIST_STYLES = frozenset(
|
LIST_STYLES = frozenset(
|
||||||
'disc circle square decimal decimal-leading-zero lower-roman upper-roman'
|
'disc circle square decimal decimal-leading-zero lower-roman upper-roman'
|
||||||
' lower-greek lower-alpha lower-latin upper-alpha upper-latin hiragana hebrew'
|
' lower-greek lower-alpha lower-latin upper-alpha upper-latin hiragana hebrew'
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
import numbers
|
import numbers
|
||||||
from collections import Counter, defaultdict
|
from collections import Counter, defaultdict
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
@@ -17,6 +10,10 @@ from ebook_converter.utils.localization import lang_as_iso639_1
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, filter, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, filter, unicode_type
|
||||||
from ebook_converter.tinycss.css21 import CSS21Parser
|
from ebook_converter.tinycss.css21 import CSS21Parser
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
css_parser = CSS21Parser()
|
css_parser = CSS21Parser()
|
||||||
|
|
||||||
border_edges = ('left', 'top', 'right', 'bottom')
|
border_edges = ('left', 'top', 'right', 'bottom')
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
from ebook_converter.ebooks.docx.writer.utils import convert_color
|
from ebook_converter.ebooks.docx.writer.utils import convert_color
|
||||||
@@ -12,6 +5,10 @@ from ebook_converter.ebooks.docx.writer.styles import read_css_block_borders as
|
|||||||
from ebook_converter.polyglot.builtins import iteritems, range, unicode_type
|
from ebook_converter.polyglot.builtins import iteritems, range, unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
class Dummy(object):
|
class Dummy(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#!/usr/bin/env python2
|
from ebook_converter.tinycss.color3 import parse_color_string
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from ebook_converter.tinycss.color3 import parse_color_string
|
|
||||||
|
|
||||||
|
|
||||||
def int_or_zero(raw):
|
def int_or_zero(raw):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
Conversion to EPUB.
|
||||||
|
"""
|
||||||
|
from ebook_converter.utils.zipfile import ZipFile, ZIP_STORED
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
'''
|
|
||||||
Conversion to EPUB.
|
|
||||||
'''
|
|
||||||
from ebook_converter.utils.zipfile import ZipFile, ZIP_STORED
|
|
||||||
|
|
||||||
|
|
||||||
def rules(stylesheets):
|
def rules(stylesheets):
|
||||||
for s in stylesheets:
|
for s in stylesheets:
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
"""
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
'''
|
|
||||||
Transform OEB content into FB2 markup
|
Transform OEB content into FB2 markup
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import re, textwrap, uuid
|
import re, textwrap, uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@@ -25,6 +17,11 @@ from ebook_converter.polyglot.binary import as_base64_unicode
|
|||||||
from ebook_converter.polyglot.urllib import urlparse
|
from ebook_converter.polyglot.urllib import urlparse
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class FB2MLizer(object):
|
class FB2MLizer(object):
|
||||||
'''
|
'''
|
||||||
Todo: * Include more FB2 specific tags in the conversion.
|
Todo: * Include more FB2 specific tags in the conversion.
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
"""
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
|
||||||
Input plugin for HTML or OPF ebooks.
|
Input plugin for HTML or OPF ebooks.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import os, re, sys, errno as gerrno
|
import os, re, sys, errno as gerrno
|
||||||
|
|
||||||
from ebook_converter.ebooks.oeb.base import urlunquote
|
from ebook_converter.ebooks.oeb.base import urlunquote
|
||||||
@@ -21,6 +11,11 @@ from ebook_converter.polyglot.builtins import is_py3, unicode_type
|
|||||||
from ebook_converter.polyglot.urllib import urlparse, urlunparse
|
from ebook_converter.polyglot.urllib import urlparse, urlunparse
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class Link(object):
|
class Link(object):
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import textwrap, os, glob
|
import textwrap, os, glob
|
||||||
|
|
||||||
from ebook_converter.customize import FileTypePlugin
|
from ebook_converter.customize import FileTypePlugin
|
||||||
@@ -13,6 +5,11 @@ from ebook_converter.constants import numeric_version
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type
|
from ebook_converter.polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
class HTML2ZIP(FileTypePlugin):
|
class HTML2ZIP(FileTypePlugin):
|
||||||
name = 'HTML to ZIP'
|
name = 'HTML to ZIP'
|
||||||
author = 'Kovid Goyal'
|
author = 'Kovid Goyal'
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
html5_entities = {
|
html5_entities = {
|
||||||
# ENTITY_DATA {{{
|
# ENTITY_DATA {{{
|
||||||
'AElig': 'Æ',
|
'AElig': 'Æ',
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
"""
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
'''
|
|
||||||
Transform OEB content into a single (more or less) HTML file.
|
Transform OEB content into a single (more or less) HTML file.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -24,6 +15,11 @@ from ebook_converter.utils.logging import default_log
|
|||||||
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes, as_bytes
|
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes, as_bytes
|
||||||
from ebook_converter.polyglot.urllib import urldefrag
|
from ebook_converter.polyglot.urllib import urldefrag
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
SELF_CLOSING_TAGS = {'area', 'base', 'basefont', 'br', 'hr', 'input', 'img', 'link', 'meta'}
|
SELF_CLOSING_TAGS = {'area', 'base', 'basefont', 'br', 'hr', 'input', 'img', 'link', 'meta'}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
"""
|
"""
|
||||||
This package contains logic to read and write LRF files.
|
This package contains logic to read and write LRF files.
|
||||||
The LRF file format is documented at U{http://www.sven.de/librie/Librie/LrfFormat}.
|
The LRF file format is documented at
|
||||||
|
http://www.sven.de/librie/Librie/LrfFormat.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ebook_converter.ebooks.lrf.pylrs.pylrs import Book as _Book
|
from ebook_converter.ebooks.lrf.pylrs.pylrs import Book as _Book
|
||||||
from ebook_converter.ebooks.lrf.pylrs.pylrs import TextBlock, Header, \
|
from ebook_converter.ebooks.lrf.pylrs.pylrs import TextBlock, Header, \
|
||||||
TextStyle, BlockStyle
|
TextStyle, BlockStyle
|
||||||
from ebook_converter.ebooks.lrf.fonts import FONT_FILE_MAP
|
from ebook_converter.ebooks.lrf.fonts import FONT_FILE_MAP
|
||||||
from ebook_converter.ebooks import ConversionError
|
from ebook_converter.ebooks import ConversionError
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
"""
|
||||||
|
Default fonts used in the PRS500
|
||||||
__license__ = 'GPL v3'
|
"""
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
|
|
||||||
from PIL import ImageFont
|
from PIL import ImageFont
|
||||||
|
|
||||||
from ebook_converter.utils.fonts.scanner import font_scanner
|
from ebook_converter.utils.fonts.scanner import font_scanner
|
||||||
|
|
||||||
'''
|
|
||||||
Default fonts used in the PRS500
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
LIBERATION_FONT_MAP = {'Swis721 BT Roman': 'Liberation Sans Regular',
|
LIBERATION_FONT_MAP = {'Swis721 BT Roman': 'Liberation Sans Regular',
|
||||||
'Dutch801 Rm BT Roman': 'Liberation Serif Regular',
|
'Dutch801 Rm BT Roman': 'Liberation Serif Regular',
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
import re
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
NAME_MAP = {
|
NAME_MAP = {
|
||||||
'aliceblue': '#F0F8FF',
|
'aliceblue': '#F0F8FF',
|
||||||
'antiquewhite': '#FAEBD7',
|
'antiquewhite': '#FAEBD7',
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
# vim:fileencoding=utf-8
|
"""
|
||||||
# License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
|
Code to convert HTML ebooks into LRF ebooks.
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
|
I am indebted to esperanc for the initial CSS->Xylog Style conversion code
|
||||||
|
and to Falstaff for pylrs.
|
||||||
|
|
||||||
|
License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
"""
|
||||||
import copy
|
import copy
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
@@ -35,13 +39,6 @@ from ebook_converter.ptempfile import PersistentTemporaryFile
|
|||||||
from ebook_converter.polyglot.builtins import getcwd, itervalues, string_or_bytes, unicode_type
|
from ebook_converter.polyglot.builtins import getcwd, itervalues, string_or_bytes, unicode_type
|
||||||
from ebook_converter.polyglot.urllib import unquote, urlparse
|
from ebook_converter.polyglot.urllib import unquote, urlparse
|
||||||
|
|
||||||
"""
|
|
||||||
Code to convert HTML ebooks into LRF ebooks.
|
|
||||||
|
|
||||||
I am indebted to esperanc for the initial CSS->Xylog Style conversion code
|
|
||||||
and to Falstaff for pylrs.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
import math, sys, re, numbers
|
import math, sys, re, numbers
|
||||||
|
|
||||||
from ebook_converter.ebooks.lrf.fonts import get_font
|
from ebook_converter.ebooks.lrf.fonts import get_font
|
||||||
@@ -11,6 +7,10 @@ from ebook_converter.ebooks.lrf.pylrs.pylrs import TextBlock, Text, CR, Span, \
|
|||||||
from ebook_converter.polyglot.builtins import string_or_bytes, range, native_string_type
|
from ebook_converter.polyglot.builtins import string_or_bytes, range, native_string_type
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
|
|
||||||
def ceil(num):
|
def ceil(num):
|
||||||
return int(math.ceil(num))
|
return int(math.ceil(num))
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user