diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-23 23:15:39 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-23 23:38:57 +0100 |
commit | 00cb710fbc872cffa2d4d5c54c5ea65ba993da0c (patch) | |
tree | f13dda8ae5bfbe56f3fb73c90bcb62bf450a1c90 /source4 | |
parent | dc08079d814cd1375a3d93530bc2fa0e336210d8 (diff) | |
download | samba-00cb710fbc872cffa2d4d5c54c5ea65ba993da0c.tar.gz samba-00cb710fbc872cffa2d4d5c54c5ea65ba993da0c.tar.bz2 samba-00cb710fbc872cffa2d4d5c54c5ea65ba993da0c.zip |
Add bindings for lp_load_default().
(This used to be commit ffd793bbde636366855462f980f1f7d0e25afaab)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/param/param.i | 1 | ||||
-rw-r--r-- | source4/param/param.py | 1 | ||||
-rw-r--r-- | source4/param/param_wrap.c | 30 | ||||
-rw-r--r-- | source4/param/tests/bindings.py | 3 |
4 files changed, 35 insertions, 0 deletions
diff --git a/source4/param/param.i b/source4/param/param.i index eeecb0e5b9..7322302117 100644 --- a/source4/param/param.i +++ b/source4/param/param.i @@ -50,6 +50,7 @@ typedef struct loadparm_context { %extend { loadparm_context(TALLOC_CTX *mem_ctx) { return loadparm_init(mem_ctx); } bool load(const char *filename) { return lp_load($self, filename); } + bool load_default() { return lp_load_default($self); } #ifdef SWIGPYTHON int __len__() { return lp_numservices($self); } struct loadparm_service *__getitem__(const char *name) { return lp_service($self, name); } diff --git a/source4/param/param.py b/source4/param/param.py index 66b51e5d3b..5adf7a4ecc 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -64,6 +64,7 @@ class LoadParm(object): _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs)) __swig_destroy__ = _param.delete_LoadParm LoadParm.load = new_instancemethod(_param.LoadParm_load,None,LoadParm) +LoadParm.load_default = new_instancemethod(_param.LoadParm_load_default,None,LoadParm) LoadParm.__len__ = new_instancemethod(_param.LoadParm___len__,None,LoadParm) LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadParm) LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm) diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c index d8be725c5e..275e2d67ec 100644 --- a/source4/param/param_wrap.c +++ b/source4/param/param_wrap.c @@ -2602,6 +2602,7 @@ SWIGINTERNINLINE PyObject* return PyBool_FromLong(value ? 1 : 0); } +SWIGINTERN bool loadparm_context_load_default(loadparm_context *self){ return lp_load_default(self); } SWIGINTERN int loadparm_context___len__(loadparm_context *self){ return lp_numservices(self); } #define SWIG_From_long PyInt_FromLong @@ -2840,6 +2841,34 @@ fail: } +SWIGINTERN PyObject *_wrap_LoadParm_load_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + loadparm_context *arg1 = (loadparm_context *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "self", NULL + }; + + arg1 = loadparm_init(NULL); + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:LoadParm_load_default",kwnames,&obj0)) SWIG_fail; + if (obj0) { + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_loadparm_context, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LoadParm_load_default" "', argument " "1"" of type '" "loadparm_context *""'"); + } + arg1 = (loadparm_context *)(argp1); + } + result = (bool)loadparm_context_load_default(arg1); + resultobj = SWIG_From_bool((bool)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_LoadParm___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; loadparm_context *arg1 = (loadparm_context *) 0 ; @@ -4050,6 +4079,7 @@ SWIGINTERN PyObject *Swig_var_default_config_get(void) { static PyMethodDef SwigMethods[] = { { (char *)"new_LoadParm", (PyCFunction)_wrap_new_LoadParm, METH_NOARGS, NULL}, { (char *)"LoadParm_load", (PyCFunction) _wrap_LoadParm_load, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"LoadParm_load_default", (PyCFunction) _wrap_LoadParm_load_default, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm___len__", (PyCFunction) _wrap_LoadParm___len__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm___getitem__", (PyCFunction) _wrap_LoadParm___getitem__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm_configfile", (PyCFunction) _wrap_LoadParm_configfile, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/source4/param/tests/bindings.py b/source4/param/tests/bindings.py index 9ea1c00daf..0dd186b9df 100644 --- a/source4/param/tests/bindings.py +++ b/source4/param/tests/bindings.py @@ -46,6 +46,9 @@ class LoadParmTestCase(unittest.TestCase): self.assertTrue(file.is_myname("BLA")) self.assertFalse(file.is_myname("FOOBAR")) + def test_load_default(self): + file = param.LoadParm() + file.load_default() class ParamTestCase(unittest.TestCase): def test_init(self): |