Fix detection of BeBook on windows when no storage card is present. Fixes #2974 (BeBook not reconized)

This commit is contained in:
Kovid Goyal 2009-08-03 14:48:46 -06:00
parent f3635ab09c
commit ac0730bf6a
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,11 @@ class BEBOOK(USBMS):
return drives
def windows_open_callback(self, drives):
if 'main' not in drives and 'carda' in drives:
drives['main'] = drives.pop('carda')
return drives
def osx_sort_names(self, names):
main = names.get('main', None)
card = names.get('carda', None)

View File

@ -272,6 +272,8 @@ class Device(DeviceConfig, DevicePlugin):
'cardb' in drives.keys():
break
drives = self.windows_open_callback(drives)
if 'main' not in drives:
raise DeviceError(
_('Unable to detect the %s disk drive. Try rebooting.') %
@ -282,6 +284,9 @@ class Device(DeviceConfig, DevicePlugin):
self._card_a_prefix = drives.get('carda', None)
self._card_b_prefix = drives.get('cardb', None)
def windows_open_callback(self, drives):
return drives
@classmethod
def run_ioreg(cls, raw=None):
if raw is not None: