Regenerate SWIG files.
[kai/samba.git] / source4 / param / param.py
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 1.3.36
3 #
4 # Don't modify this file, modify the SWIG interface instead.
5
6 """
7 Parsing and writing Samba configuration files.
8 """
9
10 import _param
11 import new
12 new_instancemethod = new.instancemethod
13 try:
14     _swig_property = property
15 except NameError:
16     pass # Python < 2.2 doesn't have 'property'.
17 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
18     if (name == "thisown"): return self.this.own(value)
19     if (name == "this"):
20         if type(value).__name__ == 'PySwigObject':
21             self.__dict__[name] = value
22             return
23     method = class_type.__swig_setmethods__.get(name,None)
24     if method: return method(self,value)
25     if (not static) or hasattr(self,name):
26         self.__dict__[name] = value
27     else:
28         raise AttributeError("You cannot add attributes to %s" % self)
29
30 def _swig_setattr(self,class_type,name,value):
31     return _swig_setattr_nondynamic(self,class_type,name,value,0)
32
33 def _swig_getattr(self,class_type,name):
34     if (name == "thisown"): return self.this.own()
35     method = class_type.__swig_getmethods__.get(name,None)
36     if method: return method(self)
37     raise AttributeError,name
38
39 def _swig_repr(self):
40     try: strthis = "proxy of " + self.this.__repr__()
41     except: strthis = ""
42     return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
43
44 import types
45 try:
46     _object = types.ObjectType
47     _newclass = 1
48 except AttributeError:
49     class _object : pass
50     _newclass = 0
51 del types
52
53
54 def _swig_setattr_nondynamic_method(set):
55     def set_attr(self,name,value):
56         if (name == "thisown"): return self.this.own(value)
57         if hasattr(self,name) or (name == "this"):
58             set(self,name,value)
59         else:
60             raise AttributeError("You cannot add attributes to %s" % self)
61     return set_attr
62
63
64 class LoadParm(object):
65     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
66     __repr__ = _swig_repr
67     def __init__(self, *args, **kwargs): 
68         _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs))
69     def load(*args, **kwargs):
70         """
71         S.load(filename) -> None
72         Load specified file.
73         """
74         return _param.LoadParm_load(*args, **kwargs)
75
76     def load_default(*args, **kwargs):
77         """
78         S.load_default() -> None
79         Load default smb.conf file.
80         """
81         return _param.LoadParm_load_default(*args, **kwargs)
82
83     def configfile(*args, **kwargs):
84         """
85         S.configfile() -> string
86         Return name of last config file that was loaded.
87         """
88         return _param.LoadParm_configfile(*args, **kwargs)
89
90     def is_mydomain(*args, **kwargs):
91         """
92         S.is_mydomain(domain_name) -> bool
93         Check whether the specified name matches our domain name.
94         """
95         return _param.LoadParm_is_mydomain(*args, **kwargs)
96
97     def is_myname(*args, **kwargs):
98         """
99         S.is_myname(netbios_name) -> bool
100         Check whether the specified name matches one of our netbios names.
101         """
102         return _param.LoadParm_is_myname(*args, **kwargs)
103
104     def set(*args, **kwargs):
105         """
106         S.set(name, value) -> bool
107         Change a parameter.
108         """
109         return _param.LoadParm_set(*args, **kwargs)
110
111     __swig_destroy__ = _param.delete_LoadParm
112 LoadParm.default_service = new_instancemethod(_param.LoadParm_default_service,None,LoadParm)
113 LoadParm.load = new_instancemethod(_param.LoadParm_load,None,LoadParm)
114 LoadParm.load_default = new_instancemethod(_param.LoadParm_load_default,None,LoadParm)
115 LoadParm.__len__ = new_instancemethod(_param.LoadParm___len__,None,LoadParm)
116 LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadParm)
117 LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm)
118 LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm)
119 LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm)
120 LoadParm.use = new_instancemethod(_param.LoadParm_use,None,LoadParm)
121 LoadParm.set = new_instancemethod(_param.LoadParm_set,None,LoadParm)
122 LoadParm.get = new_instancemethod(_param.LoadParm_get,None,LoadParm)
123 LoadParm_swigregister = _param.LoadParm_swigregister
124 LoadParm_swigregister(LoadParm)
125
126 class loadparm_service(object):
127     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
128     def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
129     __repr__ = _swig_repr
130 loadparm_service.volume_label = new_instancemethod(_param.loadparm_service_volume_label,None,loadparm_service)
131 loadparm_service.printername = new_instancemethod(_param.loadparm_service_printername,None,loadparm_service)
132 loadparm_service.maxprintjobs = new_instancemethod(_param.loadparm_service_maxprintjobs,None,loadparm_service)
133 loadparm_service_swigregister = _param.loadparm_service_swigregister
134 loadparm_service_swigregister(loadparm_service)
135
136 class ParamFile(object):
137     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
138     __repr__ = _swig_repr
139     def __init__(self, *args, **kwargs): 
140         _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs))
141     def add_section(*args, **kwargs):
142         """
143         S.add_section(name) -> section
144         Add a new section.
145         """
146         return _param.ParamFile_add_section(*args, **kwargs)
147
148     def first_section(*args, **kwargs):
149         """
150         S.first_section() -> section
151         Find first section
152         """
153         return _param.ParamFile_first_section(*args, **kwargs)
154
155     def next_section(*args, **kwargs):
156         """
157         S.next_section(prev) -> section
158         Find next section
159         """
160         return _param.ParamFile_next_section(*args, **kwargs)
161
162     def read(*args, **kwargs):
163         """
164         S.read(filename) -> bool
165         Read a filename.
166         """
167         return _param.ParamFile_read(*args, **kwargs)
168
169     def __getitem__(self, name):
170         ret = self.get_section(name)
171         if ret is None:
172             raise KeyError("No such section %s" % name)
173         return ret
174
175     class SectionIterator:
176         def __init__(self, param):
177             self.param = param
178             self.key = None
179
180         def __iter__(self):
181             return self
182             
183         def next(self):
184             if self.key is None:
185                 self.key = self.param.first_section()
186                 if self.key is None:
187                     raise StopIteration
188                 return self.key
189             else:
190                 self.key = self.param.next_section(self.key)
191                 if self.key is None:
192                     raise StopIteration
193                 return self.key
194
195     def __iter__(self):
196         return self.SectionIterator(self)
197
198     __swig_destroy__ = _param.delete_ParamFile
199 ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile)
200 ParamFile.add_section = new_instancemethod(_param.ParamFile_add_section,None,ParamFile)
201 ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile)
202 ParamFile.get_string = new_instancemethod(_param.ParamFile_get_string,None,ParamFile)
203 ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile)
204 ParamFile.set = new_instancemethod(_param.ParamFile_set,None,ParamFile)
205 ParamFile.first_section = new_instancemethod(_param.ParamFile_first_section,None,ParamFile)
206 ParamFile.next_section = new_instancemethod(_param.ParamFile_next_section,None,ParamFile)
207 ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile)
208 ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile)
209 ParamFile_swigregister = _param.ParamFile_swigregister
210 ParamFile_swigregister(ParamFile)
211
212 class param_opt(object):
213     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
214     def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
215     __repr__ = _swig_repr
216     key = _swig_property(_param.param_opt_key_get)
217     value = _swig_property(_param.param_opt_value_get)
218     __swig_destroy__ = _param.delete_param_opt
219 param_opt.__str__ = new_instancemethod(_param.param_opt___str__,None,param_opt)
220 param_opt_swigregister = _param.param_opt_swigregister
221 param_opt_swigregister(param_opt)
222
223 class param_section(object):
224     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
225     __repr__ = _swig_repr
226     name = _swig_property(_param.param_section_name_get)
227     def __getitem__(self, name):
228         ret = self.get(name)
229         if ret is None:
230             raise KeyError("No such option %s" % name)
231         return ret
232
233     class ParamIterator:
234         def __init__(self, section):
235             self.section = section
236             self.key = None
237
238         def __iter__(self):
239             return self
240             
241         def next(self):
242             if self.key is None:
243                 self.key = self.section.first_parameter()
244                 if self.key is None:
245                     raise StopIteration
246                 return self.key
247             else:
248                 self.key = self.section.next_parameter(self.key)
249                 if self.key is None:
250                     raise StopIteration
251                 return self.key
252
253     def __iter__(self):
254         return self.ParamIterator(self)
255
256     def __init__(self, *args, **kwargs): 
257         _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs))
258     __swig_destroy__ = _param.delete_param_section
259 param_section.get = new_instancemethod(_param.param_section_get,None,param_section)
260 param_section.first_parameter = new_instancemethod(_param.param_section_first_parameter,None,param_section)
261 param_section.next_parameter = new_instancemethod(_param.param_section_next_parameter,None,param_section)
262 param_section_swigregister = _param.param_section_swigregister
263 param_section_swigregister(param_section)
264
265
266