From 34845ca878100430592c4af2887517e8d488d8f2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 May 2009 09:06:59 -0700 Subject: [PATCH 1/5] IGN:Increase timeout for metadata writer --- src/calibre/ebooks/metadata/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/pdf.py b/src/calibre/ebooks/metadata/pdf.py index 769f169984..72376a5008 100644 --- a/src/calibre/ebooks/metadata/pdf.py +++ b/src/calibre/ebooks/metadata/pdf.py @@ -66,7 +66,7 @@ def set_metadata(stream, mi): out_pdf.addPage(page) writer.start() - writer.join(10) # Wait 10 secs for writing to complete + writer.join(15) # Wait 15 secs for writing to complete out_pdf.killed = True writer.join() if out_pdf.killed: From e121e8523bed46bc60d694379897ebc7b5e694c6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 May 2009 09:07:32 -0700 Subject: [PATCH 2/5] Support for the BeBook by Tijmen Ruizendaal from BeBook --- src/calibre/devices/__init__.py | 4 ++- src/calibre/devices/bebook/__init__.py | 2 ++ src/calibre/devices/bebook/driver.py | 45 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/calibre/devices/bebook/__init__.py create mode 100644 src/calibre/devices/bebook/driver.py diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index cd3cd30734..06efbc6434 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -12,11 +12,13 @@ def devices(): from calibre.devices.cybookg3.driver import CYBOOKG3 from calibre.devices.kindle.driver import KINDLE from calibre.devices.kindle.driver import KINDLE2 + from calibre.devices.bebook.driver import BEBOOK + from calibre.devices.bebook.driver import BEBOOKMINI from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.eb600.driver import EB600 from calibre.devices.jetbook.driver import JETBOOK return (PRS500, PRS505, PRS700, CYBOOKG3, KINDLE, KINDLE2, - BLACKBERRY, EB600, JETBOOK) + BEBOOK, BEBOOKMINI, BLACKBERRY, EB600, JETBOOK) import time diff --git a/src/calibre/devices/bebook/__init__.py b/src/calibre/devices/bebook/__init__.py new file mode 100644 index 0000000000..a4e8fdad76 --- /dev/null +++ b/src/calibre/devices/bebook/__init__.py @@ -0,0 +1,2 @@ +__license__ = 'GPL v3' +__copyright__ = '2009, Tijmen Ruizendaal ' diff --git a/src/calibre/devices/bebook/driver.py b/src/calibre/devices/bebook/driver.py new file mode 100644 index 0000000000..1b81fae27c --- /dev/null +++ b/src/calibre/devices/bebook/driver.py @@ -0,0 +1,45 @@ +__license__ = 'GPL v3' +__copyright__ = '2009, Tijmen Ruizendaal ' +''' +Device driver for BeBook +''' + +from calibre.devices.usbms.driver import USBMS + +class BEBOOK(USBMS): + # Ordered list of supported formats + FORMATS = ['mobi', 'epub', 'pdf', 'mobi', 'txt'] + + VENDOR_ID = [0x0525] + PRODUCT_ID = [0x8803, 0x6803] + BCD = [0x312] + + VENDOR_NAME = 'BEBOOK' + WINDOWS_MAIN_MEM = 'BEBOOK_INTERNAL_MEMORY' + WINDOWS_CARD_MEM = 'BEBOOK_STORAGE_CARD' + + OSX_MAIN_MEM = 'BeBook Internal Memory' + OSX_CARD_MEM = 'BeBook Storage Card' + + MAIN_MEMORY_VOLUME_LABEL = 'BeBook Internal Memory' + STORAGE_CARD_VOLUME_LABEL = 'BeBook Storage Card' + + SUPPORTS_SUB_DIRS = True + + FDI_LUNS = {'lun0':1, 'lun1':0, 'lun2':2} + +class BEBOOKMINI(BEBOOK): + + VENDOR_ID = [0x0492] + PRODUCT_ID = [0x8813] + BCD = [0x319] + + WINDOWS_MAIN_MEM = 'BEBOOKMINI_INTERNAL_MEMORY' + WINDOWS_CARD_MEM = 'BEBOOKMINI_STORAGE_CARD' + + OSX_MAIN_MEM = 'BeBook Mini Internal Memory' + OSX_CARD_MEM = 'BeBook Mini Storage Card' + + MAIN_MEMORY_VOLUME_LABEL = 'BeBook Mini Internal Memory' + STORAGE_CARD_VOLUME_LABEL = 'BeBook Mini Storage Card' + From 9a0b01864331d38fbc7f65a9badcfee4f6167467 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 May 2009 09:32:35 -0700 Subject: [PATCH 3/5] Use absolute imports for input/output widgets --- src/calibre/gui2/convert/bulk.py | 8 +++----- src/calibre/gui2/convert/single.py | 9 +++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/calibre/gui2/convert/bulk.py b/src/calibre/gui2/convert/bulk.py index 7bdacc26ee..5d54ed6350 100644 --- a/src/calibre/gui2/convert/bulk.py +++ b/src/calibre/gui2/convert/bulk.py @@ -4,8 +4,6 @@ __license__ = 'GPL 3' __copyright__ = '2009, John Schember ' __docformat__ = 'restructuredtext en' -import sys - from PyQt4.Qt import QString, SIGNAL from calibre.gui2.convert.single import Config, sort_formats_by_preference, \ @@ -64,10 +62,10 @@ class BulkConfig(Config): toc = widget_factory(TOCWidget) output_widget = None - name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_') + name = self.plumber.output_plugin.name.lower().replace(' ', '_') try: - __import__(name) - output_widget = sys.modules[name] + output_widget = __import__('calibre.gui2.convert.'+name, + fromlist=[1]) pw = output_widget.PluginWidget pw.ICON = ':/images/back.svg' pw.HELP = _('Options specific to the output format.') diff --git a/src/calibre/gui2/convert/single.py b/src/calibre/gui2/convert/single.py index eea4b6e11a..b735e17bc9 100644 --- a/src/calibre/gui2/convert/single.py +++ b/src/calibre/gui2/convert/single.py @@ -142,10 +142,10 @@ class Config(ResizableDialog, Ui_Dialog): toc = widget_factory(TOCWidget) output_widget = None - name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_') + name = self.plumber.output_plugin.name.lower().replace(' ', '_') try: - __import__(name) - output_widget = sys.modules[name] + output_widget = __import__('calibre.gui2.convert.'+name, + fromlist=[1]) pw = output_widget.PluginWidget pw.ICON = ':/images/back.svg' pw.HELP = _('Options specific to the output format.') @@ -155,7 +155,8 @@ class Config(ResizableDialog, Ui_Dialog): input_widget = None name = self.plumber.input_plugin.name.lower().replace(' ', '_') try: - input_widget = __import__(name) + input_widget = __import__('calibre.gui2.convert.'+name, + fromlist=[1]) pw = input_widget.PluginWidget pw.ICON = ':/images/forward.svg' pw.HELP = _('Options specific to the input format.') From 9da6fa99f3eca8743b0dcfb122509b4d965bc955 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 May 2009 11:58:28 -0700 Subject: [PATCH 4/5] IGN:... --- src/calibre/devices/bebook/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/bebook/driver.py b/src/calibre/devices/bebook/driver.py index faef1e04e7..5c45bdbdde 100644 --- a/src/calibre/devices/bebook/driver.py +++ b/src/calibre/devices/bebook/driver.py @@ -22,7 +22,7 @@ class BEBOOK(USBMS): VENDOR_NAME = 'BEBOOK' WINDOWS_MAIN_MEM = 'BEBOOK_INTERNAL_MEMORY' - WINDOWS_CARD_MEM = 'BEBOOK_STORAGE_CARD' + WINDOWS_CARD_A_MEM = 'BEBOOK_STORAGE_CARD' OSX_MAIN_MEM = 'BeBook Internal Memory' OSX_CARD_MEM = 'BeBook Storage Card' From e15eb118ef4e8098147cd6f72697bf896f92e523 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 May 2009 12:01:02 -0700 Subject: [PATCH 5/5] IGN:... --- src/calibre/devices/bebook/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/bebook/driver.py b/src/calibre/devices/bebook/driver.py index 5c45bdbdde..639a9fdd13 100644 --- a/src/calibre/devices/bebook/driver.py +++ b/src/calibre/devices/bebook/driver.py @@ -25,7 +25,7 @@ class BEBOOK(USBMS): WINDOWS_CARD_A_MEM = 'BEBOOK_STORAGE_CARD' OSX_MAIN_MEM = 'BeBook Internal Memory' - OSX_CARD_MEM = 'BeBook Storage Card' + OSX_CARD_A_MEM = 'BeBook Storage Card' MAIN_MEMORY_VOLUME_LABEL = 'BeBook Internal Memory' STORAGE_CARD_VOLUME_LABEL = 'BeBook Storage Card'