From 7fb663e04836826631163ee4d8bb0dedaca6172e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 18 Jan 2009 21:02:11 -0800 Subject: [PATCH] Fix #1641 (4.129 crashes when Reader device is attached) --- src/calibre/devices/prs505/driver.py | 29 ---------------------------- 1 file changed, 29 deletions(-) diff --git a/src/calibre/devices/prs505/driver.py b/src/calibre/devices/prs505/driver.py index fa8f6845cc..bbda8f95d2 100644 --- a/src/calibre/devices/prs505/driver.py +++ b/src/calibre/devices/prs505/driver.py @@ -146,36 +146,7 @@ class PRS505(Device): self._card_prefix = re.search(card_pat, mount).group(2) + os.sep - def open_windows_nowmi(self): - from calibre import plugins - winutil = plugins['winutil'][0] - volumes = winutil.get_mounted_volumes_for_usb_device(self.VENDOR_ID, self.PRODUCT_ID) - main = None - for device_id in volumes.keys(): - if 'PRS-505/UC&' in device_id: - main = volumes[device_id]+':\\' - if not main: - raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.')%self.__class__.__name__) - self._main_prefix = main - card = self._card_prefix = None - win32api = __import__('win32api') - for device_id in volumes.keys(): - if 'PRS-505/UC:' in device_id: - card = volumes[device_id]+':\\' - try: - win32api.GetVolumeInformation(card) - self._card_prefix = card - break - except: - continue - - def open_windows(self): - try: - self.open_windows_nowmi() - return - except: - pass drives = [] wmi = __import__('wmi', globals(), locals(), [], -1) c = wmi.WMI()