IGN:calibre-debug -d now generated ioreg output on OS X

This commit is contained in:
Kovid Goyal 2009-05-04 18:40:28 -07:00
parent 66b0b6c58f
commit 6bff37343e
3 changed files with 18 additions and 7 deletions

View File

@ -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__

View File

@ -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 = {}

View File

@ -399,7 +399,7 @@ class update(OptionlessCommand):
' a version update.'
def run(self):
for x in ['build', 'dist', 'docs'] + \
for x in ['build', 'dist'] + \
glob.glob(os.path.join('src', 'calibre', 'plugins', '*')):
if os.path.exists(x):
if os.path.isdir(x):