As some others have suggested, it might be better to give Python all of
halcmd. We've already got this for another language, tcl, and without
(much) code duplication.
Have a look at hal/utils/halsh.c for how this is done in tcl. For
Python it would be similar: implementations of
halcmd_{error,warning,info} which gather up the output to return as a
Python string, a function which takes a series of arguments and converts
them to an array of strings to pass to halcmd_parse_cmd, and some
functions to create and tear down the halcmd environment.
There are some potential gotchas here. First, you can't use it at the
same time as the regular 'hal' module (and that means you can't use it
in axis or pyvcp). In 2.4 this is just forbidden (because multiple hal
components in one process led to crashing errors). In master even
though multiple hal components are now permitted, hal_systemv_nowait()
needs to exit all components before forking. (I don't understand *why*
that's needed, and it may be that we could remove this requirement as
well...)
Jeff
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers