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