2017-05-22 09:01:45 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgspythonrunner.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
class QgsPythonRunner
|
|
|
|
{
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Utility class for running Python commands from various parts of QGIS.
|
|
|
|
There is no direct Python support in the core library, so it is expected
|
|
|
|
that application with Python support creates a subclass that implements
|
|
|
|
pure virtual function(s) during the initialization. The static methods
|
|
|
|
will then work as expected.
|
|
|
|
|
|
|
|
Added in QGIS v?
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-22 09:01:45 +02:00
|
|
|
#include "qgspythonrunner.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
static bool isValid();
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Returns true if the runner has an instance
|
|
|
|
(and thus is able to run commands) *
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static bool run( const QString &command, const QString &messageOnError = QString() );
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Execute a Python statement
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static bool eval( const QString &command, QString &result /Out/ );
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Eval a Python statement
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2013-03-31 07:36:57 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static void setInstance( QgsPythonRunner *runner /Transfer/ );
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Assign an instance of Python runner so that run() can be used.
|
|
|
|
This method should be called during app initialization.
|
|
|
|
Takes ownership of the object, deletes previous instance. *
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
QgsPythonRunner();
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
Protected constructor: can be instantiated only from children
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual ~QgsPythonRunner();
|
|
|
|
|
2015-11-05 21:23:04 +11:00
|
|
|
virtual bool runCommand( QString command, QString messageOnError = QString() ) = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2013-03-31 07:36:57 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool evalCommand( QString command, QString &result ) = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
2017-05-22 09:01:45 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgspythonrunner.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|