Show warning when external commands not found.

This commit is contained in:
Alex Dedul 2007-08-10 20:58:44 +00:00
parent 2a09f50ecb
commit 33718d5e03
1 changed files with 15 additions and 3 deletions

View File

@ -29,7 +29,7 @@
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
import os.path
import os
import xdg.BaseDirectory
PROGRAM_NAME = "Deluge"
@ -157,7 +157,19 @@ def exec_command(executable, *parameters):
command = [executable]
command.extend(parameters)
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):
"""Execute deluge's command like browser.py, update.py and others"""