1
// 2008 © Václav Šmilauer <eudoxos@arcig.cz>
3
#include<yade/core/GlobalEngine.hpp>
4
#include<yade/core/Scene.hpp>
5
#include<yade/pkg/common/PeriodicEngines.hpp>
6
#include<yade/lib/pyutil/gil.hpp>
8
class PyRunner: public PeriodicEngine {
10
/* virtual bool isActivated: not overridden, PeriodicEngine handles that */
11
virtual void action(){ if(command.size()>0) pyRunString(command); }
12
YADE_CLASS_BASE_DOC_ATTRS(PyRunner,PeriodicEngine,
13
"Execute a python command periodically, with defined (and adjustable) periodicity. See :yref:`PeriodicEngine` documentation for details.",
14
((string,command,"",,"Command to be run by python interpreter. Not run if empty."))
17
REGISTER_SERIALIZABLE(PyRunner);