mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show output of osx_get_usb_drives() in the error message when failing to get drives names
This commit is contained in:
parent
0e19e671c4
commit
1f405bea55
@ -375,8 +375,9 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if d.match_numbers(vid, pid, bcd):
|
if d.match_numbers(vid, pid, bcd):
|
||||||
matches.append(path)
|
matches.append(path)
|
||||||
if not matches:
|
if not matches:
|
||||||
|
from pprint import pformat
|
||||||
raise DeviceError(
|
raise DeviceError(
|
||||||
'Could not detect BSD names for %s. Try rebooting.' % self.name)
|
'Could not detect BSD names for %s. Try rebooting.\nOutput from osx_get_usb_drives():\n%s' % (self.name, pformat(drives)))
|
||||||
|
|
||||||
pat = re.compile(r'(?P<m>\d+)([a-z]+(?P<p>\d+)){0,1}')
|
pat = re.compile(r'(?P<m>\d+)([a-z]+(?P<p>\d+)){0,1}')
|
||||||
def nums(x):
|
def nums(x):
|
||||||
@ -700,7 +701,8 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
d.product == objif.GetProperty('usb.product') and \
|
d.product == objif.GetProperty('usb.product') and \
|
||||||
d.serial == objif.GetProperty('usb.serial'):
|
d.serial == objif.GetProperty('usb.serial'):
|
||||||
midpath = manager.FindDeviceStringMatch('info.parent', path)
|
midpath = manager.FindDeviceStringMatch('info.parent', path)
|
||||||
dpaths = manager.FindDeviceStringMatch('storage.originating_device', path) + manager.FindDeviceStringMatch('storage.originating_device', midpath[0])
|
dpaths = manager.FindDeviceStringMatch(
|
||||||
|
'storage.originating_device', path) + manager.FindDeviceStringMatch('storage.originating_device', midpath[0])
|
||||||
for dpath in dpaths:
|
for dpath in dpaths:
|
||||||
# devif = dbus.Interface(bus.get_object('org.freedesktop.Hal', dpath), 'org.freedesktop.Hal.Device')
|
# devif = dbus.Interface(bus.get_object('org.freedesktop.Hal', dpath), 'org.freedesktop.Hal.Device')
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user