file /usr/bin/axis @line 3379:
if postgui_halfile: res = os.spawnvp(os.P_WAIT, "halcmd", ["halcmd", "-i", vars.emcini.get(), "-f", postgui_halfile])
regardless of the file extension, the POSTGUI_HALFILE is executed using halcmd.
add check for filetype, and for tcl files add:
res = os.spawnvp(os.P_WAIT, "haltcl", ["haltcl", "-i", vars.emcini.get(), postgui_halfile])
Ticket moved from /p/emc/bugs/434/
I will be happy to review any patch to improve this.
It is called "POSTGUI_HALFILE". Not POSTGUI_TCLFILE". It is supposed to be used to execute HAL files. Why are you trying to execute a tcl file using this mechanism?
If there is a real need to execute something other than a HAL file after the GUI starts, then I would suggest adding a "POSTGUI_SCRIPT" feature, instead of modifying the existing POSTGUI_HALFILE to make it do something extremely non-obvious and unexpected.
We have supported Tcl as a command language for startup hal files for a number of releases ([HAL]HALFILE). This was beneficial because we didn't have to write e.g., support for conditionals, loops, and procedures in our own language.
I see no reason not to support using a Tcl file in this location too, if a patch is offered.
I didn't realise that TCL had been used to extend the HAL language. Objection withdrawn.