Exposed doCommand (Gui version) to python - fixes #1564
This commit is contained in:
parent
6dd35078a2
commit
81e983b6ac
|
@ -234,6 +234,7 @@ public:
|
||||||
PYFUNCDEF_S(sGetDocument);
|
PYFUNCDEF_S(sGetDocument);
|
||||||
|
|
||||||
PYFUNCDEF_S(sDoCommand);
|
PYFUNCDEF_S(sDoCommand);
|
||||||
|
PYFUNCDEF_S(sDoCommandGui);
|
||||||
PYFUNCDEF_S(sAddModule);
|
PYFUNCDEF_S(sAddModule);
|
||||||
|
|
||||||
static PyMethodDef Methods[];
|
static PyMethodDef Methods[];
|
||||||
|
|
|
@ -136,6 +136,9 @@ PyMethodDef Application::Methods[] = {
|
||||||
{"doCommand", (PyCFunction) Application::sDoCommand, 1,
|
{"doCommand", (PyCFunction) Application::sDoCommand, 1,
|
||||||
"doCommand(string) -> None\n\n"
|
"doCommand(string) -> None\n\n"
|
||||||
"Prints the given string in the python console and runs it"},
|
"Prints the given string in the python console and runs it"},
|
||||||
|
{"doCommandGui", (PyCFunction) Application::sDoCommandGui, 1,
|
||||||
|
"doCommandGui(string) -> None\n\n"
|
||||||
|
"Prints the given string in the python console and runs it but doesn't record it in macros"},
|
||||||
{"addModule", (PyCFunction) Application::sAddModule, 1,
|
{"addModule", (PyCFunction) Application::sAddModule, 1,
|
||||||
"addModule(string) -> None\n\n"
|
"addModule(string) -> None\n\n"
|
||||||
"Prints the given module import only once in the macro recording"},
|
"Prints the given module import only once in the macro recording"},
|
||||||
|
@ -845,6 +848,15 @@ PyObject* Application::sDoCommand(PyObject * /*self*/, PyObject *args,PyObject *
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||||
|
{
|
||||||
|
char *pstr=0;
|
||||||
|
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
|
||||||
|
return NULL; // NULL triggers exception
|
||||||
|
Command::doCommand(Command::Gui,pstr);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||||
{
|
{
|
||||||
char *pstr=0;
|
char *pstr=0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user