mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -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.covers import download_cover
|
||||
from calibre.ebooks.metadata.sources.update import patch_plugins
|
||||
from polyglot.builtins import unicode_type
|
||||
|
||||
|
||||
def option_parser():
|
||||
@ -99,7 +100,7 @@ def main(args=sys.argv):
|
||||
log = buf.getvalue()
|
||||
|
||||
result = (metadata_to_opf(result) if opts.opf else
|
||||
type(u'')(result).encode('utf-8'))
|
||||
unicode_type(result).encode('utf-8'))
|
||||
|
||||
if opts.verbose:
|
||||
print (log, file=sys.stderr)
|
||||
|
@ -27,6 +27,7 @@ from calibre.utils.html2text import html2text
|
||||
from calibre.utils.icu import lower
|
||||
from calibre.utils.date import UNDEFINED_DATE
|
||||
from calibre.utils.formatter import EvalFormatter
|
||||
from polyglot.builtins import unicode_type
|
||||
|
||||
# Download worker {{{
|
||||
|
||||
@ -471,7 +472,7 @@ def identify(log, abort, # {{{
|
||||
for r in presults:
|
||||
log('\n\n---')
|
||||
try:
|
||||
log(type(u'')(r))
|
||||
log(unicode_type(r))
|
||||
except TypeError:
|
||||
log(repr(r))
|
||||
if plog:
|
||||
|
Loading…
x
Reference in New Issue
Block a user