#include <Libs/Scripting/Python/Core/ctkAbstractPythonManager.h>
|
static QStringList | dir_object (PyObject *object, bool appendParenthesis=false) |
|
static PyObject * | pythonModule (const QString &module) |
| Given a string of the form "<modulename1>[.<modulenameN>...]" containing modules, return the final module as a PyObject*. More...
|
|
static PyObject * | pythonObject (const QString &variableNameAndFunction) |
|
static QStringList | splitByDotOutsideParenthesis (const QString &pythonVariableName) |
|
|
QScopedPointer< ctkAbstractPythonManagerPrivate > | d_ptr |
|
Definition at line 41 of file ctkAbstractPythonManager.h.
◆ Superclass
◆ ExecuteStringMode
◆ ctkAbstractPythonManager()
ctkAbstractPythonManager::ctkAbstractPythonManager |
( |
QObject * |
_parent = NULL | ) |
|
◆ ~ctkAbstractPythonManager()
virtual ctkAbstractPythonManager::~ctkAbstractPythonManager |
( |
| ) |
|
|
virtual |
◆ addObjectToPythonMain()
void ctkAbstractPythonManager::addObjectToPythonMain |
( |
const QString & |
name, |
|
|
QObject * |
obj |
|
) |
| |
◆ addWrapperFactory()
void ctkAbstractPythonManager::addWrapperFactory |
( |
PythonQtForeignWrapperFactory * |
factory | ) |
|
◆ dir_object()
static QStringList ctkAbstractPythonManager::dir_object |
( |
PyObject * |
object, |
|
|
bool |
appendParenthesis = false |
|
) |
| |
|
static |
Given a python object, lookup its attributes and return them in a string list. If the argument appendParenthesis
is set to True, "()" will be appended to attributes being Python callable.
◆ executeFile()
Q_INVOKABLE void ctkAbstractPythonManager::executeFile |
( |
const QString & |
filename | ) |
|
Execute a python script with the given filename.
◆ executeInitializationScripts()
virtual void ctkAbstractPythonManager::executeInitializationScripts |
( |
| ) |
|
|
protectedvirtual |
◆ executeString()
Execute a python of python code (can be multiple lines separated with newline) and return the result as a QVariant.
◆ getVariable()
QVariant ctkAbstractPythonManager::getVariable |
( |
const QString & |
varName | ) |
|
Gets the value of the variable looking in the main module. If the variable is not found returns a default initialized QVariant.
◆ initializationFlags()
int ctkAbstractPythonManager::initializationFlags |
( |
| ) |
const |
◆ initialize()
bool ctkAbstractPythonManager::initialize |
( |
| ) |
|
◆ initPythonQt()
void ctkAbstractPythonManager::initPythonQt |
( |
int |
flags | ) |
|
|
protected |
◆ isPythonInitialized()
bool ctkAbstractPythonManager::isPythonInitialized |
( |
| ) |
const |
◆ mainContext()
PythonQtObjectPtr ctkAbstractPythonManager::mainContext |
( |
| ) |
|
Return a reference to the python main context. Calling this function implicitly call initialize() if it hasn't been done.
◆ preInitialization()
virtual void ctkAbstractPythonManager::preInitialization |
( |
| ) |
|
|
protectedvirtual |
Overload this function to load Decorator and pythonQt wrapper at initialization time.
Reimplemented in ctkSimplePythonManager.
◆ printStderr
void ctkAbstractPythonManager::printStderr |
( |
const QString & |
| ) |
|
|
protectedslot |
◆ printStdout
void ctkAbstractPythonManager::printStdout |
( |
const QString & |
| ) |
|
|
protectedslot |
◆ pythonAttributes()
QStringList ctkAbstractPythonManager::pythonAttributes |
( |
const QString & |
pythonVariableName, |
|
|
const QString & |
module = QLatin1String("__main__") , |
|
|
bool |
appendParenthesis = false |
|
) |
| const |
Given a python variable name, if it can be called, try to call the method or instantiate the class, lookup its attributes and return them in a string list. By default the attributes are looked up from main
. If the argument appendParenthesis
is set to True, "()" will be appended to attributes being Python callable.
◆ pythonErrorOccured()
bool ctkAbstractPythonManager::pythonErrorOccured |
( |
| ) |
const |
Returns True if a python error occured.
- See also
- PythonQt::hadError()
◆ pythonInitialized
void ctkAbstractPythonManager::pythonInitialized |
( |
| ) |
|
|
signal |
This signal is emitted after python is initialized and scripts are executed
- See also
- preInitialization
-
executeScripts
◆ pythonModule()
static PyObject* ctkAbstractPythonManager::pythonModule |
( |
const QString & |
module | ) |
|
|
static |
Given a string of the form "<modulename1>[.<modulenameN>...]" containing modules, return the final module as a PyObject*.
◆ pythonObject()
static PyObject* ctkAbstractPythonManager::pythonObject |
( |
const QString & |
variableNameAndFunction | ) |
|
|
static |
Given a string of the form "<modulename1>[.<modulenameN>...].correspondingObject, return the final object as a PyObject*
- See also
- pythonModule
◆ pythonPaths()
virtual QStringList ctkAbstractPythonManager::pythonPaths |
( |
| ) |
|
|
protectedvirtual |
◆ pythonPreInitialized
void ctkAbstractPythonManager::pythonPreInitialized |
( |
| ) |
|
|
signal |
This signal is emitted after python is pre-initialized. Observers can listen for this signal to handle additional initialization steps.
- See also
- preInitialization
◆ registerClassForPythonQt()
void ctkAbstractPythonManager::registerClassForPythonQt |
( |
const QMetaObject * |
metaobject | ) |
|
◆ registerCPPClassForPythonQt()
void ctkAbstractPythonManager::registerCPPClassForPythonQt |
( |
const char * |
name | ) |
|
◆ registerPythonQtDecorator()
void ctkAbstractPythonManager::registerPythonQtDecorator |
( |
QObject * |
decorator | ) |
|
◆ resetErrorFlag()
void ctkAbstractPythonManager::resetErrorFlag |
( |
| ) |
|
Reset error flag
- See also
- PythonQt::clearError()
◆ setInitializationFlags()
void ctkAbstractPythonManager::setInitializationFlags |
( |
int |
flags | ) |
|
Calling this function after mainContext() has been called at least once is a no-op. If not overridden calling this function, the default initialization flags are PythonQt::IgnoreSiteModule and PythonQt::RedirectStdOut.
- See also
- PythonQt::InitFlags
◆ setInitializationFunction()
void ctkAbstractPythonManager::setInitializationFunction |
( |
void(*)() |
initFunction | ) |
|
◆ setSystemExitExceptionHandlerEnabled()
void ctkAbstractPythonManager::setSystemExitExceptionHandlerEnabled |
( |
bool |
value | ) |
|
- See also
- PythonQt::setSystemExitExceptionHandlerEnabled
◆ splitByDotOutsideParenthesis()
static QStringList ctkAbstractPythonManager::splitByDotOutsideParenthesis |
( |
const QString & |
pythonVariableName | ) |
|
|
static |
Given a python variable name, it returns the string list splited at every dots which will be outside parenthesis (It also takes care about the possibility that quotes can include parenthesis)
◆ systemExitExceptionHandlerEnabled()
bool ctkAbstractPythonManager::systemExitExceptionHandlerEnabled |
( |
| ) |
const |
- See also
- PythonQt::systemExitExceptionHandlerEnabled
◆ systemExitExceptionRaised
void ctkAbstractPythonManager::systemExitExceptionRaised |
( |
int |
exitCode | ) |
|
|
signal |
◆ d_ptr
QScopedPointer<ctkAbstractPythonManagerPrivate> ctkAbstractPythonManager::d_ptr |
|
protected |
The documentation for this class was generated from the following file: