r26592: Finish fixing the samba3dump script.
[samba.git] / source4 / param / param.py
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 1.3.33
3 #
4 # Don't modify this file, modify the SWIG interface instead.
5
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)
25
26 def _swig_setattr(self,class_type,name,value):
27     return _swig_setattr_nondynamic(self,class_type,name,value,0)
28
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
34
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,)
39
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
48
49
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
58
59
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.load = new_instancemethod(_param.LoadParm_load,None,LoadParm)
67 LoadParm.__len__ = new_instancemethod(_param.LoadParm___len__,None,LoadParm)
68 LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadParm)
69 LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm)
70 LoadParm.is_mydomain = new_instancemethod(_param.LoadParm_is_mydomain,None,LoadParm)
71 LoadParm.is_myname = new_instancemethod(_param.LoadParm_is_myname,None,LoadParm)
72 LoadParm.use = new_instancemethod(_param.LoadParm_use,None,LoadParm)
73 LoadParm.set = new_instancemethod(_param.LoadParm_set,None,LoadParm)
74 LoadParm.get = new_instancemethod(_param.LoadParm_get,None,LoadParm)
75 LoadParm_swigregister = _param.LoadParm_swigregister
76 LoadParm_swigregister(LoadParm)
77
78 class loadparm_service(object):
79     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
80     def __init__(self): raise AttributeError, "No constructor defined"
81     __repr__ = _swig_repr
82 loadparm_service.volume_label = new_instancemethod(_param.loadparm_service_volume_label,None,loadparm_service)
83 loadparm_service.printername = new_instancemethod(_param.loadparm_service_printername,None,loadparm_service)
84 loadparm_service.maxprintjobs = new_instancemethod(_param.loadparm_service_maxprintjobs,None,loadparm_service)
85 loadparm_service_swigregister = _param.loadparm_service_swigregister
86 loadparm_service_swigregister(loadparm_service)
87
88 class ParamFile(object):
89     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
90     __repr__ = _swig_repr
91     def __init__(self, *args, **kwargs): 
92         _param.ParamFile_swiginit(self,_param.new_ParamFile(*args, **kwargs))
93     def __getitem__(self, name):
94         ret = self.get_section(name)
95         if ret is None:
96             raise KeyError("No such section %s" % name)
97         return ret
98
99     class SectionIterator:
100         def __init__(self, param):
101             self.param = param
102             self.key = None
103
104         def __iter__(self):
105             return self
106             
107         def next(self):
108             if self.key is None:
109                 self.key = self.param.first_section()
110                 if self.key is None:
111                     raise StopIteration
112                 return self.key
113             else:
114                 self.key = self.param.next_section(self.key)
115                 if self.key is None:
116                     raise StopIteration
117                 return self.key
118
119     def __iter__(self):
120         return self.SectionIterator(self)
121
122     __swig_destroy__ = _param.delete_ParamFile
123 ParamFile.get_section = new_instancemethod(_param.ParamFile_get_section,None,ParamFile)
124 ParamFile.add_section = new_instancemethod(_param.ParamFile_add_section,None,ParamFile)
125 ParamFile.get = new_instancemethod(_param.ParamFile_get,None,ParamFile)
126 ParamFile.get_string = new_instancemethod(_param.ParamFile_get_string,None,ParamFile)
127 ParamFile.set_string = new_instancemethod(_param.ParamFile_set_string,None,ParamFile)
128 ParamFile.set = new_instancemethod(_param.ParamFile_set,None,ParamFile)
129 ParamFile.first_section = new_instancemethod(_param.ParamFile_first_section,None,ParamFile)
130 ParamFile.next_section = new_instancemethod(_param.ParamFile_next_section,None,ParamFile)
131 ParamFile.read = new_instancemethod(_param.ParamFile_read,None,ParamFile)
132 ParamFile.write = new_instancemethod(_param.ParamFile_write,None,ParamFile)
133 ParamFile_swigregister = _param.ParamFile_swigregister
134 ParamFile_swigregister(ParamFile)
135
136 class param_opt(object):
137     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
138     def __init__(self): raise AttributeError, "No constructor defined"
139     __repr__ = _swig_repr
140     key = _swig_property(_param.param_opt_key_get)
141     value = _swig_property(_param.param_opt_value_get)
142     __swig_destroy__ = _param.delete_param_opt
143 param_opt.__str__ = new_instancemethod(_param.param_opt___str__,None,param_opt)
144 param_opt_swigregister = _param.param_opt_swigregister
145 param_opt_swigregister(param_opt)
146
147 class param_section(object):
148     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
149     __repr__ = _swig_repr
150     name = _swig_property(_param.param_section_name_get)
151     def __getitem__(self, name):
152         ret = self.get(name)
153         if ret is None:
154             raise KeyError("No such option %s" % name)
155         return ret
156
157     class ParamIterator:
158         def __init__(self, section):
159             self.section = section
160             self.key = None
161
162         def __iter__(self):
163             return self
164             
165         def next(self):
166             if self.key is None:
167                 self.key = self.section.first_parameter()
168                 if self.key is None:
169                     raise StopIteration
170                 return self.key
171             else:
172                 self.key = self.section.next_parameter(self.key)
173                 if self.key is None:
174                     raise StopIteration
175                 return self.key
176
177     def __iter__(self):
178         return self.ParamIterator(self)
179
180     def __init__(self, *args, **kwargs): 
181         _param.param_section_swiginit(self,_param.new_param_section(*args, **kwargs))
182     __swig_destroy__ = _param.delete_param_section
183 param_section.get = new_instancemethod(_param.param_section_get,None,param_section)
184 param_section.first_parameter = new_instancemethod(_param.param_section_first_parameter,None,param_section)
185 param_section.next_parameter = new_instancemethod(_param.param_section_next_parameter,None,param_section)
186 param_section_swigregister = _param.param_section_swigregister
187 param_section_swigregister(param_section)
188
189
190 cvar = _param.cvar
191