mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat
This commit is contained in:
parent
0e9b59a6e2
commit
9112f967a0
@ -6,14 +6,14 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import struct, datetime, os, numbers
|
import struct, datetime, os, numbers, binascii
|
||||||
|
|
||||||
from calibre.utils.date import utc_tz
|
from calibre.utils.date import utc_tz
|
||||||
from calibre.ebooks.mobi.reader.headers import NULL_INDEX
|
from calibre.ebooks.mobi.reader.headers import NULL_INDEX
|
||||||
from calibre.ebooks.mobi.langcodes import main_language, sub_language
|
from calibre.ebooks.mobi.langcodes import main_language, sub_language
|
||||||
from calibre.ebooks.mobi.debug import format_bytes
|
from calibre.ebooks.mobi.debug import format_bytes
|
||||||
from calibre.ebooks.mobi.utils import get_trailing_data
|
from calibre.ebooks.mobi.utils import get_trailing_data
|
||||||
from polyglot.builtins import as_bytes, iteritems, range, unicode_type
|
from polyglot.builtins import iteritems, range, unicode_type
|
||||||
|
|
||||||
# PalmDB {{{
|
# PalmDB {{{
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ class EXTHRecord(object):
|
|||||||
else:
|
else:
|
||||||
self.data, = struct.unpack(b'>L', self.data)
|
self.data, = struct.unpack(b'>L', self.data)
|
||||||
elif self.type in {209, 300}:
|
elif self.type in {209, 300}:
|
||||||
self.data = as_bytes(self.data.encode('hex'))
|
self.data = binascii.hexlify(self.data)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '%s (%d): %r'%(self.name, self.type, self.data)
|
return '%s (%d): %r'%(self.name, self.type, self.data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user