37 QgsDebugError( QStringLiteral(
"Unable to run Python command: runner not available!" ) );
51 QgsDebugError( QStringLiteral(
"Unable to run Python command: runner not available!" ) );
64 QgsDebugError( QStringLiteral(
"Unable to run Python command: runner not available!" ) );
77 QgsDebugError( QStringLiteral(
"Unable to run Python command: runner not available!" ) );
Utility class for running Python commands from various parts of QGIS.
static bool setArgv(const QStringList &arguments, const QString &messageOnError=QString())
Set sys.argv.
static bool run(const QString &command, const QString &messageOnError=QString())
Execute a Python statement.
virtual bool evalCommand(QString command, QString &result)=0
Evaluates the given expression, producing a result.
virtual bool runFileCommand(const QString &filename, const QString &messageOnError=QString())=0
Runs the code from the given file.
static void setInstance(QgsPythonRunner *runner)
Assign an instance of Python runner so that run() can be used.
static bool eval(const QString &command, QString &result)
Eval a Python statement.
virtual bool runCommand(QString command, QString messageOnError=QString())=0
Runs the given statement.
virtual bool setArgvCommand(const QStringList &arguments, const QString &messageOnError=QString())=0
Sets sys.argv to the given arguments.
static QgsPythonRunner * sInstance
static bool runFile(const QString &filename, const QString &messageOnError=QString())
Execute a Python filename, showing an error message if one occurred.
static bool isValid()
Returns true if the runner has an instance (and thus is able to run commands)
#define QgsDebugMsgLevel(str, level)
#define QgsDebugError(str)