diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index fd69a3745a..24d960f4c7 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -320,13 +320,14 @@ from calibre.devices.kindle.driver import KINDLE2 from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.eb600.driver import EB600 from calibre.devices.jetbook.driver import JETBOOK +from calibre.devices.bebook.driver import BEBOOK, BEBOOK_MINI plugins = [HTML2ZIP, EPUBInput, MOBIInput, PDBInput, PDFInput, HTMLInput, TXTInput, OEBOutput, TXTOutput, PDFOutput, LITInput, ComicInput, FB2Input, ODTInput, RTFInput, EPUBOutput, RecipeInput, PMLInput, PMLOutput, MOBIOutput, PDBOutput, LRFOutput, LITOutput] plugins += [PRS500, PRS505, PRS700, CYBOOKG3, KINDLE, KINDLE2, BLACKBERRY, - EB600, JETBOOK] + EB600, JETBOOK, BEBOOK, BEBOOK_MINI] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ x.__name__.endswith('MetadataReader')] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ 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..639a9fdd13 --- /dev/null +++ b/src/calibre/devices/bebook/driver.py @@ -0,0 +1,53 @@ +__license__ = 'GPL v3' +__copyright__ = '2009, Tijmen Ruizendaal ' +''' +Device driver for BeBook +''' + +from calibre.devices.usbms.driver import USBMS + +class BEBOOK(USBMS): + name = 'BeBook driver' + description = _('Communicate with the BeBook eBook reader.') + author = _('Tijmen Ruizendaal') + supported_platforms = ['windows', 'osx', 'linux'] + + + # 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_A_MEM = 'BEBOOK_STORAGE_CARD' + + OSX_MAIN_MEM = 'BeBook Internal Memory' + OSX_CARD_A_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 BEBOOK_MINI(BEBOOK): + name = 'BeBook Mini driver' + description = _('Communicate with the BeBook Mini eBook reader.') + + 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' + diff --git a/src/calibre/ebooks/metadata/pdf.py b/src/calibre/ebooks/metadata/pdf.py index 6bf8bba138..b1b647d925 100644 --- a/src/calibre/ebooks/metadata/pdf.py +++ b/src/calibre/ebooks/metadata/pdf.py @@ -80,7 +80,7 @@ def set_metadata(stream, mi): for page in orig_pdf.pages: 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: diff --git a/src/calibre/gui2/convert/bulk.py b/src/calibre/gui2/convert/bulk.py index 10910f20a8..23336037a1 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, \ @@ -65,10 +63,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 7bf3f0f6ea..c0da36e5dd 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,8 +155,8 @@ class Config(ResizableDialog, Ui_Dialog): input_widget = None name = 'calibre.gui2.convert.%s' % self.plumber.input_plugin.name.lower().replace(' ', '_') try: - __import__(name) - input_widget = sys.modules[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.')