mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Remove global __()
This commit is contained in:
parent
a54227469b
commit
e5992f9d87
@ -15,7 +15,7 @@ from calibre.constants import isbsd, islinux
|
|||||||
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
|
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||||
from calibre.utils.filenames import ascii_filename
|
from calibre.utils.filenames import ascii_filename
|
||||||
from calibre.utils.imghdr import what
|
from calibre.utils.imghdr import what
|
||||||
from calibre.utils.localization import get_lang
|
from calibre.utils.localization import __, get_lang
|
||||||
from polyglot.builtins import as_unicode
|
from polyglot.builtins import as_unicode
|
||||||
|
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class HTMLInput(InputFormatPlugin):
|
|||||||
from calibre.ebooks.metadata import string_to_authors
|
from calibre.ebooks.metadata import string_to_authors
|
||||||
from calibre.ebooks.oeb.base import (
|
from calibre.ebooks.oeb.base import (
|
||||||
BINARY_MIME, OEB_STYLES, DirContainer, rewrite_links, urldefrag,
|
BINARY_MIME, OEB_STYLES, DirContainer, rewrite_links, urldefrag,
|
||||||
urlnormalize, urlquote, xpath
|
urlnormalize, urlquote, xpath,
|
||||||
)
|
)
|
||||||
from calibre.ebooks.oeb.transforms.metadata import meta_info_to_oeb_metadata
|
from calibre.ebooks.oeb.transforms.metadata import meta_info_to_oeb_metadata
|
||||||
from calibre.utils.localization import canonicalize_lang
|
from calibre.utils.localization import canonicalize_lang
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import posixpath, re
|
import posixpath
|
||||||
|
import re
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from calibre.ebooks.oeb.base import urlquote
|
from calibre.ebooks.oeb.base import urlquote
|
||||||
from calibre.utils.filenames import ascii_text
|
from calibre.utils.filenames import ascii_text
|
||||||
|
from calibre.utils.localization import __
|
||||||
from polyglot.urllib import urlparse
|
from polyglot.urllib import urlparse
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,9 +5,11 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
from calibre.ebooks.oeb.base import (
|
||||||
|
XHTML, XHTML_MIME, XHTML_NS, XPath, css_text, urlnormalize,
|
||||||
|
)
|
||||||
|
from calibre.utils.localization import __
|
||||||
from calibre.utils.xml_parse import safe_xml_fromstring
|
from calibre.utils.xml_parse import safe_xml_fromstring
|
||||||
from calibre.ebooks.oeb.base import (urlnormalize, XPath, XHTML_NS, XHTML,
|
|
||||||
XHTML_MIME, css_text)
|
|
||||||
|
|
||||||
DEFAULT_TITLE = __('Table of Contents')
|
DEFAULT_TITLE = __('Table of Contents')
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ from calibre.ebooks.oeb.parse_utils import (
|
|||||||
from calibre.translations.dynamic import translate
|
from calibre.translations.dynamic import translate
|
||||||
from calibre.utils.cleantext import clean_xml_chars
|
from calibre.utils.cleantext import clean_xml_chars
|
||||||
from calibre.utils.icu import numeric_sort_key, title_case as icu_title
|
from calibre.utils.icu import numeric_sort_key, title_case as icu_title
|
||||||
|
from calibre.utils.localization import __
|
||||||
from calibre.utils.short_uuid import uuid4
|
from calibre.utils.short_uuid import uuid4
|
||||||
from calibre.utils.xml_parse import safe_xml_fromstring
|
from calibre.utils.xml_parse import safe_xml_fromstring
|
||||||
from polyglot.builtins import codepoint_to_chr, iteritems, itervalues, string_or_bytes
|
from polyglot.builtins import codepoint_to_chr, iteritems, itervalues, string_or_bytes
|
||||||
|
@ -6,27 +6,28 @@ Container-/OPF-based input OEBBook reader.
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
||||||
|
|
||||||
import sys, os, uuid, copy, re, io
|
import copy
|
||||||
|
import io
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import uuid
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from calibre.ebooks.oeb.base import OPF1_NS, OPF2_NS, OPF2_NSMAP, DC11_NS, \
|
|
||||||
DC_NSES, OPF, xml2text, XHTML_MIME
|
|
||||||
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES, OEB_IMAGES, \
|
|
||||||
PAGE_MAP_MIME, JPEG_MIME, NCX_MIME, SVG_MIME
|
|
||||||
from calibre.ebooks.oeb.base import XMLDECL_RE, COLLAPSE_RE, \
|
|
||||||
MS_COVER_TYPE, iterlinks
|
|
||||||
from calibre.ebooks.oeb.base import namespace, barename, XPath, xpath, \
|
|
||||||
urlnormalize, BINARY_MIME, \
|
|
||||||
OEBError, OEBBook, DirContainer
|
|
||||||
from calibre.ebooks.oeb.writer import OEBWriter
|
|
||||||
from calibre.utils.xml_parse import safe_xml_fromstring
|
|
||||||
from calibre.utils.cleantext import clean_xml_chars
|
|
||||||
from calibre.utils.localization import get_lang
|
|
||||||
from calibre.ptempfile import TemporaryDirectory
|
|
||||||
from calibre.constants import __appname__, __version__
|
|
||||||
from calibre import guess_type, xml_replace_entities
|
from calibre import guess_type, xml_replace_entities
|
||||||
|
from calibre.constants import __appname__, __version__
|
||||||
|
from calibre.ebooks.oeb.base import (
|
||||||
|
BINARY_MIME, COLLAPSE_RE, DC11_NS, DC_NSES, JPEG_MIME, MS_COVER_TYPE, NCX_MIME,
|
||||||
|
OEB_DOCS, OEB_IMAGES, OEB_STYLES, OPF, OPF1_NS, OPF2_NS, OPF2_NSMAP, PAGE_MAP_MIME,
|
||||||
|
SVG_MIME, XHTML_MIME, XMLDECL_RE, DirContainer, OEBBook, OEBError, XPath, barename,
|
||||||
|
iterlinks, namespace, urlnormalize, xml2text, xpath,
|
||||||
|
)
|
||||||
|
from calibre.ebooks.oeb.writer import OEBWriter
|
||||||
|
from calibre.ptempfile import TemporaryDirectory
|
||||||
|
from calibre.utils.cleantext import clean_xml_chars
|
||||||
|
from calibre.utils.localization import __, get_lang
|
||||||
|
from calibre.utils.xml_parse import safe_xml_fromstring
|
||||||
from polyglot.urllib import unquote, urldefrag, urlparse
|
from polyglot.urllib import unquote, urldefrag, urlparse
|
||||||
|
|
||||||
__all__ = ['OEBReader']
|
__all__ = ['OEBReader']
|
||||||
|
@ -5,9 +5,10 @@ HTML-TOC-adding transform.
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
||||||
|
|
||||||
from calibre.ebooks.oeb.base import XML, XHTML, XHTML_NS
|
from calibre.ebooks.oeb.base import (
|
||||||
from calibre.ebooks.oeb.base import XHTML_MIME, CSS_MIME
|
CSS_MIME, XHTML, XHTML_MIME, XHTML_NS, XML, XPath, element,
|
||||||
from calibre.ebooks.oeb.base import element, XPath
|
)
|
||||||
|
from calibre.utils.localization import __
|
||||||
|
|
||||||
__all__ = ['HTMLTOCAdder']
|
__all__ = ['HTMLTOCAdder']
|
||||||
|
|
||||||
|
@ -268,6 +268,10 @@ def _(x: str) -> str:
|
|||||||
return default_translator.gettext(x)
|
return default_translator.gettext(x)
|
||||||
|
|
||||||
|
|
||||||
|
def __(x: str) -> str:
|
||||||
|
return x
|
||||||
|
|
||||||
|
|
||||||
def ngettext(singular: str, plural: str, n: int) -> str:
|
def ngettext(singular: str, plural: str, n: int) -> str:
|
||||||
return default_translator.ngettext(singular, plural, n)
|
return default_translator.ngettext(singular, plural, n)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user