99 |
self.write_header() |
self.write_header() |
100 |
self.write_session(self.session) |
self.write_session(self.session) |
101 |
|
|
102 |
assert(self.indent_level == 0) |
assert self.indent_level == 0 |
103 |
|
|
104 |
def write_attribs(self, attrs): |
def write_attribs(self, attrs): |
105 |
for name, value in attrs.items(): |
for name, value in attrs.items(): |
127 |
|
|
128 |
def close_element(self, element): |
def close_element(self, element): |
129 |
self.indent_level -= 1 |
self.indent_level -= 1 |
130 |
assert(self.indent_level >= 0) |
assert self.indent_level >= 0 |
131 |
|
|
132 |
# see open_element() for an explanation |
# see open_element() for an explanation |
133 |
if self.element_open == 1: |
if self.element_open == 1: |
244 |
|
|
245 |
# just playing now with lambdas and dictionaries |
# just playing now with lambdas and dictionaries |
246 |
|
|
247 |
types = [[lambda p: 'clnull', |
types = [[lambda p: 'clnull label="%s"' % p.GetLabel(), |
248 |
lambda p: 'clnull'], |
lambda p: 'clnull'], |
249 |
[lambda p: 'clpoint value="%s"' % |
[lambda p: 'clpoint label="%s" value="%s"' % |
250 |
str(p.GetValue()), |
(p.GetLabel(), str(p.GetValue())), |
251 |
lambda p: 'clpoint'], |
lambda p: 'clpoint'], |
252 |
[lambda p: 'clrange min="%s" max="%s"' % |
[lambda p: 'clrange label="%s" min="%s" max="%s"' % |
253 |
(str(p.GetMin()), |
(p.GetLabel(), |
254 |
(str(p.GetMax()))), |
str(p.GetMin()), (str(p.GetMax()))), |
255 |
lambda p: 'clrange']] |
lambda p: 'clrange']] |
256 |
|
|
257 |
def write_class_group(group): |
def write_class_group(group): |
260 |
elif isinstance(group, ClassGroupSingleton): type = 1 |
elif isinstance(group, ClassGroupSingleton): type = 1 |
261 |
elif isinstance(group, ClassGroupRange): type = 2 |
elif isinstance(group, ClassGroupRange): type = 2 |
262 |
elif isinstance(group, ClassGroupMap): type = 3 |
elif isinstance(group, ClassGroupMap): type = 3 |
263 |
assert(type >= 0) |
assert type >= 0 |
264 |
|
|
265 |
if type <= 2: |
if type <= 2: |
266 |
data = group.GetProperties() |
data = group.GetProperties() |