mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix Cybook detection in windows
This commit is contained in:
parent
41d4461c65
commit
fb0cc73f40
@ -177,9 +177,9 @@ class Device(_Device):
|
|||||||
wmi = __import__('wmi', globals(), locals(), [], -1)
|
wmi = __import__('wmi', globals(), locals(), [], -1)
|
||||||
c = wmi.WMI()
|
c = wmi.WMI()
|
||||||
for drive in c.Win32_DiskDrive():
|
for drive in c.Win32_DiskDrive():
|
||||||
if self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_MAIN_MEM):
|
if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM):
|
||||||
drives['main'] = self.windows_get_drive_prefix(drive)
|
drives['main'] = self.windows_get_drive_prefix(drive)
|
||||||
elif self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_CARD_MEM):
|
elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_MEM):
|
||||||
drives['card'] = self.windows_get_drive_prefix(drive)
|
drives['card'] = self.windows_get_drive_prefix(drive)
|
||||||
|
|
||||||
if 'main' and 'card' in drives.keys():
|
if 'main' and 'card' in drives.keys():
|
||||||
|
@ -187,7 +187,7 @@ class RecursiveFetcher(object, LoggingInterface):
|
|||||||
raise FetchError, responses[err.code]
|
raise FetchError, responses[err.code]
|
||||||
if getattr(err, 'reason', [0])[0] == 104 or \
|
if getattr(err, 'reason', [0])[0] == 104 or \
|
||||||
getattr(err, 'errno', None) == -2: # Connection reset by peer or Name or service not know
|
getattr(err, 'errno', None) == -2: # Connection reset by peer or Name or service not know
|
||||||
self.log_debug('Temporary error, retyring in 1 second')
|
self.log_debug('Temporary error, retrying in 1 second')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
with closing(self.browser.open(url)) as f:
|
with closing(self.browser.open(url)) as f:
|
||||||
data = response(f.read()+f.read())
|
data = response(f.read()+f.read())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user