mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix detection of BeBook on windows when no storage card is present. Fixes #2974 (BeBook not reconized)
This commit is contained in:
parent
f3635ab09c
commit
ac0730bf6a
@ -51,6 +51,11 @@ class BEBOOK(USBMS):
|
|||||||
|
|
||||||
return drives
|
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):
|
def osx_sort_names(self, names):
|
||||||
main = names.get('main', None)
|
main = names.get('main', None)
|
||||||
card = names.get('carda', None)
|
card = names.get('carda', None)
|
||||||
|
@ -272,6 +272,8 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
'cardb' in drives.keys():
|
'cardb' in drives.keys():
|
||||||
break
|
break
|
||||||
|
|
||||||
|
drives = self.windows_open_callback(drives)
|
||||||
|
|
||||||
if 'main' not in drives:
|
if 'main' not in drives:
|
||||||
raise DeviceError(
|
raise DeviceError(
|
||||||
_('Unable to detect the %s disk drive. Try rebooting.') %
|
_('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_a_prefix = drives.get('carda', None)
|
||||||
self._card_b_prefix = drives.get('cardb', None)
|
self._card_b_prefix = drives.get('cardb', None)
|
||||||
|
|
||||||
|
def windows_open_callback(self, drives):
|
||||||
|
return drives
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run_ioreg(cls, raw=None):
|
def run_ioreg(cls, raw=None):
|
||||||
if raw is not None:
|
if raw is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user