AvogadroLibs
1.90.0
|
The PythonScript class implements a interface for calling short-lived python utility scripts.
#include <pythonscript.h>
Public Slots | |
void | setDebug (bool d) |
Public Member Functions | |
bool | debug () const |
QString | scriptFilePath () const |
void | setScriptFilePath (const QString &scriptFile) |
bool | hasErrors () const |
void | clearErrors () |
QStringList | errorList () const |
void | setDefaultPythonInterpretor () |
QByteArray | execute (const QStringList &args, const QByteArray &scriptStdin=QByteArray()) |
PythonScript (const QString &scriptFilePath_, QObject *parent_=NULL) | |
PythonScript (QObject *parent_=NULL) | |
Protected Attributes | |
bool | m_debug |
QString | m_pythonInterpreter |
QString | m_scriptFilePath |
QStringList | m_errors |
|
explicit |
Constructors
scriptFilePath_ | Absolute path to python script. |
|
explicit |
Constructors
scriptFilePath_ | Absolute path to python script. |
bool debug | ( | ) | const |
QString scriptFilePath | ( | ) | const |
void setScriptFilePath | ( | const QString & | scriptFile | ) |
Set the path to the input generator script file. This will reset any cached data held by this class.
bool hasErrors | ( | ) | const |
void clearErrors | ( | ) |
Reset the error counter.
QStringList errorList | ( | ) | const |
void setDefaultPythonInterpretor | ( | ) |
Reset the python interpretor path. The following are checked, in order:
QByteArray execute | ( | const QStringList & | args, |
const QByteArray & | scriptStdin = QByteArray() |
||
) |
Start a new process to execute: "<m_pythonInterpreter> <scriptFilePath()> [args ...]", optionally passing scriptStdin to the processes standard input. Returns the standard output of the process when finished.
|
slot |
Enable/disable debugging.