remove spawnvp {leaves zombies} and use os.system [since windows now use registry]
This commit is contained in:
parent
0433b146c7
commit
ed26c8fa77
1 changed files with 8 additions and 16 deletions
24
src/gajim.py
24
src/gajim.py
|
@ -125,7 +125,7 @@ GTKGUI_GLADE = 'gtkgui.glade'
|
||||||
|
|
||||||
|
|
||||||
class Interface:
|
class Interface:
|
||||||
def launch_browser_mailer(self, kind, url):
|
def launch_browser_mailer(self, kind, uri):
|
||||||
#kind = 'url' or 'mail'
|
#kind = 'url' or 'mail'
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
try:
|
try:
|
||||||
|
@ -134,27 +134,19 @@ class Interface:
|
||||||
pass
|
pass
|
||||||
return
|
return
|
||||||
if gajim.config.get('openwith') == 'gnome-open':
|
if gajim.config.get('openwith') == 'gnome-open':
|
||||||
app = 'gnome-open'
|
command = 'gnome-open'
|
||||||
args = ['gnome-open']
|
|
||||||
args.append(url)
|
|
||||||
elif gajim.config.get('openwith') == 'kfmclient exec':
|
elif gajim.config.get('openwith') == 'kfmclient exec':
|
||||||
app = 'kfmclient'
|
command = 'kfmclient exec'
|
||||||
args = ['kfmclient', 'exec']
|
|
||||||
elif gajim.config.get('openwith') == 'custom':
|
elif gajim.config.get('openwith') == 'custom':
|
||||||
if kind == 'url':
|
if kind == 'url':
|
||||||
conf = gajim.config.get('custombrowser')
|
command = gajim.config.get('custombrowser')
|
||||||
if kind == 'mail':
|
if kind == 'mail':
|
||||||
conf = gajim.config.get('custommailapp')
|
command = gajim.config.get('custommailapp')
|
||||||
if conf == '': # if no app is configured
|
if command == '': # if no app is configured
|
||||||
return
|
return
|
||||||
args = conf.split()
|
command = command + ' ' + uri
|
||||||
app = args[0]
|
|
||||||
args.append(url)
|
|
||||||
try:
|
try:
|
||||||
if os.name == 'posix':
|
os.system(command)
|
||||||
os.spawnvp(os.P_NOWAIT, app, args)
|
|
||||||
else:
|
|
||||||
os.spawnv(os.P_NOWAIT, app, args)
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue