mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: more use of unicode_type
These metadata sources files are part of the infrastructure, not the parts which are downloaded.
This commit is contained in:
parent
83b055122a
commit
e828a4bd98
@ -21,6 +21,7 @@ from calibre.ebooks.metadata.sources.base import create_log
|
|||||||
from calibre.ebooks.metadata.sources.identify import identify
|
from calibre.ebooks.metadata.sources.identify import identify
|
||||||
from calibre.ebooks.metadata.sources.covers import download_cover
|
from calibre.ebooks.metadata.sources.covers import download_cover
|
||||||
from calibre.ebooks.metadata.sources.update import patch_plugins
|
from calibre.ebooks.metadata.sources.update import patch_plugins
|
||||||
|
from polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
def option_parser():
|
def option_parser():
|
||||||
@ -99,7 +100,7 @@ def main(args=sys.argv):
|
|||||||
log = buf.getvalue()
|
log = buf.getvalue()
|
||||||
|
|
||||||
result = (metadata_to_opf(result) if opts.opf else
|
result = (metadata_to_opf(result) if opts.opf else
|
||||||
type(u'')(result).encode('utf-8'))
|
unicode_type(result).encode('utf-8'))
|
||||||
|
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
print (log, file=sys.stderr)
|
print (log, file=sys.stderr)
|
||||||
|
@ -27,6 +27,7 @@ from calibre.utils.html2text import html2text
|
|||||||
from calibre.utils.icu import lower
|
from calibre.utils.icu import lower
|
||||||
from calibre.utils.date import UNDEFINED_DATE
|
from calibre.utils.date import UNDEFINED_DATE
|
||||||
from calibre.utils.formatter import EvalFormatter
|
from calibre.utils.formatter import EvalFormatter
|
||||||
|
from polyglot.builtins import unicode_type
|
||||||
|
|
||||||
# Download worker {{{
|
# Download worker {{{
|
||||||
|
|
||||||
@ -471,7 +472,7 @@ def identify(log, abort, # {{{
|
|||||||
for r in presults:
|
for r in presults:
|
||||||
log('\n\n---')
|
log('\n\n---')
|
||||||
try:
|
try:
|
||||||
log(type(u'')(r))
|
log(unicode_type(r))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
log(repr(r))
|
log(repr(r))
|
||||||
if plog:
|
if plog:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user