mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
IGN:calibre-debug -d now generated ioreg output on OS X
This commit is contained in:
parent
66b0b6c58f
commit
6bff37343e
@ -108,6 +108,11 @@ def debug_device_driver():
|
||||
drives.append((str(drive.PNPDeviceID), 'No mount points found'))
|
||||
for drive in drives:
|
||||
print '\t', drive
|
||||
if isosx:
|
||||
from calibre.devices.usbms.device import Device
|
||||
raw = Device.run_ioreg()
|
||||
open('/tmp/ioreg.txt', 'wb').write(raw)
|
||||
print 'ioreg output saved to /tmp/ioreg.txt'
|
||||
from calibre.devices import devices
|
||||
for dev in devices():
|
||||
print 'Looking for', dev.__name__
|
||||
|
@ -205,13 +205,19 @@ class Device(_Device):
|
||||
self._main_prefix = drives.get('main')
|
||||
self._card_prefix = drives.get('card', None)
|
||||
|
||||
@classmethod
|
||||
def run_ioreg(cls, raw=None):
|
||||
if raw is not None:
|
||||
return raw
|
||||
ioreg = '/usr/sbin/ioreg'
|
||||
if not os.access(ioreg, os.X_OK):
|
||||
ioreg = 'ioreg'
|
||||
return subprocess.Popen((ioreg+' -w 0 -S -c IOMedia').split(),
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
|
||||
|
||||
def get_osx_mountpoints(self, raw=None):
|
||||
if raw is None:
|
||||
ioreg = '/usr/sbin/ioreg'
|
||||
if not os.access(ioreg, os.X_OK):
|
||||
ioreg = 'ioreg'
|
||||
raw = subprocess.Popen((ioreg+' -w 0 -S -c IOMedia').split(),
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
raw = self.run_ioreg(raw)
|
||||
lines = raw.splitlines()
|
||||
names = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user