The PythonScript class implements a interface for calling short-lived python utility scripts.
#include <pythonscript.h>
|
bool | m_debug |
|
QString | m_pythonInterpreter |
|
QString | m_scriptFilePath |
|
QStringList | m_errors |
|
QProcess * | m_process |
|
◆ PythonScript() [1/2]
PythonScript |
( |
const QString & |
scriptFilePath_, |
|
|
QObject * |
parent_ = nullptr |
|
) |
| |
|
explicit |
Constructors
- Parameters
-
scriptFilePath_ | Absolute path to python script. |
◆ PythonScript() [2/2]
Constructors
- Parameters
-
scriptFilePath_ | Absolute path to python script. |
◆ debug()
- Returns
- True if debugging of python I/O is enabled.
◆ scriptFilePath()
QString scriptFilePath |
( |
| ) |
const |
- Returns
- The path to the generator file.
◆ setScriptFilePath()
void setScriptFilePath |
( |
const QString & |
scriptFile | ) |
|
Set the path to the input generator script file. This will reset any cached data held by this class.
◆ hasErrors()
- Returns
- True if an error is set.
◆ clearErrors()
◆ errorList()
QStringList errorList |
( |
| ) |
const |
- Returns
- A QStringList containing all errors that occurred in the last call to the input generator script.
◆ setDefaultPythonInterpretor()
void setDefaultPythonInterpretor |
( |
| ) |
|
Reset the python interpretor path. The following are checked, in order:
- The AVO_PYTHON_INTERPRETER environment variable
- The "interpreters/python" QSettings value
- The path specified in avogadropython.h.
◆ execute()
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.
◆ asyncExecute()
void asyncExecute |
( |
const QStringList & |
args, |
|
|
const QByteArray & |
scriptStdin = QByteArray() |
|
) |
| |
Start a new process to execute asynchronously "<m_pythonInterpreter> <scriptFilePath()> [args ...]", optionally passing scriptStdin to the processes standard input.
Will send asyncFinished() signal when finished
◆ asyncResponse()
QByteArray asyncResponse |
( |
| ) |
|
Returns the standard output of the asynchronous process when finished.
◆ finished
The asynchronous execution is finished or timed out
◆ setDebug
Enable/disable debugging.
◆ processFinished
void processFinished |
( |
int |
exitCode, |
|
|
QProcess::ExitStatus |
exitStatus |
|
) |
| |
|
slot |
Handle a finished process;
The documentation for this class was generated from the following file: