Show warning when external commands not found.
This commit is contained in:
parent
2a09f50ecb
commit
33718d5e03
|
@ -29,7 +29,7 @@
|
||||||
# this exception statement from your version. If you delete this exception
|
# this exception statement from your version. If you delete this exception
|
||||||
# statement from all source files in the program, then also delete it here.
|
# statement from all source files in the program, then also delete it here.
|
||||||
|
|
||||||
import os.path
|
import os
|
||||||
import xdg.BaseDirectory
|
import xdg.BaseDirectory
|
||||||
|
|
||||||
PROGRAM_NAME = "Deluge"
|
PROGRAM_NAME = "Deluge"
|
||||||
|
@ -157,7 +157,19 @@ def exec_command(executable, *parameters):
|
||||||
|
|
||||||
command = [executable]
|
command = [executable]
|
||||||
command.extend(parameters)
|
command.extend(parameters)
|
||||||
Popen(command)
|
try:
|
||||||
|
Popen(command)
|
||||||
|
except OSError:
|
||||||
|
import gtk
|
||||||
|
|
||||||
|
warning = gtk.MessageDialog(parent = None,
|
||||||
|
flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
buttons= gtk.BUTTONS_OK,
|
||||||
|
message_format='%s %s %s' % (_("External command"),
|
||||||
|
executable, _("not found")),
|
||||||
|
type = gtk.MESSAGE_WARNING)
|
||||||
|
warning.run()
|
||||||
|
warning.destroy()
|
||||||
|
|
||||||
def exec_deluge_command(script, *parameters):
|
def exec_deluge_command(script, *parameters):
|
||||||
"""Execute deluge's command like browser.py, update.py and others"""
|
"""Execute deluge's command like browser.py, update.py and others"""
|
||||||
|
|
Loading…
Reference in New Issue