More device detection debug output on OS X

This commit is contained in:
Kovid Goyal 2010-02-26 00:40:26 -07:00
parent e99385a74e
commit b9ca3bfe3a
2 changed files with 10 additions and 4 deletions

View File

@ -60,8 +60,10 @@ def debug(ioreg_to_tmp=False, buf=None):
if isosx: if isosx:
from calibre.devices.usbms.device import Device from calibre.devices.usbms.device import Device
mount = repr(Device.osx_run_mount()) mount = repr(Device.osx_run_mount())
ioreg = Device.run_ioreg() drives = pprint.pformat(Device.osx_get_usb_drives())
ioreg = 'Output from mount:\n\n'+mount+'\n\n'+ioreg ioreg = 'Output from mount:\n'+mount+'\n\n'
ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n'
ioreg += Device.run_ioreg()
connected_devices = [] connected_devices = []
for dev in device_plugins(): for dev in device_plugins():
out('Looking for', dev.__class__.__name__) out('Looking for', dev.__class__.__name__)

View File

@ -333,10 +333,14 @@ class Device(DeviceConfig, DevicePlugin):
raise raise
time.sleep(2) time.sleep(2)
def _osx_bsd_names(self): @classmethod
def osx_get_usb_drives(cls):
if usbobserver_err: if usbobserver_err:
raise RuntimeError('Failed to load usbobserver: '+usbobserver_err) raise RuntimeError('Failed to load usbobserver: '+usbobserver_err)
drives = usbobserver.get_usb_drives() return usbobserver.get_usb_drives()
def _osx_bsd_names(self):
drives = self.osx_get_usb_drives()
matches = [] matches = []
d = self.detected_device d = self.detected_device
if d.serial: if d.serial: