mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Sync to pluginize
This commit is contained in:
commit
cff3125b80
@ -320,13 +320,14 @@ from calibre.devices.kindle.driver import KINDLE2
|
|||||||
from calibre.devices.blackberry.driver import BLACKBERRY
|
from calibre.devices.blackberry.driver import BLACKBERRY
|
||||||
from calibre.devices.eb600.driver import EB600
|
from calibre.devices.eb600.driver import EB600
|
||||||
from calibre.devices.jetbook.driver import JETBOOK
|
from calibre.devices.jetbook.driver import JETBOOK
|
||||||
|
from calibre.devices.bebook.driver import BEBOOK, BEBOOK_MINI
|
||||||
|
|
||||||
plugins = [HTML2ZIP, EPUBInput, MOBIInput, PDBInput, PDFInput, HTMLInput,
|
plugins = [HTML2ZIP, EPUBInput, MOBIInput, PDBInput, PDFInput, HTMLInput,
|
||||||
TXTInput, OEBOutput, TXTOutput, PDFOutput, LITInput, ComicInput,
|
TXTInput, OEBOutput, TXTOutput, PDFOutput, LITInput, ComicInput,
|
||||||
FB2Input, ODTInput, RTFInput, EPUBOutput, RecipeInput, PMLInput,
|
FB2Input, ODTInput, RTFInput, EPUBOutput, RecipeInput, PMLInput,
|
||||||
PMLOutput, MOBIOutput, PDBOutput, LRFOutput, LITOutput]
|
PMLOutput, MOBIOutput, PDBOutput, LRFOutput, LITOutput]
|
||||||
plugins += [PRS500, PRS505, PRS700, CYBOOKG3, KINDLE, KINDLE2, BLACKBERRY,
|
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 \
|
plugins += [x for x in list(locals().values()) if isinstance(x, type) and \
|
||||||
x.__name__.endswith('MetadataReader')]
|
x.__name__.endswith('MetadataReader')]
|
||||||
plugins += [x for x in list(locals().values()) if isinstance(x, type) and \
|
plugins += [x for x in list(locals().values()) if isinstance(x, type) and \
|
||||||
|
2
src/calibre/devices/bebook/__init__.py
Normal file
2
src/calibre/devices/bebook/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Tijmen Ruizendaal <tijmen at mybebook.com>'
|
53
src/calibre/devices/bebook/driver.py
Normal file
53
src/calibre/devices/bebook/driver.py
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Tijmen Ruizendaal <tijmen at mybebook.com>'
|
||||||
|
'''
|
||||||
|
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'
|
||||||
|
|
@ -80,7 +80,7 @@ def set_metadata(stream, mi):
|
|||||||
for page in orig_pdf.pages:
|
for page in orig_pdf.pages:
|
||||||
out_pdf.addPage(page)
|
out_pdf.addPage(page)
|
||||||
writer.start()
|
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
|
out_pdf.killed = True
|
||||||
writer.join()
|
writer.join()
|
||||||
if out_pdf.killed:
|
if out_pdf.killed:
|
||||||
|
@ -4,8 +4,6 @@ __license__ = 'GPL 3'
|
|||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from PyQt4.Qt import QString, SIGNAL
|
from PyQt4.Qt import QString, SIGNAL
|
||||||
|
|
||||||
from calibre.gui2.convert.single import Config, sort_formats_by_preference, \
|
from calibre.gui2.convert.single import Config, sort_formats_by_preference, \
|
||||||
@ -65,10 +63,10 @@ class BulkConfig(Config):
|
|||||||
toc = widget_factory(TOCWidget)
|
toc = widget_factory(TOCWidget)
|
||||||
|
|
||||||
output_widget = None
|
output_widget = None
|
||||||
name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_')
|
name = self.plumber.output_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
__import__(name)
|
output_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
output_widget = sys.modules[name]
|
fromlist=[1])
|
||||||
pw = output_widget.PluginWidget
|
pw = output_widget.PluginWidget
|
||||||
pw.ICON = ':/images/back.svg'
|
pw.ICON = ':/images/back.svg'
|
||||||
pw.HELP = _('Options specific to the output format.')
|
pw.HELP = _('Options specific to the output format.')
|
||||||
|
@ -142,10 +142,10 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
toc = widget_factory(TOCWidget)
|
toc = widget_factory(TOCWidget)
|
||||||
|
|
||||||
output_widget = None
|
output_widget = None
|
||||||
name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_')
|
name = self.plumber.output_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
__import__(name)
|
output_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
output_widget = sys.modules[name]
|
fromlist=[1])
|
||||||
pw = output_widget.PluginWidget
|
pw = output_widget.PluginWidget
|
||||||
pw.ICON = ':/images/back.svg'
|
pw.ICON = ':/images/back.svg'
|
||||||
pw.HELP = _('Options specific to the output format.')
|
pw.HELP = _('Options specific to the output format.')
|
||||||
@ -155,8 +155,8 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
input_widget = None
|
input_widget = None
|
||||||
name = 'calibre.gui2.convert.%s' % self.plumber.input_plugin.name.lower().replace(' ', '_')
|
name = 'calibre.gui2.convert.%s' % self.plumber.input_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
__import__(name)
|
input_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
input_widget = sys.modules[name]
|
fromlist=[1])
|
||||||
pw = input_widget.PluginWidget
|
pw = input_widget.PluginWidget
|
||||||
pw.ICON = ':/images/forward.svg'
|
pw.ICON = ':/images/forward.svg'
|
||||||
pw.HELP = _('Options specific to the input format.')
|
pw.HELP = _('Options specific to the input format.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user