#include <Python.h>
#include "includes.h"
-#include "param/param.h"
#include "version.h"
-#include "libcli/util/pyerrors.h"
#include "param/pyparam.h"
#include "lib/socket/netif.h"
-#include "lib/socket/netif_proto.h"
-#include "lib/talloc/pytalloc.h"
static PyObject *py_generate_random_str(PyObject *self, PyObject *args)
{
return NULL;
tmp_ctx = talloc_new(NULL);
+ if (tmp_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
string = nt_time_string(tmp_ctx, nt);
ret = PyString_FromString(string);
Py_RETURN_NONE;
}
+static PyObject *py_get_debug_level(PyObject *self)
+{
+ return PyInt_FromLong(DEBUGLEVEL);
+}
+
/*
return the list of interface IPs we have configured
takes an loadparm context, returns a list of IPs in string form
"nttime2string(nttime) -> string" },
{ "set_debug_level", (PyCFunction)py_set_debug_level, METH_VARARGS,
"set debug level" },
+ { "get_debug_level", (PyCFunction)py_get_debug_level, METH_NOARGS,
+ "get debug level" },
{ "interface_ips", (PyCFunction)py_interface_ips, METH_VARARGS,
"get interface IP address list"},
{ NULL }