[Emrys] 2896: Macports 3.0.4 cannot view images
svn: r12714
This commit is contained in:
parent
b0a6f7c854
commit
e5d8544a6c
@ -214,9 +214,13 @@ def open_file_with_default_application( file_path ):
|
|||||||
except WindowsError, msg:
|
except WindowsError, msg:
|
||||||
ErrorDialog(_("Error Opening File"), str(msg))
|
ErrorDialog(_("Error Opening File"), str(msg))
|
||||||
else:
|
else:
|
||||||
|
if os.sys.platform='darwin':
|
||||||
|
utility = 'open'
|
||||||
|
else:
|
||||||
|
utility = 'xdg-open'
|
||||||
search = os.environ['PATH'].split(':')
|
search = os.environ['PATH'].split(':')
|
||||||
for lpath in search:
|
for lpath in search:
|
||||||
prog = os.path.join(lpath, 'xdg-open')
|
prog = os.path.join(lpath, utility)
|
||||||
if os.path.isfile(prog):
|
if os.path.isfile(prog):
|
||||||
os.spawnvpe(os.P_NOWAIT, prog, [prog, norm_path], os.environ)
|
os.spawnvpe(os.P_NOWAIT, prog, [prog, norm_path], os.environ)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user