mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: More unicode porting
This commit is contained in:
parent
9316d8d673
commit
ef42213ceb
@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
'''
|
||||
Interface defining the necessary public functions for a pdb format reader.
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env python2
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
@ -6,4 +8,3 @@ __docformat__ = 'restructuredtext en'
|
||||
'''
|
||||
Used for pdf output for comic2pdf
|
||||
'''
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python2
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||
from __future__ import with_statement
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
|
@ -69,7 +69,7 @@ def serialize(o, stream):
|
||||
# Must check bool before int as bools are subclasses of int
|
||||
stream.write_raw(b'true' if o else b'false')
|
||||
elif isinstance(o, numbers.Integral):
|
||||
stream.write_raw(str(o).encode('ascii') if ispy3 else bytes(o))
|
||||
stream.write_raw(unicode_type(o).encode('ascii') if ispy3 else bytes(o))
|
||||
elif hasattr(o, 'pdf_serialize'):
|
||||
o.pdf_serialize(stream)
|
||||
elif o is None:
|
||||
|
@ -419,7 +419,7 @@ class PDFWriter(QObject):
|
||||
self.paged_js += P('viewer/hyphenate/Hyphenator.js', data=True).decode('utf-8')
|
||||
hjs, self.hyphenate_lang = load_hyphenator_dicts({}, self.book_language)
|
||||
self.paged_js += hjs
|
||||
self.hf_uuid = str(uuid.uuid4()).replace('-', '')
|
||||
self.hf_uuid = unicode_type(uuid.uuid4()).replace('-', '')
|
||||
|
||||
self.view.page().mainFrame().addToJavaScriptWindowObject("py_bridge", self)
|
||||
self.view.page().longjs_counter = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user