From 316071b8483a340a797f636ca7f34acae7bd064e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 8 Apr 2009 08:24:04 -0700 Subject: [PATCH] IGN:Add support for the storage card in the EB600 --- src/calibre/devices/eb600/driver.py | 16 +++++++++++++--- src/calibre/devices/usbms/device.py | 13 ++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 354a6910cc..44690655a0 100755 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -8,15 +8,16 @@ from calibre.devices.usbms.driver import USBMS class EB600(USBMS): # Ordered list of supported formats - FORMATS = ['epub', 'pdf'] + FORMATS = ['epub', 'prc', 'chm', 'djvu', 'html', 'rtf', 'txt', 'pdf'] + DRM_FORMATS = ['prc', 'mobi', 'html', 'pdf', 'txt'] VENDOR_ID = [0x1f85] PRODUCT_ID = [0x1688] BCD = [0x110] - VENDOR_NAME = 'NETRONIX' + VENDOR_NAME = 'NETRONIX' WINDOWS_MAIN_MEM = 'EBOOK' - WINDOWS_CARD_MEM = 'CARD_STORAGE' + WINDOWS_CARD_MEM = 'EBOOK' OSX_MAIN_MEM = 'EB600 Internal Storage Media' OSX_CARD_MEM = 'EB600 Card Storage Media' @@ -28,4 +29,13 @@ class EB600(USBMS): EBOOK_DIR_CARD = '' SUPPORTS_SUB_DIRS = True + def windows_sort_drives(self, drives): + main = drives['main'] + card = drives['card'] + if card and main and card < main: + drives['main'] = card + drives['card'] = main + + return drives + diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index eb86cb7edd..5a1b5ef40d 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -174,6 +174,14 @@ class Device(_Device): return prefix + def windows_sort_drives(self, drives): + ''' + Called to disambiguate main memory and storage card for devices that + do not distinguish between them on the basis of `WINDOWS_CARD_NAME`. + For e.g.: The EB600 + ''' + return drives + def open_windows(self): time.sleep(6) drives = {} @@ -188,11 +196,14 @@ class Device(_Device): if 'main' in drives.keys() and 'card' in drives.keys(): break + drives = self.windows_sort_drives(drives) self._main_prefix = drives.get('main') self._card_prefix = drives.get('card') if not self._main_prefix: - raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__) + raise DeviceError( + _('Unable to detect the %s disk drive. Try rebooting.') % + self.__class__.__name__) def get_osx_mountpoints(self, raw=None): if raw is None: