#include <SALOME_PYQT_PyInterp.h>

Public Member Functions | |
| SALOME_PYQT_PyInterp () | |
| ~SALOME_PYQT_PyInterp () | |
| int | run (const char *command) |
| void | initialize () |
| Initialize embedded interpreter. | |
| PyLockWrapper | GetLockWrapper () |
| Get Python GIL wrapper. | |
| std::string | getbanner () |
| Get embedded Python interpreter banner. | |
| void | setverrcb (PyOutChanged *, void *) |
| Set Python standard error device hook. | |
| void | setvoutcb (PyOutChanged *, void *) |
| Set Python standard output device hook. | |
| const char * | getPrevious () |
| Get previous command in the commands history. | |
| const char * | getNext () |
| Get next command in the commands history. | |
Static Public Attributes | |
| static int | _argc = 1 |
| static char * | _argv [] = {(char*)""} |
| static PyObject * | builtinmodule = NULL |
| static PyThreadState * | _gtstate = NULL |
| static PyInterpreterState * | _interp = NULL |
Protected Member Functions | |
| virtual void | initPython () |
| virtual bool | initState () |
| virtual bool | initContext () |
| virtual int | beforeRun () |
| int | simpleRun (const char *command, const bool addToHistory=true) |
| Run Python command (used internally). | |
| virtual bool | initRun () |
| Initialize run command. | |
Protected Attributes | |
| PyThreadState * | _tstate |
| PyObject * | _vout |
| PyObject * | _verr |
| PyObject * | _g |
| PyObject * | _codeop |
| std::list< std::string > | _history |
| std::list< std::string >::iterator | _ith |
| SALOME_PYQT_PyInterp::SALOME_PYQT_PyInterp | ( | ) |
constructor : the main SALOME Python interpreter is used for PyQt GUI. calls initialize method defined in base class, which calls virtual methods initstate & initcontext redefined here
| SALOME_PYQT_PyInterp::~SALOME_PYQT_PyInterp | ( | ) |
| int SALOME_PYQT_PyInterp::run | ( | const char * | command | ) | [virtual] |
Reimplemented from PyInterp_Interp.
References PyInterp_Interp._g.
| void SALOME_PYQT_PyInterp::initPython | ( | ) | [protected, virtual] |
Reimplemented from PyInterp_Interp.
References PyInterp_Interp._gtstate, SUIT_PYTHON._gtstate, PyInterp_Interp._tstate, and SUIT_PYTHON.initialized.
| bool SALOME_PYQT_PyInterp::initState | ( | ) | [protected, virtual] |
Implements PyInterp_Interp.
References PyInterp_Interp._tstate.
| bool SALOME_PYQT_PyInterp::initContext | ( | ) | [protected, virtual] |
Implements PyInterp_Interp.
References PyInterp_Interp._g.
| void PyInterp_Interp::initialize | ( | ) | [inherited] |
This method shoud be called after construction of the interpreter. The method initialize() calls virtuals methods
References PyInterp_Interp._history, PyInterp_Interp._ith, PyInterp_Interp._tstate, PyInterp_Interp._verr, PyInterp_Interp._vout, PyInterp_Interp.initContext(), PyInterp_Interp.initPython(), PyInterp_Interp.initRun(), PyInterp_Interp.initState(), and newPyStdOut().
| PyLockWrapper PyInterp_Interp::GetLockWrapper | ( | ) | [inherited] |
References PyInterp_Interp._interp, PyInterp_Interp._tstate, and currentThreadMap.
| std::string PyInterp_Interp::getbanner | ( | ) | [inherited] |
| void PyInterp_Interp::setverrcb | ( | PyOutChanged * | cb, |
| void * | data | ||
| ) | [inherited] |
| cb | callback function |
| data | callback function parameters |
References PyInterp_Interp._verr.
| void PyInterp_Interp::setvoutcb | ( | PyOutChanged * | cb, |
| void * | data | ||
| ) | [inherited] |
| cb | callback function |
| data | callback function parameters |
References PyInterp_Interp._vout.
| const char * PyInterp_Interp::getPrevious | ( | ) | [inherited] |
References PyInterp_Interp._history, PyInterp_Interp._ith, and BEGIN_HISTORY_PY.
| const char * PyInterp_Interp::getNext | ( | ) | [inherited] |
References PyInterp_Interp._history, PyInterp_Interp._ith, and TOP_HISTORY_PY.
| virtual int PyInterp_Interp.beforeRun | ( | ) | [protected, virtual, inherited] |
Reimplemented in SalomeApp_PyInterp.
| int PyInterp_Interp::simpleRun | ( | const char * | command, |
| const bool | addToHistory = true |
||
| ) | [protected, inherited] |
| command | Python command |
| addToHistory | if true (default), the command is added to the commands history |
References PyInterp_Interp._g, PyInterp_Interp._history, PyInterp_Interp._ith, PyInterp_Interp._verr, PyInterp_Interp._vout, and compile_command().
| bool PyInterp_Interp::initRun | ( | ) | [protected, virtual, inherited] |
This method is used to prepare interpreter for running Python commands.
true on success and false on error int PyInterp_Interp::_argc = 1 [static, inherited] |
char * PyInterp_Interp::_argv = {(char*)""} [static, inherited] |
PyObject * PyInterp_Interp::builtinmodule = NULL [static, inherited] |
PyThreadState * PyInterp_Interp::_gtstate = NULL [static, inherited] |
PyInterpreterState * PyInterp_Interp::_interp = NULL [static, inherited] |
PyThreadState* PyInterp_Interp._tstate [protected, inherited] |
PyObject* PyInterp_Interp._vout [protected, inherited] |
PyObject* PyInterp_Interp._verr [protected, inherited] |
PyObject* PyInterp_Interp._g [protected, inherited] |
PyObject* PyInterp_Interp._codeop [protected, inherited] |
std::list<std::string> PyInterp_Interp._history [protected, inherited] |
std::list<std::string>::iterator PyInterp_Interp._ith [protected, inherited] |