1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-28 17:54:06 +02:00

Renamed constants, to make room for real constants module

This commit is contained in:
2020-05-26 19:52:18 +02:00
parent 399456d9ad
commit 2c78d6e3a6
55 changed files with 59 additions and 58 deletions
+1 -1
View File
@@ -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])
+1 -1
View File
@@ -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)
@@ -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'
@@ -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
@@ -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)
@@ -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)
@@ -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
@@ -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'
+1 -1
View File
@@ -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'''
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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'
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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