Fixed the patchfile tests and tidy up the patchfile backends.
[Samba.git] / source4 / param / param.py
blob025acc6be1e556d9cf161cdf67ad93faecb1d23b
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 1.3.33
4 # Don't modify this file, modify the SWIG interface instead.
6 import _param
7 import new
8 new_instancemethod = new.instancemethod
9 try:
10 _swig_property = property
11 except NameError:
12 pass # Python < 2.2 doesn't have 'property'.
13 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
14 if (name == "thisown"): return self.this.own(value)
15 if (name == "this"):
16 if type(value).__name__ == 'PySwigObject':
17 self.__dict__[name] = value
18 return
19 method = class_type.__swig_setmethods__.get(name,None)
20 if method: return method(self,value)
21 if (not static) or hasattr(self,name):
22 self.__dict__[name] = value
23 else:
24 raise AttributeError("You cannot add attributes to %s" % self)
26 def _swig_setattr(self,class_type,name,value):
27 return _swig_setattr_nondynamic(self,class_type,name,value,0)
29 def _swig_getattr(self,class_type,name):
30 if (name == "thisown"): return self.this.own()
31 method = class_type.__swig_getmethods__.get(name,None)
32 if method: return method(self)
33 raise AttributeError,name
35 def _swig_repr(self):
36 try: strthis = "proxy of " + self.this.__repr__()
37 except: strthis = ""
38 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
40 import types
41 try:
42 _object = types.ObjectType
43 _newclass = 1
44 except AttributeError:
45 class _object : pass
46 _newclass = 0
47 del types
50 def _swig_setattr_nondynamic_method(set):
51 def set_attr(self,name,value):
52 if (name == "thisown"): return self.this.own(value)
53 if hasattr(self,name) or (name == "this"):
54 set(self,name,value)
55 else:
56 raise AttributeError("You cannot add attributes to %s" % self)
57 return set_attr
60 class LoadParm(object):
61 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
62 __repr__ = _swig_repr
63 def __init__(self, *args, **kwargs):
64 _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs))
65 __swig_destroy__ = _param.delete_LoadParm
66 LoadParm.default_service = new_instancemethod(_param.LoadParm_default_service,None,LoadParm)
67 LoadParm.load = new_instancemethod(_param.LoadParm_load,None,LoadParm)
68 LoadParm.load_default = new_instancemethod(_param.LoadParm_load_default,None,LoadParm)
69 LoadParm.__len__ = new_instancemethod(_param.LoadParm___len__,None,LoadParm)
70 LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadParm)
71 LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm)
72 LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm)
73 LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm)
74 LoadParm.use = new_instancemethod(_param.LoadParm_use,None,LoadParm)
75 LoadParm.set = new_instancemethod(_param.LoadParm_set,None,LoadParm)
76 LoadParm.get = new_instancemethod(_param.LoadParm_get,None,LoadParm)
77 LoadParm_swigregister = _param.LoadParm_swigregister
78 LoadParm_swigregister(LoadParm)
80 class loadparm_service(object):
81 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
82 def __init__(self): raise AttributeError, "No constructor defined"
83 __repr__ = _swig_repr
84 loadparm_service.volume_label = new_instancemethod(_param.loadparm_service_volume_label,None,loadparm_service)
85 loadparm_service.printername = new_instancemethod(_param.loadparm_service_printername,None,loadparm_service)
86 loadparm_service.maxprintjobs = new_instancemethod(_param.loadparm_service_maxprintjobs,None,loadparm_service)
87 loadparm_service_swigregister = _param.loadparm_service_swigregister
88 loadparm_service_swigregister(loadparm_service)
90 class ParamFile(object):
91 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
92 __repr__ = _swig_repr
93 def __init__(self, *args, **kwargs):
94 _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs))
95 def __getitem__(self, name):
96 ret = self.get_section(name)
97 if ret is None:
98 raise KeyError("No such section %s" % name)
99 return ret
101 class SectionIterator:
102 def __init__(self, param):
103 self.param = param
104 self.key = None
106 def __iter__(self):
107 return self
109 def next(self):
110 if self.key is None:
111 self.key = self.param.first_section()
112 if self.key is None:
113 raise StopIteration
114 return self.key
115 else:
116 self.key = self.param.next_section(self.key)
117 if self.key is None:
118 raise StopIteration
119 return self.key
121 def __iter__(self):
122 return self.SectionIterator(self)
124 __swig_destroy__ = _param.delete_ParamFile
125 ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile)
126 ParamFile.add_section = new_instancemethod(_param.ParamFile_add_section,None,ParamFile)
127 ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile)
128 ParamFile.get_string = new_instancemethod(_param.ParamFile_get_string,None,ParamFile)
129 ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile)
130 ParamFile.set = new_instancemethod(_param.ParamFile_set,None,ParamFile)
131 ParamFile.first_section = new_instancemethod(_param.ParamFile_first_section,None,ParamFile)
132 ParamFile.next_section = new_instancemethod(_param.ParamFile_next_section,None,ParamFile)
133 ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile)
134 ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile)
135 ParamFile_swigregister = _param.ParamFile_swigregister
136 ParamFile_swigregister(ParamFile)
138 class param_opt(object):
139 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
140 def __init__(self): raise AttributeError, "No constructor defined"
141 __repr__ = _swig_repr
142 key = _swig_property(_param.param_opt_key_get)
143 value = _swig_property(_param.param_opt_value_get)
144 __swig_destroy__ = _param.delete_param_opt
145 param_opt.__str__ = new_instancemethod(_param.param_opt___str__,None,param_opt)
146 param_opt_swigregister = _param.param_opt_swigregister
147 param_opt_swigregister(param_opt)
149 class param_section(object):
150 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
151 __repr__ = _swig_repr
152 name = _swig_property(_param.param_section_name_get)
153 def __getitem__(self, name):
154 ret = self.get(name)
155 if ret is None:
156 raise KeyError("No such option %s" % name)
157 return ret
159 class ParamIterator:
160 def __init__(self, section):
161 self.section = section
162 self.key = None
164 def __iter__(self):
165 return self
167 def next(self):
168 if self.key is None:
169 self.key = self.section.first_parameter()
170 if self.key is None:
171 raise StopIteration
172 return self.key
173 else:
174 self.key = self.section.next_parameter(self.key)
175 if self.key is None:
176 raise StopIteration
177 return self.key
179 def __iter__(self):
180 return self.ParamIterator(self)
182 def __init__(self, *args, **kwargs):
183 _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs))
184 __swig_destroy__ = _param.delete_param_section
185 param_section.get = new_instancemethod(_param.param_section_get,None,param_section)
186 param_section.first_parameter = new_instancemethod(_param.param_section_first_parameter,None,param_section)
187 param_section.next_parameter = new_instancemethod(_param.param_section_next_parameter,None,param_section)
188 param_section_swigregister = _param.param_section_swigregister
189 param_section_swigregister(param_section)
192 cvar = _param.cvar