The NumPy module might not be available on the host system. In that
situation the PYINPUT_BASIC unit test would fail with a segmentation
violation. Guard against this problem by catching ImportError and
checking if the result deck has 'DX' instead of blindly asserting
that 'DX' exists.
In particular Python::exec() now returns 'false' instead of throwing
an exception if we don't have 'EMBEDDED_PYTHON'. Similarly for the
Python::Python constructor when called with an 'Enable::ON' argument.
The run() function invoked by PYACTION has got a new fifth argument which is a
callable the script should utilize to apply the keywords from an ACTIONX
keyword. The callable is implemented as C++ lambda which will run the
Schedule::iterateScheduleSection() method and make sure an updated
SimulatorUpdate variable can be passed back to the simulator.
With this commit the PYACTION keyword is changed, instead of embedding the
Python code directly in the .DATA file the keyword now points to an external
file which is loaded verbatim into the PyAction keyword.
In addition the PYACTION keyword has now got a name and a string indicating how
many times it should run.
test EmbeddedPython: now with actual python code.
parser.cpp: parsing python code.
introduced RawConst::pyinput.
EmbeddedPython: tests with data keyword.