]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Add python binding for DATADIR build path
authorDavid Mulder <dmulder@suse.com>
Tue, 16 Oct 2018 09:23:34 +0000 (03:23 -0600)
committerDavid Mulder <dmulder@samba.org>
Tue, 23 Jun 2020 16:32:30 +0000 (16:32 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/param/pyparam.c

index 5e5e1d370cd7d7cec123223f6a41533367892792..4023fac4dd649abc405f28b6a89467ba6f2c21c2 100644 (file)
@@ -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,