mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-02-23 18:45:55 +01:00
Don't cross import symbols from __init__
This commit is contained in:
@@ -8,17 +8,9 @@ import re
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from ebook_converter import constants_old
|
from ebook_converter import constants_old
|
||||||
from ebook_converter.constants_old import \
|
|
||||||
__appname__, __version__, __author__, \
|
|
||||||
config_dir
|
|
||||||
from ebook_converter.ebooks.html_entities import html5_entities
|
from ebook_converter.ebooks.html_entities import html5_entities
|
||||||
|
|
||||||
|
|
||||||
if False:
|
|
||||||
# Prevent pyflakes from complaining
|
|
||||||
__appname__, __version__, __author__, config_dir
|
|
||||||
|
|
||||||
|
|
||||||
def init_mimetypes():
|
def init_mimetypes():
|
||||||
mimetypes.init([pkg_resources.resource_filename('ebook_converter',
|
mimetypes.init([pkg_resources.resource_filename('ebook_converter',
|
||||||
'data/mime.types')])
|
'data/mime.types')])
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import math
|
|||||||
|
|
||||||
import bs4
|
import bs4
|
||||||
|
|
||||||
from ebook_converter import __appname__, entity_to_unicode, fit_image, \
|
from ebook_converter import entity_to_unicode, fit_image, \
|
||||||
force_unicode
|
force_unicode
|
||||||
from ebook_converter.constants_old import filesystem_encoding, \
|
from ebook_converter.constants_old import __appname__, filesystem_encoding, \
|
||||||
preferred_encoding
|
preferred_encoding
|
||||||
from ebook_converter.devices.interface import DevicePlugin as Device
|
from ebook_converter.devices.interface import DevicePlugin as Device
|
||||||
from ebook_converter.ebooks import ConversionError
|
from ebook_converter.ebooks import ConversionError
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ from ebook_converter.utils.date import isoformat
|
|||||||
DEFAULT_SOURCE_ENCODING = "cp1252" # default is us-windows character set
|
DEFAULT_SOURCE_ENCODING = "cp1252" # default is us-windows character set
|
||||||
DEFAULT_GENREADING = "fs" # default is yes to both lrf and lrs
|
DEFAULT_GENREADING = "fs" # default is yes to both lrf and lrs
|
||||||
|
|
||||||
from ebook_converter import __appname__, __version__
|
from ebook_converter.constants_old import __appname__, __version__
|
||||||
from ebook_converter import entity_to_unicode
|
from ebook_converter import entity_to_unicode
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import urllib.parse
|
|||||||
from lxml import etree
|
from lxml import etree
|
||||||
from lxml.builder import ElementMaker
|
from lxml.builder import ElementMaker
|
||||||
|
|
||||||
from ebook_converter import __version__
|
|
||||||
from ebook_converter import constants as const
|
from ebook_converter import constants as const
|
||||||
|
from ebook_converter import constants_old
|
||||||
from ebook_converter.ebooks.oeb import base
|
from ebook_converter.ebooks.oeb import base
|
||||||
from ebook_converter.ebooks.oeb.polish.errors import MalformedMarkup
|
from ebook_converter.ebooks.oeb.polish.errors import MalformedMarkup
|
||||||
from ebook_converter.ebooks.oeb.polish.utils import guess_type, extract
|
from ebook_converter.ebooks.oeb.polish.utils import guess_type, extract
|
||||||
@@ -608,7 +608,7 @@ def create_ncx(toc, to_href, btitle, lang, uid):
|
|||||||
name='dtb:uid', content=str(uid))
|
name='dtb:uid', content=str(uid))
|
||||||
etree.SubElement(head, base.tag('ncx', 'meta'),
|
etree.SubElement(head, base.tag('ncx', 'meta'),
|
||||||
name='dtb:depth', content=str(toc.depth))
|
name='dtb:depth', content=str(toc.depth))
|
||||||
generator = ''.join(['calibre (', __version__, ')'])
|
generator = ''.join(['calibre (', constants_old.__version__, ')'])
|
||||||
etree.SubElement(head, base.tag('ncx', 'meta'),
|
etree.SubElement(head, base.tag('ncx', 'meta'),
|
||||||
name='dtb:generator', content=generator)
|
name='dtb:generator', content=generator)
|
||||||
etree.SubElement(head, base.tag('ncx', 'meta'), name='dtb:totalPageCount',
|
etree.SubElement(head, base.tag('ncx', 'meta'), name='dtb:totalPageCount',
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
__license__ = 'GPL v3'
|
import os
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
import sys
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
from ebook_converter import constants_old
|
||||||
|
|
||||||
|
|
||||||
import sys, os
|
user_dir = os.path.join(constants_old.config_dir, 'resources')
|
||||||
|
|
||||||
from ebook_converter import config_dir
|
|
||||||
|
|
||||||
|
|
||||||
user_dir = os.path.join(config_dir, 'resources')
|
|
||||||
|
|
||||||
|
|
||||||
class PathResolver(object):
|
class PathResolver(object):
|
||||||
@@ -22,9 +18,8 @@ class PathResolver(object):
|
|||||||
try:
|
try:
|
||||||
return os.path.exists(path) and os.path.isdir(path) and \
|
return os.path.exists(path) and os.path.isdir(path) and \
|
||||||
os.listdir(path)
|
os.listdir(path)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
return False
|
||||||
return False
|
|
||||||
|
|
||||||
self.default_path = sys.resources_location
|
self.default_path = sys.resources_location
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user