gui: Small refactoring of code to execute a python script.

This commit is contained in:
tgoff0 2014-12-15 18:23:04 +00:00
parent 51aba4b82c
commit 049efb642f

View file

@ -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 # ask the daemon to execute the selected file
proc execPython { with_options } { proc execPython { with_options } {
global fileDialogBox_initial g_prefs global fileDialogBox_initial g_prefs
@ -999,9 +1007,8 @@ proc execPython { with_options } {
set fn [tk_inputBox "Python Script Options" $prompt $fn . 50] set fn [tk_inputBox "Python Script Options" $prompt $fn . 50]
if { $fn == "" } { return } if { $fn == "" } { return }
} }
set flags 0x10 ;# status request flag
sendRegMessage -1 $flags [list "exec" $fn] execPythonFile $fn
addFileToMrulist $fn
} }
# open a dialog that prompts the user with a text entry # open a dialog that prompts the user with a text entry