1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-02-01 19:45:45 +01:00

Don't cross import symbols from __init__

This commit is contained in:
2020-09-30 19:06:42 +02:00
parent ee232b76d6
commit 97ddcd7be1
5 changed files with 12 additions and 25 deletions

View File

@@ -8,17 +8,9 @@ import re
from functools import partial
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
if False:
# Prevent pyflakes from complaining
__appname__, __version__, __author__, config_dir
def init_mimetypes():
mimetypes.init([pkg_resources.resource_filename('ebook_converter',
'data/mime.types')])

View File

@@ -20,9 +20,9 @@ import math
import bs4
from ebook_converter import __appname__, entity_to_unicode, fit_image, \
from ebook_converter import entity_to_unicode, fit_image, \
force_unicode
from ebook_converter.constants_old import filesystem_encoding, \
from ebook_converter.constants_old import __appname__, filesystem_encoding, \
preferred_encoding
from ebook_converter.devices.interface import DevicePlugin as Device
from ebook_converter.ebooks import ConversionError

View File

@@ -49,7 +49,7 @@ from ebook_converter.utils.date import isoformat
DEFAULT_SOURCE_ENCODING = "cp1252" # default is us-windows character set
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

View File

@@ -8,8 +8,8 @@ import urllib.parse
from lxml import etree
from lxml.builder import ElementMaker
from ebook_converter import __version__
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.polish.errors import MalformedMarkup
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))
etree.SubElement(head, base.tag('ncx', 'meta'),
name='dtb:depth', content=str(toc.depth))
generator = ''.join(['calibre (', __version__, ')'])
generator = ''.join(['calibre (', constants_old.__version__, ')'])
etree.SubElement(head, base.tag('ncx', 'meta'),
name='dtb:generator', content=generator)
etree.SubElement(head, base.tag('ncx', 'meta'), name='dtb:totalPageCount',

View File

@@ -1,14 +1,10 @@
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
from ebook_converter import constants_old
import sys, os
from ebook_converter import config_dir
user_dir = os.path.join(config_dir, 'resources')
user_dir = os.path.join(constants_old.config_dir, 'resources')
class PathResolver(object):
@@ -22,9 +18,8 @@ class PathResolver(object):
try:
return os.path.exists(path) and os.path.isdir(path) and \
os.listdir(path)
except:
pass
return False
except Exception:
return False
self.default_path = sys.resources_location