expose getHelpDir to Python
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user