From: David Mulder Date: Tue, 16 Oct 2018 09:23:34 +0000 (-0600) Subject: Add python binding for DATADIR build path X-Git-Tag: ldb-2.2.0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e32f4602ed3827530fd63bf31693fb12ede013b9;p=thirdparty%2Fsamba.git Add python binding for DATADIR build path Signed-off-by: David Mulder Reviewed-by: Alexander Bokovoy --- diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 5e5e1d370cd..4023fac4dd6 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -614,6 +614,11 @@ PyTypeObject PyLoadparmService = { .tp_flags = Py_TPFLAGS_DEFAULT, }; +static PyObject *py_data_dir(PyObject *self) +{ + return PyUnicode_FromString(dyn_DATADIR); +} + static PyObject *py_default_path(PyObject *self, PyObject *Py_UNUSED(ignored)) { return PyUnicode_FromString(lp_default_path()); @@ -640,6 +645,8 @@ static PyObject *py_sbin_dir(PyObject *self, PyObject *Py_UNUSED(ignored)) } static PyMethodDef pyparam_methods[] = { + { "data_dir", (PyCFunction)py_data_dir, METH_NOARGS, + "Returns the compiled in location of data directory." }, { "default_path", (PyCFunction)py_default_path, METH_NOARGS, "Returns the default smb.conf path." }, { "setup_dir", (PyCFunction)py_setup_dir, METH_NOARGS,