From c39c94b499ce9b4fa83362a56f42f71d000492c7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Dec 2007 01:26:20 +0100 Subject: r26447: Forgot to add param.i file. (This used to be commit 44098e6a40c7447867ea82c6c3f7148a49816577) --- source4/param/param.py | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 source4/param/param.py (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py new file mode 100644 index 0000000000..6b90581c68 --- /dev/null +++ b/source4/param/param.py @@ -0,0 +1,112 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.33 +# +# Don't modify this file, modify the SWIG interface instead. + +import _param +import new +new_instancemethod = new.instancemethod +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'PySwigObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if (name == "thisown"): return self.this.own(value) + if hasattr(self,name) or (name == "this"): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + +class LoadParm(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self, *args, **kwargs): + _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs)) + __swig_destroy__ = _param.delete_LoadParm +LoadParm.load = new_instancemethod(_param.LoadParm_load,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) +LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm) +LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm) +LoadParm_swigregister = _param.LoadParm_swigregister +LoadParm_swigregister(LoadParm) + +class loadparm_service(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr +loadparm_service.volume_label = new_instancemethod(_param.loadparm_service_volume_label,None,loadparm_service) +loadparm_service.printername = new_instancemethod(_param.loadparm_service_printername,None,loadparm_service) +loadparm_service.maxprintjobs = new_instancemethod(_param.loadparm_service_maxprintjobs,None,loadparm_service) +loadparm_service_swigregister = _param.loadparm_service_swigregister +loadparm_service_swigregister(loadparm_service) + +class ParamFile(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self, *args, **kwargs): + _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs)) + __swig_destroy__ = _param.delete_ParamFile +ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile) +ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile) +ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile) +ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile) +ParamFile.use = new_instancemethod(_param.ParamFile_use,None,ParamFile) +ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile) +ParamFile_swigregister = _param.ParamFile_swigregister +ParamFile_swigregister(ParamFile) + +class param_section(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self, *args, **kwargs): + _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs)) + __swig_destroy__ = _param.delete_param_section +param_section.get = new_instancemethod(_param.param_section_get,None,param_section) +param_section_swigregister = _param.param_section_swigregister +param_section_swigregister(param_section) + + +cvar = _param.cvar + -- cgit From 864218b6beebaeb337f14398f0544340ad30dd58 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Dec 2007 01:26:25 +0100 Subject: r26448: Add basic tests for param python module. (This used to be commit ccfab20dcc2d7059c402c03be244b759d59c4b81) --- source4/param/param.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 6b90581c68..8ac009af96 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -88,6 +88,12 @@ class ParamFile(object): def __init__(self, *args, **kwargs): _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs)) __swig_destroy__ = _param.delete_ParamFile + def __getitem__(self, name): + ret = self.get_section(name) + if ret is None: + raise KeyError("No such section %s" % name) + return ret + ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile) ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile) ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile) @@ -100,6 +106,12 @@ ParamFile_swigregister(ParamFile) class param_section(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr + def __getitem__(self, name): + ret = self.get_section(name) + if ret is None: + raise KeyError("No such section %s" % name) + return ret + def __init__(self, *args, **kwargs): _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs)) __swig_destroy__ = _param.delete_param_section @@ -108,5 +120,4 @@ param_section_swigregister = _param.param_section_swigregister param_section_swigregister(param_section) -cvar = _param.cvar -- cgit From df8c7da800f75ff45fb48de59d7ce3f0667d375f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Dec 2007 14:28:07 +0100 Subject: r26454: Add simple SWIG macro for wrapping talloced types. (This used to be commit 760fcc8bfa2a7cd7641465cb3bae889e9e0fbc75) --- source4/param/param.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 8ac009af96..9c0bac9c07 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -87,13 +87,13 @@ class ParamFile(object): __repr__ = _swig_repr def __init__(self, *args, **kwargs): _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs)) - __swig_destroy__ = _param.delete_ParamFile def __getitem__(self, name): ret = self.get_section(name) if ret is None: raise KeyError("No such section %s" % name) return ret + __swig_destroy__ = _param.delete_ParamFile ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile) ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile) ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile) -- cgit From a94142487add08cd38b6f51b7048c3b50eaef599 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Dec 2007 14:28:21 +0100 Subject: r26456: Provide default config object, fix typo. (This used to be commit 2b59df2af973044d9d3875c9202c17647f561d3b) --- source4/param/param.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 9c0bac9c07..aa01d6e830 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -120,4 +120,5 @@ param_section_swigregister = _param.param_section_swigregister param_section_swigregister(param_section) +cvar = _param.cvar -- cgit From 32f439bfa458f7936b507cb5a1e3c74bcb8c68bf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 11:12:36 +0100 Subject: r26503: Change order of arguments in param interface so it's easier to make the section name optional. Fix several smaller bits and pieces in the Python code. (This used to be commit 1b89311e5fa4fcde060df50e580dc221205cc8ca) --- source4/param/param.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index aa01d6e830..bd5965aa17 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -69,6 +69,7 @@ LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadP LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm) LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm) LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm) +LoadParm.use = new_instancemethod(_param.LoadParm_use,None,LoadParm) LoadParm_swigregister = _param.LoadParm_swigregister LoadParm_swigregister(LoadParm) @@ -95,21 +96,32 @@ class ParamFile(object): __swig_destroy__ = _param.delete_ParamFile ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile) +ParamFile.add_section = new_instancemethod(_param.ParamFile_add_section,None,ParamFile) ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile) +ParamFile.get_string = new_instancemethod(_param.ParamFile_get_string,None,ParamFile) ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile) +ParamFile.set = new_instancemethod(_param.ParamFile_set,None,ParamFile) ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile) -ParamFile.use = new_instancemethod(_param.ParamFile_use,None,ParamFile) ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile) ParamFile_swigregister = _param.ParamFile_swigregister ParamFile_swigregister(ParamFile) +class param_opt(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr + __swig_destroy__ = _param.delete_param_opt +param_opt.__str__ = new_instancemethod(_param.param_opt___str__,None,param_opt) +param_opt_swigregister = _param.param_opt_swigregister +param_opt_swigregister(param_opt) + class param_section(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __getitem__(self, name): - ret = self.get_section(name) + ret = self.get(name) if ret is None: - raise KeyError("No such section %s" % name) + raise KeyError("No such option %s" % name) return ret def __init__(self, *args, **kwargs): -- cgit From 57b8a8fd42f5d89f439fd9d0781bd8f561a84131 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 23:16:12 +0100 Subject: r26517: Add functions for setting and getting parameters on a LoadParm. Pass loadparm context along to Ldb contexts. Other minor Python improvements. (This used to be commit 7a15b486bae8fb774058b2d94cc12b7b01ee6ac0) --- source4/param/param.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index bd5965aa17..291459b9b6 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -70,6 +70,8 @@ LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadPar LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm) LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm) LoadParm.use = new_instancemethod(_param.LoadParm_use,None,LoadParm) +LoadParm.set = new_instancemethod(_param.LoadParm_set,None,LoadParm) +LoadParm.get = new_instancemethod(_param.LoadParm_get,None,LoadParm) LoadParm_swigregister = _param.LoadParm_swigregister LoadParm_swigregister(LoadParm) -- cgit From cc30cb5e24160d107b67936d71f54645d9b3d23f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 25 Dec 2007 16:36:23 -0600 Subject: r26592: Finish fixing the samba3dump script. (This used to be commit 85679f3fc98238f90280f9f10d42550d71eeb918) --- source4/param/param.py | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 291459b9b6..66b51e5d3b 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -96,6 +96,29 @@ class ParamFile(object): raise KeyError("No such section %s" % name) return ret + class SectionIterator: + def __init__(self, param): + self.param = param + self.key = None + + def __iter__(self): + return self + + def next(self): + if self.key is None: + self.key = self.param.first_section() + if self.key is None: + raise StopIteration + return self.key + else: + self.key = self.param.next_section(self.key) + if self.key is None: + raise StopIteration + return self.key + + def __iter__(self): + return self.SectionIterator(self) + __swig_destroy__ = _param.delete_ParamFile ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile) ParamFile.add_section = new_instancemethod(_param.ParamFile_add_section,None,ParamFile) @@ -103,6 +126,8 @@ ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile) ParamFile.get_string = new_instancemethod(_param.ParamFile_get_string,None,ParamFile) ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile) ParamFile.set = new_instancemethod(_param.ParamFile_set,None,ParamFile) +ParamFile.first_section = new_instancemethod(_param.ParamFile_first_section,None,ParamFile) +ParamFile.next_section = new_instancemethod(_param.ParamFile_next_section,None,ParamFile) ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile) ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile) ParamFile_swigregister = _param.ParamFile_swigregister @@ -112,6 +137,8 @@ class param_opt(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self): raise AttributeError, "No constructor defined" __repr__ = _swig_repr + key = _swig_property(_param.param_opt_key_get) + value = _swig_property(_param.param_opt_value_get) __swig_destroy__ = _param.delete_param_opt param_opt.__str__ = new_instancemethod(_param.param_opt___str__,None,param_opt) param_opt_swigregister = _param.param_opt_swigregister @@ -120,16 +147,42 @@ param_opt_swigregister(param_opt) class param_section(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr + name = _swig_property(_param.param_section_name_get) def __getitem__(self, name): ret = self.get(name) if ret is None: raise KeyError("No such option %s" % name) return ret + class ParamIterator: + def __init__(self, section): + self.section = section + self.key = None + + def __iter__(self): + return self + + def next(self): + if self.key is None: + self.key = self.section.first_parameter() + if self.key is None: + raise StopIteration + return self.key + else: + self.key = self.section.next_parameter(self.key) + if self.key is None: + raise StopIteration + return self.key + + def __iter__(self): + return self.ParamIterator(self) + def __init__(self, *args, **kwargs): _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs)) __swig_destroy__ = _param.delete_param_section param_section.get = new_instancemethod(_param.param_section_get,None,param_section) +param_section.first_parameter = new_instancemethod(_param.param_section_first_parameter,None,param_section) +param_section.next_parameter = new_instancemethod(_param.param_section_next_parameter,None,param_section) param_section_swigregister = _param.param_section_swigregister param_section_swigregister(param_section) -- cgit From 00cb710fbc872cffa2d4d5c54c5ea65ba993da0c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 23 Jan 2008 23:15:39 +0100 Subject: Add bindings for lp_load_default(). (This used to be commit ffd793bbde636366855462f980f1f7d0e25afaab) --- source4/param/param.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/param/param.py') 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) -- cgit From 2ba62662f8e2578153be3125eb557b9349ccfd3b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 28 Feb 2008 20:04:58 +0100 Subject: Remove sDefault as static variable. (This used to be commit 16f36ce499e93860dd535034a584ec2b93e7a172) --- source4/param/param.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 5adf7a4ecc..025acc6be1 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -63,6 +63,7 @@ class LoadParm(object): def __init__(self, *args, **kwargs): _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs)) __swig_destroy__ = _param.delete_LoadParm +LoadParm.default_service = new_instancemethod(_param.LoadParm_default_service,None,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) -- cgit From db30ff4bea11f6612bd68c934ba31387ad99cefc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 21 Apr 2008 17:59:08 +0200 Subject: Load default smb.conf file if none was specified explicitly. (This used to be commit 8fa23fac516dbf4c8245c1d009e81f02a6341775) --- source4/param/param.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 025acc6be1..0419c75bfa 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -79,7 +79,7 @@ LoadParm_swigregister(LoadParm) class loadparm_service(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - def __init__(self): raise AttributeError, "No constructor defined" + def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined" __repr__ = _swig_repr loadparm_service.volume_label = new_instancemethod(_param.loadparm_service_volume_label,None,loadparm_service) loadparm_service.printername = new_instancemethod(_param.loadparm_service_printername,None,loadparm_service) @@ -137,7 +137,7 @@ ParamFile_swigregister(ParamFile) class param_opt(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - def __init__(self): raise AttributeError, "No constructor defined" + def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined" __repr__ = _swig_repr key = _swig_property(_param.param_opt_key_get) value = _swig_property(_param.param_opt_value_get) -- cgit From 90471951285465130dba73b3c6c3acc912e751d6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 22 May 2008 18:13:48 +0200 Subject: Add docstrings to param python module. (This used to be commit 39d27088e51867705ceec356759e7c3609a102bf) --- source4/param/param.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 0419c75bfa..3aebaf0e02 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -62,6 +62,48 @@ class LoadParm(object): __repr__ = _swig_repr def __init__(self, *args, **kwargs): _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs)) + def load(*args, **kwargs): + """ + S.load(filename) -> None + Load specified file. + """ + return _param.LoadParm_load(*args, **kwargs) + + def load_default(*args, **kwargs): + """ + S.load_default() -> None + Load default smb.conf file. + """ + return _param.LoadParm_load_default(*args, **kwargs) + + def configfile(*args, **kwargs): + """ + S.configfile() -> string + Return name of last config file that was loaded. + """ + return _param.LoadParm_configfile(*args, **kwargs) + + def is_mydomain(*args, **kwargs): + """ + S.is_mydomain(domain_name) -> bool + Check whether the specified name matches our domain name. + """ + return _param.LoadParm_is_mydomain(*args, **kwargs) + + def is_myname(*args, **kwargs): + """ + S.is_myname(netbios_name) -> bool + Check whether the specified name matches one of our netbios names. + """ + return _param.LoadParm_is_myname(*args, **kwargs) + + def set(*args, **kwargs): + """ + S.set(name, value) -> bool + Change a parameter. + """ + return _param.LoadParm_set(*args, **kwargs) + __swig_destroy__ = _param.delete_LoadParm LoadParm.default_service = new_instancemethod(_param.LoadParm_default_service,None,LoadParm) LoadParm.load = new_instancemethod(_param.LoadParm_load,None,LoadParm) @@ -92,6 +134,34 @@ class ParamFile(object): __repr__ = _swig_repr def __init__(self, *args, **kwargs): _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs)) + def add_section(*args, **kwargs): + """ + S.add_section(name) -> section + Add a new section. + """ + return _param.ParamFile_add_section(*args, **kwargs) + + def first_section(*args, **kwargs): + """ + S.first_section() -> section + Find first section + """ + return _param.ParamFile_first_section(*args, **kwargs) + + def next_section(*args, **kwargs): + """ + S.next_section(prev) -> section + Find next section + """ + return _param.ParamFile_next_section(*args, **kwargs) + + def read(*args, **kwargs): + """ + S.read(filename) -> bool + Read a filename. + """ + return _param.ParamFile_read(*args, **kwargs) + def __getitem__(self, name): ret = self.get_section(name) if ret is None: -- cgit From 73b789b6d25698dba15c867c71d0cdd8c264f352 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 May 2008 04:01:57 +0200 Subject: Add docstrings to a couple more python modules. (This used to be commit b4560c90e5e8d3a35367d3a21d361dc4c9c0de23) --- source4/param/param.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/param/param.py') diff --git a/source4/param/param.py b/source4/param/param.py index 3aebaf0e02..46c75cef97 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -3,6 +3,10 @@ # # Don't modify this file, modify the SWIG interface instead. +""" +Parsing and writing Samba configuration files. +""" + import _param import new new_instancemethod = new.instancemethod -- cgit