expose getHelpDir to Python

This commit is contained in:
wmayer
2018-02-10 16:29:57 +01:00
parent 73522c3d10
commit fa4058c84e
2 changed files with 12 additions and 0 deletions

View File

@@ -87,6 +87,8 @@ PyMethodDef Application::Methods[] = {
"Get the root directory of user settings"},
{"getUserMacroDir", (PyCFunction) Application::sGetUserMacroDir ,1,
"Get the directory of the user's macro directory"},
{"getHelpDir", (PyCFunction) Application::sGetHelpDir ,1,
"Get the directory of the documentation"},
{"getHomePath", (PyCFunction) Application::sGetHomePath ,1,
"Get the home path, i.e. the parent directory of the executable"},
@@ -593,6 +595,15 @@ PyObject* Application::sGetUserMacroDir(PyObject * /*self*/, PyObject *args,PyOb
return Py::new_reference_to(user_macro_dir);
}
PyObject* Application::sGetHelpDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
Py::String user_macro_dir(Application::getHelpDir(),"utf-8");
return Py::new_reference_to(user_macro_dir);
}
PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C