r26456: Provide default config object, fix typo.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 14 Dec 2007 13:28:21 +0000 (14:28 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:50:24 +0000 (05:50 +0100)
source/param/param.i
source/param/param.py
source/param/param_wrap.c
source/param/tests/bindings.py

index 674c1671e0f230bc7cb4462c657e5aea33328a2f..d013fa7ae54cbac9caf27c95afd91ca934c0e289 100644 (file)
@@ -106,4 +106,4 @@ typedef struct param_section {
 } param_section;
 
 %rename(default_config) global_loadparm;
-//struct loadparm_context *global_loadparm ;
+struct loadparm_context *global_loadparm;
index 9c0bac9c07f5419416d6d9450e31ae6fd8f99d38..aa01d6e830a402f0df8cc1293620022fd5613a45 100644 (file)
@@ -120,4 +120,5 @@ param_section_swigregister = _param.param_section_swigregister
 param_section_swigregister(param_section)
 
 
+cvar = _param.cvar
 
index ac4a752c7fe02d5e26867e784cdfa6400ead1c1d..7f0b8c865b6419873b93af975416fa6447c0735a 100644 (file)
@@ -3408,6 +3408,29 @@ SWIGINTERN PyObject *param_section_swiginit(PyObject *SWIGUNUSEDPARM(self), PyOb
   return SWIG_Python_InitShadowInstance(args);
 }
 
+SWIGINTERN int Swig_var_default_config_set(PyObject *_val) {
+  {
+    void *argp = 0;
+    int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_loadparm_context,  0 );  
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""global_loadparm""' of type '""struct loadparm_context *""'");
+    }
+    global_loadparm = (struct loadparm_context *)(argp);
+  }
+  return 0;
+fail:
+  return 1;
+}
+
+
+SWIGINTERN PyObject *Swig_var_default_config_get(void) {
+  PyObject *pyobj = 0;
+  
+  pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(global_loadparm), SWIGTYPE_p_loadparm_context,  0 );
+  return pyobj;
+}
+
+
 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},
@@ -4030,5 +4053,7 @@ SWIGEXPORT void SWIG_init(void) {
   SWIG_InstallConstants(d,swig_const_table);
   
   
+  PyDict_SetItemString(d,(char*)"cvar", SWIG_globals());
+  SWIG_addvarlink(SWIG_globals(),(char*)"default_config",Swig_var_default_config_get, Swig_var_default_config_set);
 }
 
index ea542e218783b2e8ccad3546fa4e8c3c700b684c..57ad23b21e3e302f686986d4d4203c09e16c39c1 100644 (file)
@@ -25,7 +25,7 @@ class LoadParmTestCase(unittest.TestCase):
         file = param.LoadParm()
         self.assertTrue(file is not None)
 
-    def test_lenght(self):
+    def test_length(self):
         file = param.LoadParm()
         self.assertEquals(0, len(file))