mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix device detection on OS X when users have a customized environment.plist
This commit is contained in:
parent
30a11fdfaa
commit
42e6fb932b
@ -19,10 +19,10 @@ class File(object):
|
|||||||
self.is_readonly = not os.access(path, os.W_OK)
|
self.is_readonly = not os.access(path, os.W_OK)
|
||||||
self.ctime = stats.st_ctime
|
self.ctime = stats.st_ctime
|
||||||
self.wtime = stats.st_mtime
|
self.wtime = stats.st_mtime
|
||||||
self.size = stats.st_size
|
self.size = stats.st_size
|
||||||
if path.endswith(os.sep):
|
if path.endswith(os.sep):
|
||||||
path = path[:-1]
|
path = path[:-1]
|
||||||
self.path = path
|
self.path = path
|
||||||
self.name = os.path.basename(path)
|
self.name = os.path.basename(path)
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +108,10 @@ class PRS505(Device):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_osx_mountpoints(cls, raw=None):
|
def get_osx_mountpoints(cls, raw=None):
|
||||||
if raw is None:
|
if raw is None:
|
||||||
raw = subprocess.Popen('ioreg -w 0 -S -c IOMedia'.split(),
|
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).stdout.read()
|
stdout=subprocess.PIPE).stdout.read()
|
||||||
lines = raw.splitlines()
|
lines = raw.splitlines()
|
||||||
names = {}
|
names = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user