From 2ef87bfa4046dfbcf6ff90c8a41d2e931ff518f5 Mon Sep 17 00:00:00 2001 From: "tgoff0@gmail.com" Date: Mon, 15 Dec 2014 18:23:04 +0000 Subject: [PATCH] gui: Small refactoring of code to execute a python script. --- trunk/gui/util.tcl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/trunk/gui/util.tcl b/trunk/gui/util.tcl index 7ec8aaf9..88c7cb3b 100644 --- a/trunk/gui/util.tcl +++ b/trunk/gui/util.tcl @@ -980,6 +980,14 @@ proc exportPython { } { } } +proc execPythonFile { filename } { + set flags 0x10 ;# status request flag + sendRegMessage -1 $flags [list "exec" $filename] + addFileToMrulist $filename + + tk_messageBox -type ok -message "Executed Python script '$filename'" +} + # ask the daemon to execute the selected file proc execPython { with_options } { global fileDialogBox_initial g_prefs @@ -999,9 +1007,8 @@ proc execPython { with_options } { set fn [tk_inputBox "Python Script Options" $prompt $fn . 50] if { $fn == "" } { return } } - set flags 0x10 ;# status request flag - sendRegMessage -1 $flags [list "exec" $fn] - addFileToMrulist $fn + + execPythonFile $fn } # open a dialog that prompts the user with a text entry