Class containing all the stuff to use python. More...
#include <pyInt.h>
Public Member Functions | |
pyInt () | |
Constructor. | |
~pyInt () | |
Destructor. | |
int | init (coeur *) |
Init the interface. | |
int | update () |
Updating(should be call on each loop). | |
int | close () |
Close the base. | |
bool | OnEvent (const SEvent &) |
Called when an event occured. | |
stringw | eval (stringw) |
Run a python command. | |
int | exec (stringw) |
Run a python script. | |
int | addPyEnv (stringc, object) |
Add a variable to python envirronement. | |
Private Attributes | |
object | dict |
Dictionnary for python wrapper. | |
object | main_module |
Main module for python wrapper. |
Class containing all the stuff to use python.
It will create the python embedded system and make it accesible for other class in order to launch instruction, script and to get the output
Definition at line 27 of file pyInt.h.
pyInt::pyInt | ( | ) |
int pyInt::addPyEnv | ( | stringc | s, | |
object | o | |||
) |
Add a variable to python envirronement.
This method add a variable to the python envirronement
s | Name of the variable | |
o | The object to put in the variable |
Definition at line 138 of file pyInt.cpp.
References main_module.
Referenced by init(), and console::init().
int pyInt::close | ( | ) | [virtual] |
Close the base.
Quit python and call base::close()
Reimplemented from base.
Definition at line 79 of file pyInt.cpp.
Referenced by coeur::close().
stringw pyInt::eval | ( | stringw | str | ) |
Run a python command.
This method run a python command
str | command to run |
Definition at line 97 of file pyInt.cpp.
References dict, exec(), and base::log().
Referenced by console::OnEvent().
int pyInt::exec | ( | stringw | str | ) |
Run a python script.
This method run a python script
str | script to run |
Definition at line 119 of file pyInt.cpp.
References dict, and base::log().
Referenced by console::close(), eval(), init(), and console::init().
int pyInt::init | ( | coeur * | c | ) |
Init the interface.
Call base::init() and initialize python
c | Pointer to the core |
Definition at line 50 of file pyInt.cpp.
References addPyEnv(), dict, exec(), initpyIrr(), initpyMerry(), and main_module.
Referenced by coeur::init().
bool pyInt::OnEvent | ( | const SEvent & | event | ) |
int pyInt::update | ( | ) | [virtual] |
object pyInt::dict [private] |
object pyInt::main_module [private] |
Main module for python wrapper.
Definition at line 61 of file pyInt.h.
Referenced by addPyEnv(), and init().