Python script execution tool. (See Aqua::CalcServer::Python for details)
More...
#include <AuxiliarMethods.h>
#include <InputOutput/Logger.h>
#include <CalcServer/Python.h>
#include <numpy/npy_no_deprecated_api.h>
#include <numpy/ndarraytypes.h>
#include <numpy/ufuncobject.h>
#include <numpy/npy_3kcompat.h>
|
#define | PY_ARRAY_UNIQUE_SYMBOL AQUA_ARRAY_API |
| Define the extension module which this Python stuff should be linked to.
|
|
|
static PyObject * | get (PyObject *self, PyObject *args, PyObject *keywds) |
| Get a variable by its name.
|
|
static PyObject * | set (PyObject *self, PyObject *args, PyObject *keywds) |
| Set a variable by its name.
|
|
static PyObject * | logMsg (PyObject *self, PyObject *args, PyObject *keywds) |
| Log a message from the Python.
|
|
PyMODINIT_FUNC | PyInit_aquagpusph (void) |
| Module initialization.
|
|
Python script execution tool. (See Aqua::CalcServer::Python for details)
◆ PY_ARRAY_UNIQUE_SYMBOL
#define PY_ARRAY_UNIQUE_SYMBOL AQUA_ARRAY_API |
◆ get()
static PyObject * get |
( |
PyObject * |
self, |
|
|
PyObject * |
args, |
|
|
PyObject * |
keywds |
|
) |
| |
|
static |
Get a variable by its name.
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ logMsg()
static PyObject * logMsg |
( |
PyObject * |
self, |
|
|
PyObject * |
args, |
|
|
PyObject * |
keywds |
|
) |
| |
|
static |
Log a message from the Python.
In AQUAgpusph the Python stdout and stderr are redirected to this function, such that:
- stdout messages will be logged with level 0
- stderr messages will be logged with level 3
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ PyInit_aquagpusph()
PyMODINIT_FUNC PyInit_aquagpusph |
( |
void |
| ) |
|
◆ set()
static PyObject * set |
( |
PyObject * |
self, |
|
|
PyObject * |
args, |
|
|
PyObject * |
keywds |
|
) |
| |
|
static |
Set a variable by its name.
- Parameters
-
self | Module. |
args | Positional arguments. |
keywds | Keyword arguments. |
- Returns
- Computed value, NULL if errors have been detected.
◆ _stderr_redirect
const char* _stderr_redirect |
Initial value:= " \n\
class stderrWriter(object): \n\
def write(self, data): \n\
aquagpusph.log(0, data) \n\
def flush(self): \n\
pass \n\
\n"
stderr Python redirector.
- See also
- logMsg
◆ _stdout_redirect
const char* _stdout_redirect |
Initial value:= " \n\
class stdoutWriter(object): \n\
def write(self, data): \n\
aquagpusph.log(0, data) \n\
def flush(self): \n\
pass \n\
\n"
stdout Python redirector.
- See also
- logMsg
◆ methods
Initial value:= {
{
"get", (PyCFunction)
get, METH_VARARGS | METH_KEYWORDS,
"Get a variable" },
{
"set", (PyCFunction)
set, METH_VARARGS | METH_KEYWORDS,
"Set a variable" },
{ "log",
METH_VARARGS | METH_KEYWORDS,
"Log a message" },
{ NULL, NULL, 0, NULL }
}
static PyObject * get(PyObject *self, PyObject *args, PyObject *keywds)
Get a variable by its name.
Definition: Python.cpp:71
static PyObject * logMsg(PyObject *self, PyObject *args, PyObject *keywds)
Log a message from the Python.
Definition: Python.cpp:159
static PyObject * set(PyObject *self, PyObject *args, PyObject *keywds)
Set a variable by its name.
Definition: Python.cpp:106
List of methods declared in the module.