mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -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'))
|
drives.append((str(drive.PNPDeviceID), 'No mount points found'))
|
||||||
for drive in drives:
|
for drive in drives:
|
||||||
print '\t', drive
|
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
|
from calibre.devices import devices
|
||||||
for dev in devices():
|
for dev in devices():
|
||||||
print 'Looking for', dev.__name__
|
print 'Looking for', dev.__name__
|
||||||
|
@ -205,13 +205,19 @@ class Device(_Device):
|
|||||||
self._main_prefix = drives.get('main')
|
self._main_prefix = drives.get('main')
|
||||||
self._card_prefix = drives.get('card', None)
|
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):
|
def get_osx_mountpoints(self, raw=None):
|
||||||
if raw is None:
|
raw = self.run_ioreg(raw)
|
||||||
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]
|
|
||||||
lines = raw.splitlines()
|
lines = raw.splitlines()
|
||||||
names = {}
|
names = {}
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ class update(OptionlessCommand):
|
|||||||
' a version update.'
|
' a version update.'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
for x in ['build', 'dist', 'docs'] + \
|
for x in ['build', 'dist'] + \
|
||||||
glob.glob(os.path.join('src', 'calibre', 'plugins', '*')):
|
glob.glob(os.path.join('src', 'calibre', 'plugins', '*')):
|
||||||
if os.path.exists(x):
|
if os.path.exists(x):
|
||||||
if os.path.isdir(x):
|
if os.path.isdir(x):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user