Menu

#140 axis does not accept '.tcl' file for [HAL]POSTGUI_HALFILE

None
open
nobody
5
2015-09-03
2015-09-03
Florian
No

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.

solution:

add check for filetype, and for tcl files add:
res = os.spawnvp(os.P_WAIT, "haltcl", ["haltcl", "-i", vars.emcini.get(), postgui_halfile])

Discussion

  • Jeff Epler

    Jeff Epler - 2015-09-03

    Ticket moved from /p/emc/bugs/434/

     
  • Jeff Epler

    Jeff Epler - 2015-09-03

    I will be happy to review any patch to improve this.

     
  • Jeff Epler

    Jeff Epler - 2015-09-03
    • Group: 2.7 -->
     
  • John Kasunich

    John Kasunich - 2015-09-03

    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.

     
  • Jeff Epler

    Jeff Epler - 2015-09-03

    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.

     
  • John Kasunich

    John Kasunich - 2015-09-03

    I didn't realise that TCL had been used to extend the HAL language. Objection withdrawn.