From bf973de56f037c6f586e34f6e9a0bc07110c88ba Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 May 2009 15:27:07 -0700 Subject: [PATCH 1/3] version 0.5.10 --- src/calibre/constants.py | 2 +- src/calibre/devices/eb600/driver.py | 11 +++++++++-- src/calibre/devices/jetbook/driver.py | 7 ++----- src/calibre/devices/usbms/device.py | 10 +++++----- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index f5fd6f1c9c..a30bfa7516 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.5.9' +__version__ = '0.5.10' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 44690655a0..4b9204ebd0 100755 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -2,6 +2,13 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' ''' Device driver for the Netronix EB600 + +Windows PNP strings: + ('USBSTOR\\DISK&VEN_NETRONIX&PROD_EBOOK&REV_062E\\6&1A275569&0&EB6001009 +2W00000&0', 2, u'F:\\') + ('USBSTOR\\DISK&VEN_NETRONIX&PROD_EBOOK&REV_062E\\6&1A275569&0&EB6001009 +2W00000&1', 3, u'G:\\') + ''' from calibre.devices.usbms.driver import USBMS @@ -30,8 +37,8 @@ class EB600(USBMS): SUPPORTS_SUB_DIRS = True def windows_sort_drives(self, drives): - main = drives['main'] - card = drives['card'] + main = drives.get('main', None) + card = drives.get('card', None) if card and main and card < main: drives['main'] = card drives['card'] = main diff --git a/src/calibre/devices/jetbook/driver.py b/src/calibre/devices/jetbook/driver.py index 5d53bd5b74..3fb9b1cdd1 100644 --- a/src/calibre/devices/jetbook/driver.py +++ b/src/calibre/devices/jetbook/driver.py @@ -23,9 +23,6 @@ class JETBOOK(USBMS): WINDOWS_MAIN_MEM = 'EBOOK' WINDOWS_CARD_MEM = 'EBOOK' - WINDOWS_MAIN_MEM = None - WINDOWS_CARD_MEM = None - OSX_MAIN_MEM = None OSX_CARD_MEM = None @@ -110,8 +107,8 @@ class JETBOOK(USBMS): return mi def windows_sort_drives(self, drives): - main = drives['main'] - card = drives['card'] + main = drives.get('main', None) + card = drives.get('card', None) if card and main and card < main: drives['main'] = card drives['card'] = main diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 5bcc384b00..ec021edb3b 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -196,15 +196,15 @@ 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: + if 'main' not in drives: raise DeviceError( _('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__) + drives = self.windows_sort_drives(drives) + self._main_prefix = drives.get('main') + self._card_prefix = drives.get('card', None) + def get_osx_mountpoints(self, raw=None): if raw is None: ioreg = '/usr/sbin/ioreg' From c41dc2d6d00e7211b817bf11948b1453b3b9c98c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 May 2009 15:28:51 -0700 Subject: [PATCH 2/3] IGN:Tag release From 1118d338e0410fa04cd9f770b9cad31b105abfa1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 May 2009 16:13:38 -0700 Subject: [PATCH 3/3] IGN:... --- src/calibre/debug.py | 1 + src/calibre/devices/usbms/device.py | 2 +- src/calibre/devices/usbms/driver.py | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 9dee6b2a86..35fc615b58 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -117,6 +117,7 @@ def debug_device_driver(): print 'Trying to open device...' d = dev() d.open() + print 'Main memory:', repr(d._main_prefix) print 'Total space:', d.total_space() break diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index ec021edb3b..660953e68c 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -106,7 +106,7 @@ class Device(_Device): @classmethod def _windows_space(cls, prefix): - if prefix is None: + if not prefix: return 0, 0 win32file = __import__('win32file', globals(), locals(), [], -1) try: diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index 21a5da77cd..fdb553f15b 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -42,10 +42,6 @@ class USBMS(Device): report_progress=report_progress) def get_device_information(self, end_session=True): - """ - Ask device for device information. See L{DeviceInfoQuery}. - @return: (device name, device version, software version on device, mime type) - """ return (self.__class__.__name__, '', '', '') def books(self, oncard=False, end_session=True):