mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 06:46:22 +01:00
Fix device detection on OS X when users have a customized environment.plist
This commit is contained in:
parent
30a11fdfaa
commit
42e6fb932b
1 changed files with 7 additions and 4 deletions
|
|
@ -19,10 +19,10 @@ def __init__(self, path):
|
|||
self.is_readonly = not os.access(path, os.W_OK)
|
||||
self.ctime = stats.st_ctime
|
||||
self.wtime = stats.st_mtime
|
||||
self.size = stats.st_size
|
||||
if path.endswith(os.sep):
|
||||
self.size = stats.st_size
|
||||
if path.endswith(os.sep):
|
||||
path = path[:-1]
|
||||
self.path = path
|
||||
self.path = path
|
||||
self.name = os.path.basename(path)
|
||||
|
||||
|
||||
|
|
@ -108,7 +108,10 @@ def is_device(cls, device_id):
|
|||
@classmethod
|
||||
def get_osx_mountpoints(cls, raw=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()
|
||||
lines = raw.splitlines()
|
||||
names = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue