gui: Small refactoring of code to execute a python script.
This commit is contained in:
parent
51aba4b82c
commit
049efb642f
1 changed files with 10 additions and 3 deletions
13
gui/util.tcl
13
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
|
||||
|
|
Loading…
Reference in a new issue