diff --git a/ebook_converter/__init__.py b/ebook_converter/__init__.py index 0c04224..9564a1b 100644 --- a/ebook_converter/__init__.py +++ b/ebook_converter/__init__.py @@ -15,7 +15,7 @@ try: except EnvironmentError: os.chdir(os.path.expanduser('~')) -from ebook_converter.constants import (iswindows, isosx, islinux, isfrozen, +from ebook_converter.constants_old import (iswindows, isosx, islinux, isfrozen, isbsd, preferred_encoding, __appname__, __version__, __author__, win32event, win32api, winerror, fcntl, filesystem_encoding, plugins, config_dir) diff --git a/ebook_converter/constants.py b/ebook_converter/constants_old.py similarity index 100% rename from ebook_converter/constants.py rename to ebook_converter/constants_old.py diff --git a/ebook_converter/customize/__init__.py b/ebook_converter/customize/__init__.py index 3c9d9c2..8967a0f 100644 --- a/ebook_converter/customize/__init__.py +++ b/ebook_converter/customize/__init__.py @@ -2,7 +2,7 @@ import importlib import sys import zipfile -from ebook_converter.constants import numeric_version, iswindows, isosx +from ebook_converter.constants_old import numeric_version, iswindows, isosx from ebook_converter.ptempfile import PersistentTemporaryFile diff --git a/ebook_converter/customize/builtins.py b/ebook_converter/customize/builtins.py index 55c980a..df820c9 100644 --- a/ebook_converter/customize/builtins.py +++ b/ebook_converter/customize/builtins.py @@ -3,7 +3,7 @@ import os, glob, re from ebook_converter import guess_type from ebook_converter.customize import (FileTypePlugin, MetadataReaderPlugin, MetadataWriterPlugin, PreferencesPlugin, InterfaceActionBase, StoreBase) -from ebook_converter.constants import numeric_version +from ebook_converter.constants_old import numeric_version from ebook_converter.ebooks.metadata.archive import ArchiveExtract, KPFExtract, get_comic_metadata from ebook_converter.ebooks.html.to_zip import HTML2ZIP diff --git a/ebook_converter/devices/interface.py b/ebook_converter/devices/interface.py index 40c46bc..0c0727c 100644 --- a/ebook_converter/devices/interface.py +++ b/ebook_converter/devices/interface.py @@ -2,7 +2,7 @@ import os from collections import namedtuple from ebook_converter import prints -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.customize import Plugin diff --git a/ebook_converter/ebooks/chardet.py b/ebook_converter/ebooks/chardet.py index 5428e45..ca686b7 100644 --- a/ebook_converter/ebooks/chardet.py +++ b/ebook_converter/ebooks/chardet.py @@ -108,7 +108,7 @@ def detect(*args, **kwargs): def force_encoding(raw, verbose, assume_utf8=False): - from ebook_converter.constants import preferred_encoding + from ebook_converter.constants_old import preferred_encoding try: chardet = detect(raw[:1024*50]) diff --git a/ebook_converter/ebooks/conversion/cli.py b/ebook_converter/ebooks/conversion/cli.py index b71c9e9..7bb39d0 100644 --- a/ebook_converter/ebooks/conversion/cli.py +++ b/ebook_converter/ebooks/conversion/cli.py @@ -282,7 +282,7 @@ class ProgressBar(object): def create_option_parser(args, log): if '--version' in args: - from ebook_converter.constants import __appname__, __version__, __author__ + from ebook_converter.constants_old import __appname__, __version__, __author__ log(os.path.basename(args[0]), '('+__appname__, __version__+')') log('Created by:', __author__) raise SystemExit(0) diff --git a/ebook_converter/ebooks/conversion/plugins/chm_input.py b/ebook_converter/ebooks/conversion/plugins/chm_input.py index a4bb43d..2ee6e92 100644 --- a/ebook_converter/ebooks/conversion/plugins/chm_input.py +++ b/ebook_converter/ebooks/conversion/plugins/chm_input.py @@ -10,7 +10,7 @@ from ebook_converter.ebooks.oeb.base import urlquote from ebook_converter.ebooks.chardet import xml_to_unicode from ebook_converter.customize.conversion import InputFormatPlugin from ebook_converter.ptempfile import TemporaryDirectory -from ebook_converter.constants import filesystem_encoding +from ebook_converter.constants_old import filesystem_encoding from ebook_converter.polyglot.builtins import as_bytes __license__ = 'GPL v3' diff --git a/ebook_converter/ebooks/conversion/plugins/html_input.py b/ebook_converter/ebooks/conversion/plugins/html_input.py index 484c9c9..7428231 100644 --- a/ebook_converter/ebooks/conversion/plugins/html_input.py +++ b/ebook_converter/ebooks/conversion/plugins/html_input.py @@ -4,7 +4,7 @@ import re import tempfile import urllib.parse -from ebook_converter.constants import islinux, isbsd +from ebook_converter.constants_old import islinux, isbsd from ebook_converter.customize.conversion import (InputFormatPlugin, OptionRecommendation) from ebook_converter.utils.localization import get_lang diff --git a/ebook_converter/ebooks/conversion/plugins/lrf_output.py b/ebook_converter/ebooks/conversion/plugins/lrf_output.py index 727ac10..5653095 100644 --- a/ebook_converter/ebooks/conversion/plugins/lrf_output.py +++ b/ebook_converter/ebooks/conversion/plugins/lrf_output.py @@ -139,7 +139,7 @@ class LRFOutput(OutputFormatPlugin): def convert_images(self, pages, opts, wide): from ebook_converter.ebooks.lrf.pylrs.pylrs import Book, BookSetting, ImageStream, ImageBlock from uuid import uuid4 - from ebook_converter.constants import __appname__, __version__ + from ebook_converter.constants_old import __appname__, __version__ width, height = (784, 1012) if wide else (584, 754) diff --git a/ebook_converter/ebooks/conversion/plugins/pdf_output.py b/ebook_converter/ebooks/conversion/plugins/pdf_output.py index c2325e5..50d6d39 100644 --- a/ebook_converter/ebooks/conversion/plugins/pdf_output.py +++ b/ebook_converter/ebooks/conversion/plugins/pdf_output.py @@ -144,7 +144,7 @@ class PDFOutput(OutputFormatPlugin): from PyQt5.QtWebEngineCore import QWebEngineUrlScheme from PyQt5.QtWebEngineWidgets import QWebEnginePage # noqa from ebook_converter.gui2 import must_use_qt - from ebook_converter.constants import FAKE_PROTOCOL + from ebook_converter.constants_old import FAKE_PROTOCOL scheme = QWebEngineUrlScheme(FAKE_PROTOCOL.encode('ascii')) scheme.setSyntax(QWebEngineUrlScheme.Syntax.Host) scheme.setFlags(QWebEngineUrlScheme.SecureScheme) diff --git a/ebook_converter/ebooks/conversion/plugins/recipe_input.py b/ebook_converter/ebooks/conversion/plugins/recipe_input.py index 519477f..6cf5f0d 100644 --- a/ebook_converter/ebooks/conversion/plugins/recipe_input.py +++ b/ebook_converter/ebooks/conversion/plugins/recipe_input.py @@ -1,7 +1,7 @@ import os from ebook_converter.customize.conversion import InputFormatPlugin, OptionRecommendation -from ebook_converter.constants import numeric_version +from ebook_converter.constants_old import numeric_version from ebook_converter import walk diff --git a/ebook_converter/ebooks/conversion/plugins/snb_output.py b/ebook_converter/ebooks/conversion/plugins/snb_output.py index 0a4a1ff..af3dcff 100644 --- a/ebook_converter/ebooks/conversion/plugins/snb_output.py +++ b/ebook_converter/ebooks/conversion/plugins/snb_output.py @@ -2,7 +2,7 @@ import os from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation from ebook_converter.ptempfile import TemporaryDirectory -from ebook_converter.constants import __appname__, __version__ +from ebook_converter.constants_old import __appname__, __version__ __license__ = 'GPL 3' diff --git a/ebook_converter/ebooks/conversion/plumber.py b/ebook_converter/ebooks/conversion/plumber.py index 3eadb8b..2d9323c 100644 --- a/ebook_converter/ebooks/conversion/plumber.py +++ b/ebook_converter/ebooks/conversion/plumber.py @@ -16,7 +16,7 @@ from ebook_converter.utils.date import parse_date from ebook_converter.utils.zipfile import ZipFile from ebook_converter import (extract, walk, isbytestring, filesystem_encoding, get_types_map) -from ebook_converter.constants import __version__ +from ebook_converter.constants_old import __version__ DEBUG_README=b''' diff --git a/ebook_converter/ebooks/covers.py b/ebook_converter/ebooks/covers.py index bdafe2a..e5011d8 100644 --- a/ebook_converter/ebooks/covers.py +++ b/ebook_converter/ebooks/covers.py @@ -11,7 +11,7 @@ from PyQt5.Qt import ( ) from ebook_converter import force_unicode, fit_image -from ebook_converter.constants import __appname__, __version__ +from ebook_converter.constants_old import __appname__, __version__ from ebook_converter.ebooks.metadata import fmt_sidx from ebook_converter.ebooks.metadata.book.base import Metadata from ebook_converter.ebooks.metadata.book.formatter import SafeFormat diff --git a/ebook_converter/ebooks/docx/images.py b/ebook_converter/ebooks/docx/images.py index 4432062..ead223a 100644 --- a/ebook_converter/ebooks/docx/images.py +++ b/ebook_converter/ebooks/docx/images.py @@ -2,7 +2,7 @@ import os from lxml.html.builder import IMG, HR -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.ebooks.docx.names import barename from ebook_converter.utils.filenames import ascii_filename from ebook_converter.utils.img import resize_to_fit, image_to_data diff --git a/ebook_converter/ebooks/docx/writer/container.py b/ebook_converter/ebooks/docx/writer/container.py index 46d6e0c..015af68 100644 --- a/ebook_converter/ebooks/docx/writer/container.py +++ b/ebook_converter/ebooks/docx/writer/container.py @@ -4,7 +4,7 @@ from lxml import etree from lxml.builder import ElementMaker from ebook_converter import guess_type -from ebook_converter.constants import numeric_version, __appname__ +from ebook_converter.constants_old import numeric_version, __appname__ from ebook_converter.ebooks.docx.names import DOCXNamespace from ebook_converter.ebooks.metadata import authors_to_string from ebook_converter.ebooks.pdf.render.common import PAPER_SIZES diff --git a/ebook_converter/ebooks/fb2/fb2ml.py b/ebook_converter/ebooks/fb2/fb2ml.py index f8b718c..9db7965 100644 --- a/ebook_converter/ebooks/fb2/fb2ml.py +++ b/ebook_converter/ebooks/fb2/fb2ml.py @@ -10,7 +10,7 @@ import uuid from lxml import etree from ebook_converter import prepare_string_for_xml -from ebook_converter.constants import __appname__, __version__ +from ebook_converter.constants_old import __appname__, __version__ from ebook_converter.utils.localization import lang_as_iso639_1 from ebook_converter.utils.xml_parse import safe_xml_fromstring from ebook_converter.utils.img import save_cover_data_to diff --git a/ebook_converter/ebooks/html/input.py b/ebook_converter/ebooks/html/input.py index 6c35af0..3a61e1d 100644 --- a/ebook_converter/ebooks/html/input.py +++ b/ebook_converter/ebooks/html/input.py @@ -9,7 +9,7 @@ import urllib.parse from ebook_converter.ebooks.oeb.base import urlunquote from ebook_converter.ebooks.chardet import detect_xml_encoding -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter import unicode_path, as_unicode, replace_entities diff --git a/ebook_converter/ebooks/html/to_zip.py b/ebook_converter/ebooks/html/to_zip.py index f6f4034..9cdb276 100644 --- a/ebook_converter/ebooks/html/to_zip.py +++ b/ebook_converter/ebooks/html/to_zip.py @@ -1,7 +1,7 @@ import textwrap, os, glob from ebook_converter.customize import FileTypePlugin -from ebook_converter.constants import numeric_version +from ebook_converter.constants_old import numeric_version __license__ = 'GPL v3' diff --git a/ebook_converter/ebooks/lrf/html/convert_from.py b/ebook_converter/ebooks/lrf/html/convert_from.py index 0b38059..7b35760 100644 --- a/ebook_converter/ebooks/lrf/html/convert_from.py +++ b/ebook_converter/ebooks/lrf/html/convert_from.py @@ -23,7 +23,7 @@ import bs4 from ebook_converter import ( __appname__, entity_to_unicode, fit_image, force_unicode, preferred_encoding ) -from ebook_converter.constants import filesystem_encoding +from ebook_converter.constants_old import filesystem_encoding from ebook_converter.devices.interface import DevicePlugin as Device from ebook_converter.ebooks import ConversionError from ebook_converter.ebooks.BeautifulSoup import html5_parser diff --git a/ebook_converter/ebooks/lrf/meta.py b/ebook_converter/ebooks/lrf/meta.py index 248e3b7..27501d4 100644 --- a/ebook_converter/ebooks/lrf/meta.py +++ b/ebook_converter/ebooks/lrf/meta.py @@ -622,7 +622,7 @@ class LRFMetaFile(object): def option_parser(): from ebook_converter.utils.config import OptionParser - from ebook_converter.constants import __appname__, __version__ + from ebook_converter.constants_old import __appname__, __version__ parser = OptionParser(usage=('''%prog [options] mybook.lrf diff --git a/ebook_converter/ebooks/metadata/book/base.py b/ebook_converter/ebooks/metadata/book/base.py index 116c05d..ecce2b9 100644 --- a/ebook_converter/ebooks/metadata/book/base.py +++ b/ebook_converter/ebooks/metadata/book/base.py @@ -1,7 +1,7 @@ import copy, traceback from ebook_converter import prints -from ebook_converter.constants import DEBUG +from ebook_converter.constants_old import DEBUG from ebook_converter.ebooks.metadata.book import (SC_COPYABLE_FIELDS, SC_FIELDS_COPY_NOT_NULL, STANDARD_METADATA_FIELDS, TOP_LEVEL_IDENTIFIERS, ALL_METADATA_FIELDS) diff --git a/ebook_converter/ebooks/metadata/book/json_codec.py b/ebook_converter/ebooks/metadata/book/json_codec.py index c9d243c..6dcdb62 100644 --- a/ebook_converter/ebooks/metadata/book/json_codec.py +++ b/ebook_converter/ebooks/metadata/book/json_codec.py @@ -7,7 +7,7 @@ import json, traceback from datetime import datetime, time from ebook_converter.ebooks.metadata.book import SERIALIZABLE_FIELDS -from ebook_converter.constants import filesystem_encoding, preferred_encoding +from ebook_converter.constants_old import filesystem_encoding, preferred_encoding from ebook_converter.library.field_metadata import FieldMetadata from ebook_converter import isbytestring from ebook_converter.polyglot.builtins import as_bytes diff --git a/ebook_converter/ebooks/metadata/meta.py b/ebook_converter/ebooks/metadata/meta.py index b26d7b9..131e14e 100644 --- a/ebook_converter/ebooks/metadata/meta.py +++ b/ebook_converter/ebooks/metadata/meta.py @@ -1,7 +1,7 @@ import os, re, collections from ebook_converter.utils.config import prefs -from ebook_converter.constants import filesystem_encoding +from ebook_converter.constants_old import filesystem_encoding from ebook_converter.ebooks.metadata.opf2 import OPF from ebook_converter import isbytestring from ebook_converter.customize.ui import get_file_type_metadata, set_file_type_metadata diff --git a/ebook_converter/ebooks/metadata/opf2.py b/ebook_converter/ebooks/metadata/opf2.py index 4e0fb51..586164b 100644 --- a/ebook_converter/ebooks/metadata/opf2.py +++ b/ebook_converter/ebooks/metadata/opf2.py @@ -16,7 +16,8 @@ import uuid from lxml import etree from ebook_converter.ebooks import escape_xpath_attr -from ebook_converter.constants import __appname__, __version__, filesystem_encoding +from ebook_converter.constants_old import __appname__, __version__, \ + filesystem_encoding from ebook_converter.ebooks.metadata.toc import TOC from ebook_converter.ebooks.metadata.utils import parse_opf, pretty_print_opf as _pretty_print from ebook_converter.ebooks.metadata import string_to_authors, MetaInformation, check_isbn diff --git a/ebook_converter/ebooks/metadata/pdf.py b/ebook_converter/ebooks/metadata/pdf.py index a6c1ae9..f8a09d1 100644 --- a/ebook_converter/ebooks/metadata/pdf.py +++ b/ebook_converter/ebooks/metadata/pdf.py @@ -5,7 +5,7 @@ import os, subprocess, shutil, re from functools import partial from ebook_converter import prints -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.ptempfile import TemporaryDirectory from ebook_converter.ebooks.metadata import ( MetaInformation, string_to_authors, check_isbn, check_doi) diff --git a/ebook_converter/ebooks/metadata/toc.py b/ebook_converter/ebooks/metadata/toc.py index 72a3c04..a9330a4 100644 --- a/ebook_converter/ebooks/metadata/toc.py +++ b/ebook_converter/ebooks/metadata/toc.py @@ -8,7 +8,7 @@ import urllib.parse from lxml import etree from lxml.builder import ElementMaker -from ebook_converter.constants import __appname__, __version__ +from ebook_converter.constants_old import __appname__, __version__ from ebook_converter.ebooks.chardet import xml_to_unicode from ebook_converter.utils.xml_parse import safe_xml_fromstring from ebook_converter.utils.cleantext import clean_xml_chars diff --git a/ebook_converter/ebooks/mobi/writer8/exth.py b/ebook_converter/ebooks/mobi/writer8/exth.py index ef91fa1..435aa23 100644 --- a/ebook_converter/ebooks/mobi/writer8/exth.py +++ b/ebook_converter/ebooks/mobi/writer8/exth.py @@ -2,7 +2,7 @@ import re from struct import pack from io import BytesIO -from ebook_converter.constants import iswindows, isosx +from ebook_converter.constants_old import iswindows, isosx from ebook_converter.ebooks.mobi.utils import (utf8_text, to_base) from ebook_converter.utils.localization import lang_as_iso639_1 from ebook_converter.ebooks.metadata import authors_to_sort_string diff --git a/ebook_converter/ebooks/oeb/base.py b/ebook_converter/ebooks/oeb/base.py index f7a5193..2862fd9 100644 --- a/ebook_converter/ebooks/oeb/base.py +++ b/ebook_converter/ebooks/oeb/base.py @@ -10,7 +10,7 @@ import string from lxml import etree, html from ebook_converter import force_unicode -from ebook_converter.constants import filesystem_encoding, __version__ +from ebook_converter.constants_old import filesystem_encoding, __version__ from ebook_converter.utils.xml_parse import safe_xml_fromstring from ebook_converter.ebooks.chardet import xml_to_unicode from ebook_converter.ebooks.conversion.preprocess import CSSPreProcessor diff --git a/ebook_converter/ebooks/oeb/parse_utils.py b/ebook_converter/ebooks/oeb/parse_utils.py index 39c60ea..64be9f2 100644 --- a/ebook_converter/ebooks/oeb/parse_utils.py +++ b/ebook_converter/ebooks/oeb/parse_utils.py @@ -4,7 +4,7 @@ from lxml import etree, html from ebook_converter import xml_replace_entities, force_unicode from ebook_converter.utils.xml_parse import safe_xml_fromstring -from ebook_converter.constants import filesystem_encoding +from ebook_converter.constants_old import filesystem_encoding from ebook_converter.ebooks.chardet import xml_to_unicode, strip_encoding_declarations diff --git a/ebook_converter/ebooks/oeb/polish/container.py b/ebook_converter/ebooks/oeb/polish/container.py index c479649..e3b9530 100644 --- a/ebook_converter/ebooks/oeb/polish/container.py +++ b/ebook_converter/ebooks/oeb/polish/container.py @@ -16,7 +16,7 @@ import urllib.parse from css_parser import getUrls, replaceUrls from ebook_converter import CurrentDir, walk -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.customize.ui import plugin_for_input_format, plugin_for_output_format from ebook_converter.ebooks import escape_xpath_attr from ebook_converter.ebooks.chardet import xml_to_unicode diff --git a/ebook_converter/ebooks/oeb/reader.py b/ebook_converter/ebooks/oeb/reader.py index 1cf22c8..4139b1b 100644 --- a/ebook_converter/ebooks/oeb/reader.py +++ b/ebook_converter/ebooks/oeb/reader.py @@ -21,7 +21,7 @@ from ebook_converter.utils.xml_parse import safe_xml_fromstring from ebook_converter.utils.cleantext import clean_xml_chars from ebook_converter.utils.localization import get_lang from ebook_converter.ptempfile import TemporaryDirectory -from ebook_converter.constants import __appname__, __version__ +from ebook_converter.constants_old import __appname__, __version__ from ebook_converter import guess_type, xml_replace_entities from ebook_converter.polyglot.urllib import unquote diff --git a/ebook_converter/ebooks/oeb/transforms/jacket.py b/ebook_converter/ebooks/oeb/transforms/jacket.py index cb1ee01..0d1a88b 100644 --- a/ebook_converter/ebooks/oeb/transforms/jacket.py +++ b/ebook_converter/ebooks/oeb/transforms/jacket.py @@ -5,7 +5,7 @@ import pkg_resources import urllib.parse from ebook_converter import guess_type, strftime -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.ebooks.oeb.base import XPath, XHTML_NS, XHTML, xml2text, urlnormalize from ebook_converter.library.comments import comments_to_html, markdown from ebook_converter.utils.date import is_date_undefined, as_local_time diff --git a/ebook_converter/ebooks/pdf/pdftohtml.py b/ebook_converter/ebooks/pdf/pdftohtml.py index 2a317f9..d10cd82 100644 --- a/ebook_converter/ebooks/pdf/pdftohtml.py +++ b/ebook_converter/ebooks/pdf/pdftohtml.py @@ -6,7 +6,7 @@ import subprocess import sys from ebook_converter import CurrentDir, xml_replace_entities, prints -from ebook_converter.constants import ( +from ebook_converter.constants_old import ( filesystem_encoding, isbsd, islinux, isosx, iswindows ) from ebook_converter.ebooks import ConversionError, DRMError diff --git a/ebook_converter/library/__init__.py b/ebook_converter/library/__init__.py index 729a4b8..ff4c1d5 100644 --- a/ebook_converter/library/__init__.py +++ b/ebook_converter/library/__init__.py @@ -26,7 +26,7 @@ def generate_test_db(library_path, # {{{ max_tags=10 ): import random, string, os, sys, time - from ebook_converter.constants import preferred_encoding + from ebook_converter.constants_old import preferred_encoding if not os.path.exists(library_path): os.makedirs(library_path) diff --git a/ebook_converter/library/comments.py b/ebook_converter/library/comments.py index 8aefe84..05a8a64 100644 --- a/ebook_converter/library/comments.py +++ b/ebook_converter/library/comments.py @@ -3,7 +3,7 @@ import re import bs4 from ebook_converter import prepare_string_for_xml -from ebook_converter.constants import preferred_encoding +from ebook_converter.constants_old import preferred_encoding from ebook_converter.ebooks.BeautifulSoup import html5_parser from ebook_converter.utils.html2text import html2text diff --git a/ebook_converter/ptempfile.py b/ebook_converter/ptempfile.py index 5dca4f7..97d645e 100644 --- a/ebook_converter/ptempfile.py +++ b/ebook_converter/ptempfile.py @@ -6,7 +6,7 @@ being closed. """ import tempfile, os, atexit -from ebook_converter.constants import (__version__, __appname__, filesystem_encoding, +from ebook_converter.constants_old import (__version__, __appname__, filesystem_encoding, iswindows, get_windows_temp_path, isosx) diff --git a/ebook_converter/utils/cleantext.py b/ebook_converter/utils/cleantext.py index c2079b7..37f045d 100644 --- a/ebook_converter/utils/cleantext.py +++ b/ebook_converter/utils/cleantext.py @@ -1,7 +1,7 @@ import re import html.entities -from ebook_converter.constants import plugins, preferred_encoding +from ebook_converter.constants_old import plugins, preferred_encoding def ascii_pat(for_binary=False): diff --git a/ebook_converter/utils/config.py b/ebook_converter/utils/config.py index bc89d19..02b1860 100644 --- a/ebook_converter/utils/config.py +++ b/ebook_converter/utils/config.py @@ -5,7 +5,7 @@ import optparse import os from copy import deepcopy -from ebook_converter.constants import ( +from ebook_converter.constants_old import ( CONFIG_DIR_MODE, __appname__, __author__, config_dir, get_version, iswindows ) from ebook_converter.utils.config_base import ( diff --git a/ebook_converter/utils/config_base.py b/ebook_converter/utils/config_base.py index d17ae70..e452974 100644 --- a/ebook_converter/utils/config_base.py +++ b/ebook_converter/utils/config_base.py @@ -9,7 +9,7 @@ from copy import deepcopy import pkg_resources from ebook_converter.utils.lock import ExclusiveFile -from ebook_converter.constants import config_dir, CONFIG_DIR_MODE, preferred_encoding, filesystem_encoding, iswindows +from ebook_converter.constants_old import config_dir, CONFIG_DIR_MODE, preferred_encoding, filesystem_encoding, iswindows plugin_dir = os.path.join(config_dir, 'plugins') diff --git a/ebook_converter/utils/date.py b/ebook_converter/utils/date.py index 34ee7c0..db53b0d 100644 --- a/ebook_converter/utils/date.py +++ b/ebook_converter/utils/date.py @@ -3,7 +3,7 @@ from datetime import datetime, time as dtime, timedelta, MINYEAR, MAXYEAR from functools import partial from ebook_converter import strftime -from ebook_converter.constants import iswindows, isosx, plugins, preferred_encoding +from ebook_converter.constants_old import iswindows, isosx, plugins, preferred_encoding from ebook_converter.utils.iso8601 import utc_tz, local_tz, UNDEFINED_DATE from ebook_converter.utils.localization import lcdata diff --git a/ebook_converter/utils/filenames.py b/ebook_converter/utils/filenames.py index 8172e77..c37d439 100644 --- a/ebook_converter/utils/filenames.py +++ b/ebook_converter/utils/filenames.py @@ -9,7 +9,7 @@ import time from math import ceil from ebook_converter import force_unicode, isbytestring, prints, sanitize_file_name -from ebook_converter.constants import ( +from ebook_converter.constants_old import ( filesystem_encoding, iswindows, plugins, preferred_encoding, isosx ) from ebook_converter.utils.localization import get_udc diff --git a/ebook_converter/utils/fonts/scanner.py b/ebook_converter/utils/fonts/scanner.py index 1e07936..4883acc 100644 --- a/ebook_converter/utils/fonts/scanner.py +++ b/ebook_converter/utils/fonts/scanner.py @@ -3,7 +3,7 @@ from collections import defaultdict from threading import Thread from ebook_converter import walk, prints, as_unicode -from ebook_converter.constants import (config_dir, iswindows, isosx, plugins, DEBUG, +from ebook_converter.constants_old import (config_dir, iswindows, isosx, plugins, DEBUG, isworker, filesystem_encoding) from ebook_converter.utils.fonts.metadata import FontMetadata, UnsupportedFont diff --git a/ebook_converter/utils/formatter.py b/ebook_converter/utils/formatter.py index ba13917..1307399 100644 --- a/ebook_converter/utils/formatter.py +++ b/ebook_converter/utils/formatter.py @@ -6,7 +6,7 @@ Created on 23 Sep 2010 import re, string, traceback, numbers from ebook_converter import prints -from ebook_converter.constants import DEBUG +from ebook_converter.constants_old import DEBUG from ebook_converter.utils.formatter_functions import formatter_functions from ebook_converter.polyglot.builtins import error_message diff --git a/ebook_converter/utils/formatter_functions.py b/ebook_converter/utils/formatter_functions.py index 5cbf1ed..3078532 100644 --- a/ebook_converter/utils/formatter_functions.py +++ b/ebook_converter/utils/formatter_functions.py @@ -7,7 +7,7 @@ import inspect, re, traceback, numbers from math import trunc from ebook_converter import human_readable -from ebook_converter.constants import DEBUG +from ebook_converter.constants_old import DEBUG from ebook_converter.ebooks.metadata import title_sort from ebook_converter.utils.config import tweaks from ebook_converter.utils.titlecase import titlecase diff --git a/ebook_converter/utils/icu.py b/ebook_converter/utils/icu.py index 27f5643..fc2631e 100644 --- a/ebook_converter/utils/icu.py +++ b/ebook_converter/utils/icu.py @@ -3,7 +3,7 @@ import sys import unicodedata # Setup code {{{ -from ebook_converter.constants import plugins +from ebook_converter.constants_old import plugins from ebook_converter.polyglot.builtins import cmp from ebook_converter.utils.config_base import tweaks diff --git a/ebook_converter/utils/img.py b/ebook_converter/utils/img.py index b9466c4..b65d943 100644 --- a/ebook_converter/utils/img.py +++ b/ebook_converter/utils/img.py @@ -12,7 +12,7 @@ from threading import Thread #from PyQt5.QtGui import QColor, QImage, QImageReader, QImageWriter, QPixmap, QTransform from ebook_converter import fit_image, force_unicode -from ebook_converter.constants import iswindows, plugins +from ebook_converter.constants_old import iswindows, plugins from ebook_converter.ptempfile import TemporaryDirectory from ebook_converter.utils.config_base import tweaks from ebook_converter.utils.filenames import atomic_rename diff --git a/ebook_converter/utils/ipc/__init__.py b/ebook_converter/utils/ipc/__init__.py index a431a12..1bbb0fb 100644 --- a/ebook_converter/utils/ipc/__init__.py +++ b/ebook_converter/utils/ipc/__init__.py @@ -5,10 +5,10 @@ import sys import threading from ebook_converter import force_unicode -from ebook_converter.constants import filesystem_encoding -from ebook_converter.constants import get_windows_username -from ebook_converter.constants import islinux -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import filesystem_encoding +from ebook_converter.constants_old import get_windows_username +from ebook_converter.constants_old import islinux +from ebook_converter.constants_old import iswindows from ebook_converter.utils.filenames import ascii_filename diff --git a/ebook_converter/utils/ipc/launch.py b/ebook_converter/utils/ipc/launch.py index 1d05662..fae4234 100644 --- a/ebook_converter/utils/ipc/launch.py +++ b/ebook_converter/utils/ipc/launch.py @@ -1,7 +1,7 @@ import subprocess, os, sys, time from functools import partial -from ebook_converter.constants import isosx, isfrozen, filesystem_encoding +from ebook_converter.constants_old import isosx, isfrozen, filesystem_encoding from ebook_converter.utils.config import prefs from ebook_converter.ptempfile import PersistentTemporaryFile, base_dir from ebook_converter.utils.serialize import msgpack_dumps diff --git a/ebook_converter/utils/ipc/simple_worker.py b/ebook_converter/utils/ipc/simple_worker.py index 744055a..52a89fc 100644 --- a/ebook_converter/utils/ipc/simple_worker.py +++ b/ebook_converter/utils/ipc/simple_worker.py @@ -3,7 +3,7 @@ from multiprocessing.connection import Client from threading import Thread from contextlib import closing -from ebook_converter.constants import iswindows +from ebook_converter.constants_old import iswindows from ebook_converter.utils.ipc import eintr_retry_call from ebook_converter.utils.ipc.launch import Worker from ebook_converter.utils.serialize import msgpack_loads, msgpack_dumps diff --git a/ebook_converter/utils/iso8601.py b/ebook_converter/utils/iso8601.py index d0cb8a1..3286c5a 100644 --- a/ebook_converter/utils/iso8601.py +++ b/ebook_converter/utils/iso8601.py @@ -2,7 +2,7 @@ from datetime import datetime from dateutil.tz import tzlocal, tzutc, tzoffset -from ebook_converter.constants import plugins +from ebook_converter.constants_old import plugins # speedup, err = plugins['speedup'] # if not speedup: # raise RuntimeError(err) diff --git a/ebook_converter/utils/lock.py b/ebook_converter/utils/lock.py index 67d1c86..2d8a415 100644 --- a/ebook_converter/utils/lock.py +++ b/ebook_converter/utils/lock.py @@ -8,7 +8,7 @@ import tempfile import time from functools import partial -from ebook_converter.constants import ( +from ebook_converter.constants_old import ( __appname__, fcntl, filesystem_encoding, islinux, isosx, iswindows, plugins ) from ebook_converter.utils.monotonic import monotonic @@ -16,7 +16,7 @@ from ebook_converter.utils.monotonic import monotonic # speedup = plugins['speedup'][0] if iswindows: import msvcrt, win32file, pywintypes, winerror, win32api, win32event - from ebook_converter.constants import get_windows_username + from ebook_converter.constants_old import get_windows_username excl_file_mode = stat.S_IREAD | stat.S_IWRITE else: excl_file_mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH diff --git a/ebook_converter/utils/monotonic.py b/ebook_converter/utils/monotonic.py index d16d9e5..7db686c 100644 --- a/ebook_converter/utils/monotonic.py +++ b/ebook_converter/utils/monotonic.py @@ -1,7 +1,7 @@ try: from time import monotonic except ImportError: - from ebook_converter.constants import plugins + from ebook_converter.constants_old import plugins monotonicp, err = plugins['monotonic'] if err: diff --git a/ebook_converter/utils/shared_file.py b/ebook_converter/utils/shared_file.py index 995d6dd..67ccf6a 100644 --- a/ebook_converter/utils/shared_file.py +++ b/ebook_converter/utils/shared_file.py @@ -17,7 +17,7 @@ file before deleting it. import os, sys from ebook_converter.polyglot.builtins import reraise -from ebook_converter.constants import iswindows, plugins +from ebook_converter.constants_old import iswindows, plugins __license__ = 'GPL v3'