From 902a8bd3c79cfc3f4735110bbbdfff0a580976c9 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 27 Dec 2009 23:13:44 -0500 Subject: [PATCH 1/4] Activate DBOOK device interface. --- src/calibre/customize/builtins.py | 3 ++- src/calibre/devices/eb600/driver.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 5f65e0f11d..d6cafcf1d0 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -404,7 +404,7 @@ from calibre.devices.hanlin.driver import HANLINV3, HANLINV5, BOOX from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.cybookg3.driver import CYBOOKG3, CYBOOK_OPUS from calibre.devices.eb600.driver import EB600, COOL_ER, SHINEBOOK, \ - POCKETBOOK360, GER2, ITALICA, ECLICTO + POCKETBOOK360, GER2, ITALICA, ECLICTO, DBOOK from calibre.devices.iliad.driver import ILIAD from calibre.devices.irexdr.driver import IREXDR1000 from calibre.devices.jetbook.driver import JETBOOK @@ -481,6 +481,7 @@ plugins += [ ITALICA, SHINEBOOK, ECLICTO, + DBOOK, BOOX, EB600, ] diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 515fdc0765..9be9e27864 100644 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -145,7 +145,7 @@ class ECLICTO(EB600): EBOOK_DIR_MAIN = 'Text' EBOOK_DIR_CARD_A = '' -class Dbook(EB600): +class DBOOK(EB600): name = 'Airis Dbook Device Interface' gui_name = 'Airis Dbook' From 3b609a25de76e97a166c3b8753a70861a9960d17 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 27 Dec 2009 23:28:48 -0500 Subject: [PATCH 2/4] Clean up welcome wizard profiles a bit. --- src/calibre/gui2/wizard/__init__.py | 53 ++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index f2e5d945e0..85dbf1d344 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -89,9 +89,15 @@ class Sony500(Device): class Sony505(Sony500): output_format = 'EPUB' - name = 'SONY Reader Pocket/Touch Edition' + name = 'SONY Reader 6" and Touch Edition' id = 'prs505' +class Sony300(Sony505): + + name = 'SONY Reader Pocket Edition' + id = 'prs300' + output_profile = 'sony300' + class Sony900(Sony505): name = 'SONY Reader Daily Edition' @@ -119,14 +125,6 @@ class CybookOpus(CybookG3): output_profile = 'cybook_opus' id = 'cybook_opus' -class BeBook(Device): - - name = 'BeBook or BeBook Mini' - output_format = 'EPUB' - output_profile = 'sony' - manufacturer = 'Endless Ideas' - id = 'bebook' - class iPhone(Device): name = 'iPhone/iTouch + Stanza' @@ -141,14 +139,45 @@ class Android(Device): manufacturer = 'Google/HTC' id = 'android' -class Hanlin(Device): +class HanlinV3(Device): name = 'Hanlin V3' - output_format = 'MOBI' + output_format = 'EPUB' output_profile = 'hanlinv3' - manufacturer = 'Hanlin' + manufacturer = 'Jinke' id = 'hanlinv3' +class HanlinV5(HanlinV3): + + name = 'Hanlin V5' + output_profile = 'hanlinv5' + id = 'hanlinv5' + +class BeBook(HanlinV3): + + name = 'BeBook' + manufacturer = 'Endless Ideas' + id = 'bebook' + +class BeBookMini(HanlinV5): + + name = 'BeBook Mini' + manufacturer = 'Endless Ideas' + id = 'bebook_mini' + +class EZReader(HanlinV3): + + name = 'EZReader' + manufacturer = 'Astak' + id = 'ezreader' + +class EZReaderPP(HanlinV5): + + name = 'EZReader Pocket Pro' + manufacturer = 'Astak' + id = 'ezreader_pp' + + def get_devices(): for x in globals().values(): if isinstance(x, type) and issubclass(x, Device): From 41f635fd8832e234a097fc8acf016da39909370c Mon Sep 17 00:00:00 2001 From: John Schember Date: Mon, 28 Dec 2009 06:11:15 -0500 Subject: [PATCH 3/4] Add support for Binatone Readme. --- src/calibre/customize/builtins.py | 2 + src/calibre/devices/binatone/__init__.py | 0 src/calibre/devices/binatone/driver.py | 53 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 src/calibre/devices/binatone/__init__.py create mode 100644 src/calibre/devices/binatone/driver.py diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index d6cafcf1d0..36ffc19cbf 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -417,6 +417,7 @@ from calibre.devices.nokia.driver import N770, N810 from calibre.devices.eslick.driver import ESLICK from calibre.devices.nuut2.driver import NUUT2 from calibre.devices.iriver.driver import IRIVER_STORY +from calibre.devices.binatone.driver import README from calibre.ebooks.metadata.fetch import GoogleBooks, ISBNDB, Amazon plugins = [HTML2ZIP, PML2PMLZ, GoogleBooks, ISBNDB, Amazon] @@ -484,6 +485,7 @@ plugins += [ DBOOK, BOOX, EB600, + README, ] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ x.__name__.endswith('MetadataReader')] diff --git a/src/calibre/devices/binatone/__init__.py b/src/calibre/devices/binatone/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/calibre/devices/binatone/driver.py b/src/calibre/devices/binatone/driver.py new file mode 100644 index 0000000000..aca08df27d --- /dev/null +++ b/src/calibre/devices/binatone/driver.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +__license__ = 'GPL v3' +__copyright__ = '2009, John Schember ' +__docformat__ = 'restructuredtext en' + +''' +Device driver for Bookeen's Cybook Gen 3 +''' + +from calibre.devices.usbms.driver import USBMS + +class README(USBMS): + + name = 'Binatone Readme Device Interface' + gui_name = 'Binatone Readme' + description = _('Communicate with the Binatone Readme eBook reader.') + author = 'John Schember' + supported_platforms = ['windows', 'osx', 'linux'] + + # Ordered list of supported formats + # Be sure these have an entry in calibre.devices.mime + FORMATS = ['txt'] + + VENDOR_ID = [0x04fc] + PRODUCT_ID = [0x5563] + BCD = [0x0100] + + VENDOR_NAME = '' + WINDOWS_MAIN_MEM = 'MASS_STORAGE' + WINDOWS_CARD_A_MEM = 'MASS_STORAGE' + + MAIN_MEMORY_VOLUME_LABEL = 'Readme Main Memory' + STORAGE_CARD_VOLUME_LABEL = 'Readme Storage Card' + + SUPPORTS_SUB_DIRS = True + + def windows_sort_drives(self, drives): + main = drives.get('main', None) + card = drives.get('carda', None) + if card and main and card < main: + drives['main'] = card + drives['carda'] = main + + return drives + + def linux_swap_drives(self, drives): + if len(drives) < 2: return drives + drives = list(drives) + t = drives[0] + drives[0] = drives[1] + drives[1] = t + return tuple(drives) \ No newline at end of file From 8599f954098ac1c9d95ac376dab8aededcbb9f31 Mon Sep 17 00:00:00 2001 From: John Schember Date: Mon, 28 Dec 2009 06:15:48 -0500 Subject: [PATCH 4/4] Boox driver: Fix bug with supported formats. --- src/calibre/devices/hanlin/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/hanlin/driver.py b/src/calibre/devices/hanlin/driver.py index 79b17acde2..aee2a70fd5 100644 --- a/src/calibre/devices/hanlin/driver.py +++ b/src/calibre/devices/hanlin/driver.py @@ -115,7 +115,7 @@ class BOOX(HANLINV3): supported_platforms = ['windows', 'osx', 'linux'] # Ordered list of supported formats - FORMATS = ['ebub', 'pdf', 'html', 'txt', 'rtf', 'mobi', 'prc', 'chm'] + FORMATS = ['epub', 'pdf', 'html', 'txt', 'rtf', 'mobi', 'prc', 'chm'] VENDOR_ID = [0x0525] PRODUCT_ID = [0xa4a5]