use gio open if available
This commit is contained in:
parent
216b880151
commit
ee586ee194
2 changed files with 13 additions and 3 deletions
10
oml/utils.py
10
oml/utils.py
|
|
@ -264,7 +264,10 @@ def open_file(path=None):
|
|||
if sys.platform == 'darwin':
|
||||
cmd += ['open', path]
|
||||
elif sys.platform.startswith('linux'):
|
||||
cmd += ['xdg-open', path]
|
||||
if os.path.exists('/usr/bin/gio'):
|
||||
cmd += ['gio', 'open', path]
|
||||
else:
|
||||
cmd += ['xdg-open', path]
|
||||
elif sys.platform == 'win32':
|
||||
path = '\\'.join(path.split('/'))
|
||||
os.startfile(path)
|
||||
|
|
@ -285,7 +288,10 @@ def open_folder(folder=None, path=None):
|
|||
path = folder
|
||||
cmd += ['open', '-R', path]
|
||||
elif sys.platform.startswith('linux'):
|
||||
cmd += ['xdg-open', folder]
|
||||
if os.path.exists('/usr/bin/gio'):
|
||||
cmd += ['gio', 'open', folder]
|
||||
else:
|
||||
cmd += ['xdg-open', folder]
|
||||
elif sys.platform == 'win32':
|
||||
path = '\\'.join(path.split('/'))
|
||||
cmd = 'explorer.exe /select,"%s"' % path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue