mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
IGN:Pull from driver-dev
This commit is contained in:
commit
bae243edce
@ -34,7 +34,7 @@ class Writer(FormatWriter):
|
|||||||
self.log.info('Compessing data...')
|
self.log.info('Compessing data...')
|
||||||
for i in range(0, len(txt_records)):
|
for i in range(0, len(txt_records)):
|
||||||
self.log.debug('\tCompressing record %i' % i)
|
self.log.debug('\tCompressing record %i' % i)
|
||||||
txt_records[i] = compress_doc(txt_records[i].encode('utf-8'))
|
txt_records[i] = compress_doc(txt_records[i].encode('cp1252', 'replace'))
|
||||||
section_lengths.append(len(txt_records[i]))
|
section_lengths.append(len(txt_records[i]))
|
||||||
|
|
||||||
out_stream.seek(0)
|
out_stream.seek(0)
|
||||||
|
@ -33,7 +33,7 @@ class Writer(FormatWriter):
|
|||||||
self.log.info('Compressing data...')
|
self.log.info('Compressing data...')
|
||||||
for i in range(0, len(txt_records)):
|
for i in range(0, len(txt_records)):
|
||||||
self.log.debug('\tCompressing record %i' % i)
|
self.log.debug('\tCompressing record %i' % i)
|
||||||
txt_records[i] = compressor.compress(txt_records[i].encode('utf-8'))
|
txt_records[i] = compressor.compress(txt_records[i].encode('cp1252', 'replace'))
|
||||||
txt_records[i] = txt_records[i] + compressor.flush(zlib.Z_FULL_FLUSH)
|
txt_records[i] = txt_records[i] + compressor.flush(zlib.Z_FULL_FLUSH)
|
||||||
section_lengths.append(len(txt_records[i]))
|
section_lengths.append(len(txt_records[i]))
|
||||||
crc32 = zlib.crc32(txt_records[i], crc32) & 0xffffffff
|
crc32 = zlib.crc32(txt_records[i], crc32) & 0xffffffff
|
||||||
|
@ -55,7 +55,7 @@ class Worker(Thread):
|
|||||||
try:
|
try:
|
||||||
Thread.run(self)
|
Thread.run(self)
|
||||||
self.exception = self.traceback = None
|
self.exception = self.traceback = None
|
||||||
except Exception, err:
|
except Exception as err:
|
||||||
self.exception = err
|
self.exception = err
|
||||||
self.traceback = traceback.format_exc()
|
self.traceback = traceback.format_exc()
|
||||||
|
|
||||||
@ -543,8 +543,9 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
if isinstance(worker.exception, DRMError):
|
if isinstance(worker.exception, DRMError):
|
||||||
error_dialog(self, _('DRM Error'), _('<p>This book is protected by <a href="%s">DRM</a>')%'http://wiki.mobileread.com/wiki/DRM').exec_()
|
error_dialog(self, _('DRM Error'), _('<p>This book is protected by <a href="%s">DRM</a>')%'http://wiki.mobileread.com/wiki/DRM').exec_()
|
||||||
else:
|
else:
|
||||||
|
r = getattr(worker.exception, 'reason', worker.exception)
|
||||||
error_dialog(self, _('Could not open ebook'),
|
error_dialog(self, _('Could not open ebook'),
|
||||||
unicode(worker.exception), det_msg=worker.traceback, show=True)
|
unicode(r), det_msg=worker.traceback, show=True)
|
||||||
self.close_progress_indicator()
|
self.close_progress_indicator()
|
||||||
else:
|
else:
|
||||||
self.metadata.show_opf(self.iterator.opf)
|
self.metadata.show_opf(self.iterator.opf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user