#include <PythonScript.h>

Public Slots | |
| bool | compile (bool for_eval=true) |
| Compile the Code. Return true if the implementation doesn't support compilation. | |
| QVariant | eval () |
| Evaluate the Code, returning QVariant() on an error / exception. | |
| bool | exec () |
| Execute the Code, returning false on an error / exception. | |
| void | setContext (QObject *context) |
| Set the context in which the code is to be executed. | |
| bool | setDouble (double val, const char *name) |
| bool | setInt (int val, const char *name) |
| bool | setQObject (QObject *val, const char *name) |
Public Member Functions | |
| PythonScript (PythonScripting *env, const QString &code, QObject *context=0, const QString &name="<input>") | |
| void | write (const QString &text) |
| ~PythonScript () | |
Private Member Functions | |
| void | beginStdoutRedirect () |
| void | endStdoutRedirect () |
| PythonScripting * | env () |
Private Attributes | |
| bool | isFunction |
| PyObject * | localDict |
| PyObject * | PyCode |
| PyObject * | stderrSave |
| PyObject * | stdoutSave |
| PythonScript::PythonScript | ( | PythonScripting * | env, | |
| const QString & | code, | |||
| QObject * | context = 0, |
|||
| const QString & | name = "<input>" | |||
| ) |
References Script::Context, localDict, PyCode, and setQObject().
| void PythonScript::beginStdoutRedirect | ( | ) | [private] |
References env(), PythonScripting::setQObject(), stderrSave, and stdoutSave.
| bool PythonScript::compile | ( | bool | for_eval = true |
) | [virtual, slot] |
Compile the Code. Return true if the implementation doesn't support compilation.
Reimplemented from Script.
References Script::Code, Script::compiled, Script::compileErr, Script::Context, Script::emit_error(), env(), Script::isCompiled, localDict, Script::Name, and PyCode.
| void PythonScript::endStdoutRedirect | ( | ) | [private] |
| PythonScripting* PythonScript::env | ( | ) | [inline, private] |
References Script::Env.
Referenced by beginStdoutRedirect(), compile(), endStdoutRedirect(), eval(), exec(), setDouble(), setInt(), and setQObject().
| QVariant PythonScript::eval | ( | ) | [virtual, slot] |
Evaluate the Code, returning QVariant() on an error / exception.
Reimplemented from Script.
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), Script::isCompiled, isFunction, localDict, Script::notCompiled, and PyCode.
| bool PythonScript::exec | ( | ) | [virtual, slot] |
Execute the Code, returning false on an error / exception.
Reimplemented from Script.
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), Script::isCompiled, isFunction, localDict, Script::notCompiled, and PyCode.
| void PythonScript::setContext | ( | QObject * | context | ) | [virtual, slot] |
Set the context in which the code is to be executed.
Reimplemented from Script.
References Script::Context, Script::setContext(), and setQObject().
| bool PythonScript::setDouble | ( | double | val, | |
| const char * | name | |||
| ) | [virtual, slot] |
Reimplemented from Script.
References Script::compiled, env(), localDict, Script::notCompiled, and PythonScripting::setDouble().
| bool PythonScript::setInt | ( | int | val, | |
| const char * | name | |||
| ) | [virtual, slot] |
Reimplemented from Script.
References Script::compiled, env(), localDict, Script::notCompiled, and PythonScripting::setInt().
| bool PythonScript::setQObject | ( | QObject * | val, | |
| const char * | name | |||
| ) | [slot] |
References Script::compiled, env(), localDict, Script::notCompiled, and PythonScripting::setQObject().
Referenced by PythonScript(), and setContext().
| void PythonScript::write | ( | const QString & | text | ) | [inline] |
References Script::print().
bool PythonScript::isFunction [private] |
PyObject * PythonScript::localDict [private] |
Referenced by compile(), eval(), exec(), PythonScript(), setDouble(), setInt(), setQObject(), and ~PythonScript().
PyObject* PythonScript::PyCode [private] |
Referenced by compile(), eval(), exec(), PythonScript(), and ~PythonScript().
PyObject * PythonScript::stderrSave [private] |
Referenced by beginStdoutRedirect(), and endStdoutRedirect().
PyObject * PythonScript::stdoutSave [private] |
Referenced by beginStdoutRedirect(), and endStdoutRedirect().
1.5.6