From 41f635fd8832e234a097fc8acf016da39909370c Mon Sep 17 00:00:00 2001 From: John Schember Date: Mon, 28 Dec 2009 06:11:15 -0500 Subject: [PATCH] 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