How to use find_attr_value_ method in autotest

Best Python code snippet using autotest_python

gen.py

Source:gen.py Github

copy

Full Screen

...227 for child in node:228 if child.tail is not None:229 text += child.tail230 return text231def find_attr_value_(attr_name, node):232 attrs = node.attrib233 attr_parts = attr_name.split(':')234 value = None235 if len(attr_parts) == 1:236 value = attrs.get(attr_name)237 elif len(attr_parts) == 2:238 prefix, name = attr_parts239 namespace = node.nsmap.get(prefix)240 if namespace is not None:241 value = attrs.get('{%s}%s' % (namespace, name,))242 return value243class GDSParseError(Exception):244 pass245def raise_parse_error(node, msg):246 if XMLParser_import_library == XMLParser_import_lxml:247 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline,)248 else:249 msg = '%s (element %s)' % (msg, node.tag,)250 raise GDSParseError(msg)251class MixedContainer:252 # Constants for category:253 CategoryNone = 0254 CategoryText = 1255 CategorySimple = 2256 CategoryComplex = 3257 # Constants for content_type:258 TypeNone = 0259 TypeText = 1260 TypeString = 2261 TypeInteger = 3262 TypeFloat = 4263 TypeDecimal = 5264 TypeDouble = 6265 TypeBoolean = 7266 def __init__(self, category, content_type, name, value):267 self.category = category268 self.content_type = content_type269 self.name = name270 self.value = value271 def getCategory(self):272 return self.category273 def getContenttype(self, content_type):274 return self.content_type275 def getValue(self):276 return self.value277 def getName(self):278 return self.name279 def export(self, outfile, level, name, namespace):280 if self.category == MixedContainer.CategoryText:281 # Prevent exporting empty content as empty lines.282 if self.value.strip():283 outfile.write(self.value)284 elif self.category == MixedContainer.CategorySimple:285 self.exportSimple(outfile, level, name)286 else: # category == MixedContainer.CategoryComplex287 self.value.export(outfile, level, namespace, name)288 def exportSimple(self, outfile, level, name):289 if self.content_type == MixedContainer.TypeString:290 outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))291 elif self.content_type == MixedContainer.TypeInteger or \292 self.content_type == MixedContainer.TypeBoolean:293 outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))294 elif self.content_type == MixedContainer.TypeFloat or \295 self.content_type == MixedContainer.TypeDecimal:296 outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))297 elif self.content_type == MixedContainer.TypeDouble:298 outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))299 def exportLiteral(self, outfile, level, name):300 if self.category == MixedContainer.CategoryText:301 showIndent(outfile, level)302 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \303 (self.category, self.content_type, self.name, self.value))304 elif self.category == MixedContainer.CategorySimple:305 showIndent(outfile, level)306 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \307 (self.category, self.content_type, self.name, self.value))308 else: # category == MixedContainer.CategoryComplex309 showIndent(outfile, level)310 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \311 (self.category, self.content_type, self.name,))312 self.value.exportLiteral(outfile, level + 1)313 showIndent(outfile, level)314 outfile.write(')\n')315class MemberSpec_(object):316 def __init__(self, name='', data_type='', container=0):317 self.name = name318 self.data_type = data_type319 self.container = container320 def set_name(self, name): self.name = name321 def get_name(self): return self.name322 def set_data_type(self, data_type): self.data_type = data_type323 def get_data_type_chain(self): return self.data_type324 def get_data_type(self):325 if isinstance(self.data_type, list):326 if len(self.data_type) > 0:327 return self.data_type[-1]328 else:329 return 'xs:string'330 else:331 return self.data_type332 def set_container(self, container): self.container = container333 def get_container(self): return self.container334def _cast(typ, value):335 if typ is None or value is None:336 return value337 return typ(value)338#339# Data representation classes.340#341class Attachment(GeneratedsSuper):342 subclass = None343 superclass = None344 def __init__(self, url=None, contentType=None, name=None, size=None):345 self.url = _cast(None, url)346 self.contentType = _cast(None, contentType)347 self.name = _cast(None, name)348 self.size = _cast(int, size)349 pass350 def factory(*args_, **kwargs_):351 if Attachment.subclass:352 return Attachment.subclass(*args_, **kwargs_)353 else:354 return Attachment(*args_, **kwargs_)355 factory = staticmethod(factory)356 def get_url(self): return self.url357 def set_url(self, url): self.url = url358 def get_contentType(self): return self.contentType359 def set_contentType(self, contentType): self.contentType = contentType360 def get_name(self): return self.name361 def set_name(self, name): self.name = name362 def get_size(self): return self.size363 def set_size(self, size): self.size = size364 def export(self, outfile, level, namespace_='mstns:', name_='Attachment', namespacedef_=''):365 showIndent(outfile, level)366 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))367 already_processed = []368 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Attachment')369 if self.hasContent_():370 outfile.write('>\n')371 self.exportChildren(outfile, level + 1, namespace_, name_)372 outfile.write('</%s%s>\n' % (namespace_, name_))373 else:374 outfile.write('/>\n')375 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Attachment'):376 if self.url is not None and 'url' not in already_processed:377 already_processed.append('url')378 outfile.write(' url=%s' % (self.gds_format_string(quote_attrib(self.url).encode(ExternalEncoding), input_name='url'),))379 if self.contentType is not None and 'contentType' not in already_processed:380 already_processed.append('contentType')381 outfile.write(' contentType=%s' % (self.gds_format_string(quote_attrib(self.contentType).encode(ExternalEncoding), input_name='contentType'),))382 if self.name is not None and 'name' not in already_processed:383 already_processed.append('name')384 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'),))385 if self.size is not None and 'size' not in already_processed:386 already_processed.append('size')387 outfile.write(' size="%s"' % self.gds_format_integer(self.size, input_name='size'))388 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Attachment', fromsubclass_=False):389 pass390 def hasContent_(self):391 if (392 ):393 return True394 else:395 return False396 def exportLiteral(self, outfile, level, name_='Attachment'):397 level += 1398 self.exportLiteralAttributes(outfile, level, [], name_)399 if self.hasContent_():400 self.exportLiteralChildren(outfile, level, name_)401 def exportLiteralAttributes(self, outfile, level, already_processed, name_):402 if self.url is not None and 'url' not in already_processed:403 already_processed.append('url')404 showIndent(outfile, level)405 outfile.write('url = "%s",\n' % (self.url,))406 if self.contentType is not None and 'contentType' not in already_processed:407 already_processed.append('contentType')408 showIndent(outfile, level)409 outfile.write('contentType = "%s",\n' % (self.contentType,))410 if self.name is not None and 'name' not in already_processed:411 already_processed.append('name')412 showIndent(outfile, level)413 outfile.write('name = "%s",\n' % (self.name,))414 if self.size is not None and 'size' not in already_processed:415 already_processed.append('size')416 showIndent(outfile, level)417 outfile.write('size = %d,\n' % (self.size,))418 def exportLiteralChildren(self, outfile, level, name_):419 pass420 def build(self, node):421 self.buildAttributes(node, node.attrib, [])422 for child in node:423 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]424 self.buildChildren(child, node, nodeName_)425 def buildAttributes(self, node, attrs, already_processed):426 value = find_attr_value_('url', node)427 if value is not None and 'url' not in already_processed:428 already_processed.append('url')429 self.url = value430 value = find_attr_value_('contentType', node)431 if value is not None and 'contentType' not in already_processed:432 already_processed.append('contentType')433 self.contentType = value434 value = find_attr_value_('name', node)435 if value is not None and 'name' not in already_processed:436 already_processed.append('name')437 self.name = value438 value = find_attr_value_('size', node)439 if value is not None and 'size' not in already_processed:440 already_processed.append('size')441 try:442 self.size = int(value)443 except ValueError, exp:444 raise_parse_error(node, 'Bad integer attribute: %s' % exp)445 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):446 pass447# end class Attachment448class FlowElement(GeneratedsSuper):449 subclass = None450 superclass = None451 def __init__(self, id=None, extensiontype_=None):452 self.id = _cast(None, id)453 self.extensiontype_ = extensiontype_454 def factory(*args_, **kwargs_):455 if FlowElement.subclass:456 return FlowElement.subclass(*args_, **kwargs_)457 else:458 return FlowElement(*args_, **kwargs_)459 factory = staticmethod(factory)460 def get_id(self): return self.id461 def set_id(self, id): self.id = id462 def get_extensiontype_(self): return self.extensiontype_463 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_464 def export(self, outfile, level, namespace_='mstns:', name_='FlowElement', namespacedef_=''):465 showIndent(outfile, level)466 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))467 already_processed = []468 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FlowElement')469 if self.hasContent_():470 outfile.write('>\n')471 self.exportChildren(outfile, level + 1, namespace_, name_)472 outfile.write('</%s%s>\n' % (namespace_, name_))473 else:474 outfile.write('/>\n')475 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='FlowElement'):476 if self.id is not None and 'id' not in already_processed:477 already_processed.append('id')478 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'),))479 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:480 already_processed.append('xsi:type')481 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')482 outfile.write(' xsi:type="%s"' % self.extensiontype_)483 def exportChildren(self, outfile, level, namespace_='mstns:', name_='FlowElement', fromsubclass_=False):484 pass485 def hasContent_(self):486 if (487 ):488 return True489 else:490 return False491 def exportLiteral(self, outfile, level, name_='FlowElement'):492 level += 1493 self.exportLiteralAttributes(outfile, level, [], name_)494 if self.hasContent_():495 self.exportLiteralChildren(outfile, level, name_)496 def exportLiteralAttributes(self, outfile, level, already_processed, name_):497 if self.id is not None and 'id' not in already_processed:498 already_processed.append('id')499 showIndent(outfile, level)500 outfile.write('id = "%s",\n' % (self.id,))501 def exportLiteralChildren(self, outfile, level, name_):502 pass503 def build(self, node):504 self.buildAttributes(node, node.attrib, [])505 for child in node:506 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]507 self.buildChildren(child, node, nodeName_)508 def buildAttributes(self, node, attrs, already_processed):509 value = find_attr_value_('id', node)510 if value is not None and 'id' not in already_processed:511 already_processed.append('id')512 self.id = value513 value = find_attr_value_('xsi:type', node)514 if value is not None and 'xsi:type' not in already_processed:515 already_processed.append('xsi:type')516 self.extensiontype_ = value517 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):518 pass519# end class FlowElement520class Answer(GeneratedsSuper):521 subclass = None522 superclass = None523 def __init__(self, action=None, caption=None, id=None, reference=None):524 self.action = _cast(None, action)525 self.caption = _cast(None, caption)526 self.id = _cast(None, id)527 self.reference = _cast(None, reference)528 pass529 def factory(*args_, **kwargs_):530 if Answer.subclass:531 return Answer.subclass(*args_, **kwargs_)532 else:533 return Answer(*args_, **kwargs_)534 factory = staticmethod(factory)535 def get_action(self): return self.action536 def set_action(self, action): self.action = action537 def get_caption(self): return self.caption538 def set_caption(self, caption): self.caption = caption539 def get_id(self): return self.id540 def set_id(self, id): self.id = id541 def get_reference(self): return self.reference542 def set_reference(self, reference): self.reference = reference543 def export(self, outfile, level, namespace_='mstns:', name_='Answer', namespacedef_=''):544 showIndent(outfile, level)545 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))546 already_processed = []547 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Answer')548 if self.hasContent_():549 outfile.write('>\n')550 self.exportChildren(outfile, level + 1, namespace_, name_)551 outfile.write('</%s%s>\n' % (namespace_, name_))552 else:553 outfile.write('/>\n')554 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Answer'):555 if self.action is not None and 'action' not in already_processed:556 already_processed.append('action')557 outfile.write(' action=%s' % (self.gds_format_string(quote_attrib(self.action).encode(ExternalEncoding), input_name='action'),))558 if self.caption is not None and 'caption' not in already_processed:559 already_processed.append('caption')560 outfile.write(' caption=%s' % (self.gds_format_string(quote_attrib(self.caption).encode(ExternalEncoding), input_name='caption'),))561 if self.id is not None and 'id' not in already_processed:562 already_processed.append('id')563 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'),))564 if self.reference is not None and 'reference' not in already_processed:565 already_processed.append('reference')566 outfile.write(' reference=%s' % (self.gds_format_string(quote_attrib(self.reference).encode(ExternalEncoding), input_name='reference'),))567 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Answer', fromsubclass_=False):568 pass569 def hasContent_(self):570 if (571 ):572 return True573 else:574 return False575 def exportLiteral(self, outfile, level, name_='Answer'):576 level += 1577 self.exportLiteralAttributes(outfile, level, [], name_)578 if self.hasContent_():579 self.exportLiteralChildren(outfile, level, name_)580 def exportLiteralAttributes(self, outfile, level, already_processed, name_):581 if self.action is not None and 'action' not in already_processed:582 already_processed.append('action')583 showIndent(outfile, level)584 outfile.write('action = "%s",\n' % (self.action,))585 if self.caption is not None and 'caption' not in already_processed:586 already_processed.append('caption')587 showIndent(outfile, level)588 outfile.write('caption = "%s",\n' % (self.caption,))589 if self.id is not None and 'id' not in already_processed:590 already_processed.append('id')591 showIndent(outfile, level)592 outfile.write('id = "%s",\n' % (self.id,))593 if self.reference is not None and 'reference' not in already_processed:594 already_processed.append('reference')595 showIndent(outfile, level)596 outfile.write('reference = "%s",\n' % (self.reference,))597 def exportLiteralChildren(self, outfile, level, name_):598 pass599 def build(self, node):600 self.buildAttributes(node, node.attrib, [])601 for child in node:602 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]603 self.buildChildren(child, node, nodeName_)604 def buildAttributes(self, node, attrs, already_processed):605 value = find_attr_value_('action', node)606 if value is not None and 'action' not in already_processed:607 already_processed.append('action')608 self.action = value609 value = find_attr_value_('caption', node)610 if value is not None and 'caption' not in already_processed:611 already_processed.append('caption')612 self.caption = value613 value = find_attr_value_('id', node)614 if value is not None and 'id' not in already_processed:615 already_processed.append('id')616 self.id = value617 value = find_attr_value_('reference', node)618 if value is not None and 'reference' not in already_processed:619 already_processed.append('reference')620 self.reference = value621 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):622 pass623# end class Answer624class Message(FlowElement):625 subclass = None626 superclass = FlowElement627 def __init__(self, id=None, alertIntervalType=None, alertType=None, brandingKey=None, allowDismiss=None, vibrate=None, dismissReference=None, autoLock=None, content=None, answer=None, attachment=None):628 super(Message, self).__init__(id,)629 self.alertIntervalType = _cast(None, alertIntervalType)630 self.alertType = _cast(None, alertType)631 self.brandingKey = _cast(None, brandingKey)632 self.allowDismiss = _cast(bool, allowDismiss)633 self.vibrate = _cast(bool, vibrate)634 self.dismissReference = _cast(None, dismissReference)635 self.autoLock = _cast(bool, autoLock)636 self.content = content637 if answer is None:638 self.answer = []639 else:640 self.answer = answer641 if attachment is None:642 self.attachment = []643 else:644 self.attachment = attachment645 def factory(*args_, **kwargs_):646 if Message.subclass:647 return Message.subclass(*args_, **kwargs_)648 else:649 return Message(*args_, **kwargs_)650 factory = staticmethod(factory)651 def get_content(self): return self.content652 def set_content(self, content): self.content = content653 def get_answer(self): return self.answer654 def set_answer(self, answer): self.answer = answer655 def add_answer(self, value): self.answer.append(value)656 def insert_answer(self, index, value): self.answer[index] = value657 def get_attachment(self): return self.attachment658 def set_attachment(self, attachment): self.attachment = attachment659 def add_attachment(self, value): self.attachment.append(value)660 def insert_attachment(self, index, value): self.attachment[index] = value661 def get_alertIntervalType(self): return self.alertIntervalType662 def set_alertIntervalType(self, alertIntervalType): self.alertIntervalType = alertIntervalType663 def validate_AlertIntervalType(self, value):664 # Validate type AlertIntervalType, a restriction on xs:string.665 pass666 def get_alertType(self): return self.alertType667 def set_alertType(self, alertType): self.alertType = alertType668 def validate_AlertType(self, value):669 # Validate type AlertType, a restriction on xs:string.670 pass671 def get_brandingKey(self): return self.brandingKey672 def set_brandingKey(self, brandingKey): self.brandingKey = brandingKey673 def get_allowDismiss(self): return self.allowDismiss674 def set_allowDismiss(self, allowDismiss): self.allowDismiss = allowDismiss675 def get_vibrate(self): return self.vibrate676 def set_vibrate(self, vibrate): self.vibrate = vibrate677 def get_dismissReference(self): return self.dismissReference678 def set_dismissReference(self, dismissReference): self.dismissReference = dismissReference679 def get_autoLock(self): return self.autoLock680 def set_autoLock(self, autoLock): self.autoLock = autoLock681 def export(self, outfile, level, namespace_='mstns:', name_='Message', namespacedef_=''):682 showIndent(outfile, level)683 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))684 already_processed = []685 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Message')686 if self.hasContent_():687 outfile.write('>\n')688 self.exportChildren(outfile, level + 1, namespace_, name_)689 showIndent(outfile, level)690 outfile.write('</%s%s>\n' % (namespace_, name_))691 else:692 outfile.write('/>\n')693 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Message'):694 super(Message, self).exportAttributes(outfile, level, already_processed, namespace_, name_='Message')695 if self.alertIntervalType is not None and 'alertIntervalType' not in already_processed:696 already_processed.append('alertIntervalType')697 outfile.write(' alertIntervalType=%s' % (quote_attrib(self.alertIntervalType),))698 if self.alertType is not None and 'alertType' not in already_processed:699 already_processed.append('alertType')700 outfile.write(' alertType=%s' % (quote_attrib(self.alertType),))701 if self.brandingKey is not None and 'brandingKey' not in already_processed:702 already_processed.append('brandingKey')703 outfile.write(' brandingKey=%s' % (self.gds_format_string(quote_attrib(self.brandingKey).encode(ExternalEncoding), input_name='brandingKey'),))704 if self.allowDismiss is not None and 'allowDismiss' not in already_processed:705 already_processed.append('allowDismiss')706 outfile.write(' allowDismiss="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.allowDismiss)), input_name='allowDismiss'))707 if self.vibrate is not None and 'vibrate' not in already_processed:708 already_processed.append('vibrate')709 outfile.write(' vibrate="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.vibrate)), input_name='vibrate'))710 if self.dismissReference is not None and 'dismissReference' not in already_processed:711 already_processed.append('dismissReference')712 outfile.write(' dismissReference=%s' % (self.gds_format_string(quote_attrib(self.dismissReference).encode(ExternalEncoding), input_name='dismissReference'),))713 if self.autoLock is not None and 'autoLock' not in already_processed:714 already_processed.append('autoLock')715 outfile.write(' autoLock="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.autoLock)), input_name='autoLock'))716 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Message', fromsubclass_=False):717 super(Message, self).exportChildren(outfile, level, namespace_, name_, True)718 if self.content is not None:719 self.content.export(outfile, level, namespace_, name_='content',)720 for answer_ in self.answer:721 answer_.export(outfile, level, namespace_, name_='answer')722 for attachment_ in self.attachment:723 attachment_.export(outfile, level, namespace_, name_='attachment')724 def hasContent_(self):725 if (726 self.content is not None or727 self.answer or728 self.attachment or729 super(Message, self).hasContent_()730 ):731 return True732 else:733 return False734 def exportLiteral(self, outfile, level, name_='Message'):735 level += 1736 self.exportLiteralAttributes(outfile, level, [], name_)737 if self.hasContent_():738 self.exportLiteralChildren(outfile, level, name_)739 def exportLiteralAttributes(self, outfile, level, already_processed, name_):740 if self.alertIntervalType is not None and 'alertIntervalType' not in already_processed:741 already_processed.append('alertIntervalType')742 showIndent(outfile, level)743 outfile.write('alertIntervalType = "%s",\n' % (self.alertIntervalType,))744 if self.alertType is not None and 'alertType' not in already_processed:745 already_processed.append('alertType')746 showIndent(outfile, level)747 outfile.write('alertType = "%s",\n' % (self.alertType,))748 if self.brandingKey is not None and 'brandingKey' not in already_processed:749 already_processed.append('brandingKey')750 showIndent(outfile, level)751 outfile.write('brandingKey = "%s",\n' % (self.brandingKey,))752 if self.allowDismiss is not None and 'allowDismiss' not in already_processed:753 already_processed.append('allowDismiss')754 showIndent(outfile, level)755 outfile.write('allowDismiss = %s,\n' % (self.allowDismiss,))756 if self.vibrate is not None and 'vibrate' not in already_processed:757 already_processed.append('vibrate')758 showIndent(outfile, level)759 outfile.write('vibrate = %s,\n' % (self.vibrate,))760 if self.dismissReference is not None and 'dismissReference' not in already_processed:761 already_processed.append('dismissReference')762 showIndent(outfile, level)763 outfile.write('dismissReference = "%s",\n' % (self.dismissReference,))764 if self.autoLock is not None and 'autoLock' not in already_processed:765 already_processed.append('autoLock')766 showIndent(outfile, level)767 outfile.write('autoLock = %s,\n' % (self.autoLock,))768 super(Message, self).exportLiteralAttributes(outfile, level, already_processed, name_)769 def exportLiteralChildren(self, outfile, level, name_):770 super(Message, self).exportLiteralChildren(outfile, level, name_)771 if self.content is not None:772 showIndent(outfile, level)773 outfile.write('content=model_.contentType(\n')774 self.content.exportLiteral(outfile, level, name_='content')775 showIndent(outfile, level)776 outfile.write('),\n')777 showIndent(outfile, level)778 outfile.write('answer=[\n')779 level += 1780 for answer_ in self.answer:781 showIndent(outfile, level)782 outfile.write('model_.Answer(\n')783 answer_.exportLiteral(outfile, level, name_='Answer')784 showIndent(outfile, level)785 outfile.write('),\n')786 level -= 1787 showIndent(outfile, level)788 outfile.write('],\n')789 showIndent(outfile, level)790 outfile.write('attachment=[\n')791 level += 1792 for attachment_ in self.attachment:793 showIndent(outfile, level)794 outfile.write('model_.Attachment(\n')795 attachment_.exportLiteral(outfile, level, name_='Attachment')796 showIndent(outfile, level)797 outfile.write('),\n')798 level -= 1799 showIndent(outfile, level)800 outfile.write('],\n')801 def build(self, node):802 self.buildAttributes(node, node.attrib, [])803 for child in node:804 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]805 self.buildChildren(child, node, nodeName_)806 def buildAttributes(self, node, attrs, already_processed):807 value = find_attr_value_('alertIntervalType', node)808 if value is not None and 'alertIntervalType' not in already_processed:809 already_processed.append('alertIntervalType')810 self.alertIntervalType = value811 self.validate_AlertIntervalType(self.alertIntervalType) # validate type AlertIntervalType812 value = find_attr_value_('alertType', node)813 if value is not None and 'alertType' not in already_processed:814 already_processed.append('alertType')815 self.alertType = value816 self.validate_AlertType(self.alertType) # validate type AlertType817 value = find_attr_value_('brandingKey', node)818 if value is not None and 'brandingKey' not in already_processed:819 already_processed.append('brandingKey')820 self.brandingKey = value821 value = find_attr_value_('allowDismiss', node)822 if value is not None and 'allowDismiss' not in already_processed:823 already_processed.append('allowDismiss')824 if value in ('true', '1'):825 self.allowDismiss = True826 elif value in ('false', '0'):827 self.allowDismiss = False828 else:829 raise_parse_error(node, 'Bad boolean attribute')830 value = find_attr_value_('vibrate', node)831 if value is not None and 'vibrate' not in already_processed:832 already_processed.append('vibrate')833 if value in ('true', '1'):834 self.vibrate = True835 elif value in ('false', '0'):836 self.vibrate = False837 else:838 raise_parse_error(node, 'Bad boolean attribute')839 value = find_attr_value_('dismissReference', node)840 if value is not None and 'dismissReference' not in already_processed:841 already_processed.append('dismissReference')842 self.dismissReference = value843 value = find_attr_value_('autoLock', node)844 if value is not None and 'autoLock' not in already_processed:845 already_processed.append('autoLock')846 if value in ('true', '1'):847 self.autoLock = True848 elif value in ('false', '0'):849 self.autoLock = False850 else:851 raise_parse_error(node, 'Bad boolean attribute')852 super(Message, self).buildAttributes(node, attrs, already_processed)853 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):854 if nodeName_ == 'content':855 obj_ = contentType.factory()856 obj_.build(child_)857 self.set_content(obj_)858 elif nodeName_ == 'answer':859 obj_ = Answer.factory()860 obj_.build(child_)861 self.answer.append(obj_)862 elif nodeName_ == 'attachment':863 obj_ = Attachment.factory()864 obj_.build(child_)865 self.attachment.append(obj_)866 super(Message, self).buildChildren(child_, node, nodeName_, True)867# end class Message868class ResultsFlush(FlowElement):869 subclass = None870 superclass = FlowElement871 def __init__(self, id=None, reference=None):872 super(ResultsFlush, self).__init__(id,)873 self.reference = _cast(None, reference)874 pass875 def factory(*args_, **kwargs_):876 if ResultsFlush.subclass:877 return ResultsFlush.subclass(*args_, **kwargs_)878 else:879 return ResultsFlush(*args_, **kwargs_)880 factory = staticmethod(factory)881 def get_reference(self): return self.reference882 def set_reference(self, reference): self.reference = reference883 def export(self, outfile, level, namespace_='mstns:', name_='ResultsFlush', namespacedef_=''):884 showIndent(outfile, level)885 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))886 already_processed = []887 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResultsFlush')888 if self.hasContent_():889 outfile.write('>\n')890 self.exportChildren(outfile, level + 1, namespace_, name_)891 outfile.write('</%s%s>\n' % (namespace_, name_))892 else:893 outfile.write('/>\n')894 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='ResultsFlush'):895 super(ResultsFlush, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ResultsFlush')896 if self.reference is not None and 'reference' not in already_processed:897 already_processed.append('reference')898 outfile.write(' reference=%s' % (self.gds_format_string(quote_attrib(self.reference).encode(ExternalEncoding), input_name='reference'),))899 def exportChildren(self, outfile, level, namespace_='mstns:', name_='ResultsFlush', fromsubclass_=False):900 super(ResultsFlush, self).exportChildren(outfile, level, namespace_, name_, True)901 pass902 def hasContent_(self):903 if (904 super(ResultsFlush, self).hasContent_()905 ):906 return True907 else:908 return False909 def exportLiteral(self, outfile, level, name_='ResultsFlush'):910 level += 1911 self.exportLiteralAttributes(outfile, level, [], name_)912 if self.hasContent_():913 self.exportLiteralChildren(outfile, level, name_)914 def exportLiteralAttributes(self, outfile, level, already_processed, name_):915 if self.reference is not None and 'reference' not in already_processed:916 already_processed.append('reference')917 showIndent(outfile, level)918 outfile.write('reference = "%s",\n' % (self.reference,))919 super(ResultsFlush, self).exportLiteralAttributes(outfile, level, already_processed, name_)920 def exportLiteralChildren(self, outfile, level, name_):921 super(ResultsFlush, self).exportLiteralChildren(outfile, level, name_)922 pass923 def build(self, node):924 self.buildAttributes(node, node.attrib, [])925 for child in node:926 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]927 self.buildChildren(child, node, nodeName_)928 def buildAttributes(self, node, attrs, already_processed):929 value = find_attr_value_('reference', node)930 if value is not None and 'reference' not in already_processed:931 already_processed.append('reference')932 self.reference = value933 super(ResultsFlush, self).buildAttributes(node, attrs, already_processed)934 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):935 super(ResultsFlush, self).buildChildren(child_, node, nodeName_, True)936 pass937# end class ResultsFlush938class ResultsEmail(FlowElement):939 subclass = None940 superclass = FlowElement941 def __init__(self, id=None, reference=None, emailAdmins=None, email=None):942 super(ResultsEmail, self).__init__(id,)943 self.reference = _cast(None, reference)944 self.emailAdmins = _cast(bool, emailAdmins)945 if email is None:946 self.email = []947 else:948 self.email = email949 def factory(*args_, **kwargs_):950 if ResultsEmail.subclass:951 return ResultsEmail.subclass(*args_, **kwargs_)952 else:953 return ResultsEmail(*args_, **kwargs_)954 factory = staticmethod(factory)955 def get_email(self): return self.email956 def set_email(self, email): self.email = email957 def add_email(self, value): self.email.append(value)958 def insert_email(self, index, value): self.email[index] = value959 def get_reference(self): return self.reference960 def set_reference(self, reference): self.reference = reference961 def get_emailAdmins(self): return self.emailAdmins962 def set_emailAdmins(self, emailAdmins): self.emailAdmins = emailAdmins963 def export(self, outfile, level, namespace_='mstns:', name_='ResultsEmail', namespacedef_=''):964 showIndent(outfile, level)965 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))966 already_processed = []967 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResultsEmail')968 if self.hasContent_():969 outfile.write('>\n')970 self.exportChildren(outfile, level + 1, namespace_, name_)971 showIndent(outfile, level)972 outfile.write('</%s%s>\n' % (namespace_, name_))973 else:974 outfile.write('/>\n')975 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='ResultsEmail'):976 super(ResultsEmail, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ResultsEmail')977 if self.reference is not None and 'reference' not in already_processed:978 already_processed.append('reference')979 outfile.write(' reference=%s' % (self.gds_format_string(quote_attrib(self.reference).encode(ExternalEncoding), input_name='reference'),))980 if self.emailAdmins is not None and 'emailAdmins' not in already_processed:981 already_processed.append('emailAdmins')982 outfile.write(' emailAdmins="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.emailAdmins)), input_name='emailAdmins'))983 def exportChildren(self, outfile, level, namespace_='mstns:', name_='ResultsEmail', fromsubclass_=False):984 super(ResultsEmail, self).exportChildren(outfile, level, namespace_, name_, True)985 for email_ in self.email:986 email_.export(outfile, level, namespace_, name_='email')987 def hasContent_(self):988 if (989 self.email or990 super(ResultsEmail, self).hasContent_()991 ):992 return True993 else:994 return False995 def exportLiteral(self, outfile, level, name_='ResultsEmail'):996 level += 1997 self.exportLiteralAttributes(outfile, level, [], name_)998 if self.hasContent_():999 self.exportLiteralChildren(outfile, level, name_)1000 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1001 if self.reference is not None and 'reference' not in already_processed:1002 already_processed.append('reference')1003 showIndent(outfile, level)1004 outfile.write('reference = "%s",\n' % (self.reference,))1005 if self.emailAdmins is not None and 'emailAdmins' not in already_processed:1006 already_processed.append('emailAdmins')1007 showIndent(outfile, level)1008 outfile.write('emailAdmins = %s,\n' % (self.emailAdmins,))1009 super(ResultsEmail, self).exportLiteralAttributes(outfile, level, already_processed, name_)1010 def exportLiteralChildren(self, outfile, level, name_):1011 super(ResultsEmail, self).exportLiteralChildren(outfile, level, name_)1012 showIndent(outfile, level)1013 outfile.write('email=[\n')1014 level += 11015 for email_ in self.email:1016 showIndent(outfile, level)1017 outfile.write('model_.Value(\n')1018 email_.exportLiteral(outfile, level, name_='Value')1019 showIndent(outfile, level)1020 outfile.write('),\n')1021 level -= 11022 showIndent(outfile, level)1023 outfile.write('],\n')1024 def build(self, node):1025 self.buildAttributes(node, node.attrib, [])1026 for child in node:1027 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1028 self.buildChildren(child, node, nodeName_)1029 def buildAttributes(self, node, attrs, already_processed):1030 value = find_attr_value_('reference', node)1031 if value is not None and 'reference' not in already_processed:1032 already_processed.append('reference')1033 self.reference = value1034 value = find_attr_value_('emailAdmins', node)1035 if value is not None and 'emailAdmins' not in already_processed:1036 already_processed.append('emailAdmins')1037 if value in ('true', '1'):1038 self.emailAdmins = True1039 elif value in ('false', '0'):1040 self.emailAdmins = False1041 else:1042 raise_parse_error(node, 'Bad boolean attribute')1043 super(ResultsEmail, self).buildAttributes(node, attrs, already_processed)1044 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1045 if nodeName_ == 'email':1046 class_obj_ = self.get_class_obj_(child_, Value)1047 obj_ = class_obj_.factory()1048 obj_.build(child_)1049 self.email.append(obj_)1050 super(ResultsEmail, self).buildChildren(child_, node, nodeName_, True)1051# end class ResultsEmail1052class FlowCode(FlowElement):1053 subclass = None1054 superclass = FlowElement1055 def __init__(self, id=None, exceptionReference=None, outlet=None, javascriptCode=None):1056 super(FlowCode, self).__init__(id,)1057 self.exceptionReference = _cast(None, exceptionReference)1058 if outlet is None:1059 self.outlet = []1060 else:1061 self.outlet = outlet1062 self.javascriptCode = javascriptCode1063 def factory(*args_, **kwargs_):1064 if FlowCode.subclass:1065 return FlowCode.subclass(*args_, **kwargs_)1066 else:1067 return FlowCode(*args_, **kwargs_)1068 factory = staticmethod(factory)1069 def get_outlet(self): return self.outlet1070 def set_outlet(self, outlet): self.outlet = outlet1071 def add_outlet(self, value): self.outlet.append(value)1072 def insert_outlet(self, index, value): self.outlet[index] = value1073 def get_javascriptCode(self): return self.javascriptCode1074 def set_javascriptCode(self, javascriptCode): self.javascriptCode = javascriptCode1075 def get_exceptionReference(self): return self.exceptionReference1076 def set_exceptionReference(self, exceptionReference): self.exceptionReference = exceptionReference1077 def export(self, outfile, level, namespace_='mstns:', name_='FlowCode', namespacedef_=''):1078 showIndent(outfile, level)1079 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1080 already_processed = []1081 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FlowCode')1082 if self.hasContent_():1083 outfile.write('>\n')1084 self.exportChildren(outfile, level + 1, namespace_, name_)1085 showIndent(outfile, level)1086 outfile.write('</%s%s>\n' % (namespace_, name_))1087 else:1088 outfile.write('/>\n')1089 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='FlowCode'):1090 super(FlowCode, self).exportAttributes(outfile, level, already_processed, namespace_, name_='FlowCode')1091 if self.exceptionReference is not None and 'exceptionReference' not in already_processed:1092 already_processed.append('exceptionReference')1093 outfile.write(' exceptionReference=%s' % (self.gds_format_string(quote_attrib(self.exceptionReference).encode(ExternalEncoding), input_name='exceptionReference'),))1094 def exportChildren(self, outfile, level, namespace_='mstns:', name_='FlowCode', fromsubclass_=False):1095 super(FlowCode, self).exportChildren(outfile, level, namespace_, name_, True)1096 for outlet_ in self.outlet:1097 outlet_.export(outfile, level, namespace_, name_='outlet')1098 if self.javascriptCode is not None:1099 self.javascriptCode.export(outfile, level, namespace_, name_='javascriptCode',)1100 def hasContent_(self):1101 if (1102 self.outlet or1103 self.javascriptCode is not None or1104 super(FlowCode, self).hasContent_()1105 ):1106 return True1107 else:1108 return False1109 def exportLiteral(self, outfile, level, name_='FlowCode'):1110 level += 11111 self.exportLiteralAttributes(outfile, level, [], name_)1112 if self.hasContent_():1113 self.exportLiteralChildren(outfile, level, name_)1114 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1115 if self.exceptionReference is not None and 'exceptionReference' not in already_processed:1116 already_processed.append('exceptionReference')1117 showIndent(outfile, level)1118 outfile.write('exceptionReference = "%s",\n' % (self.exceptionReference,))1119 super(FlowCode, self).exportLiteralAttributes(outfile, level, already_processed, name_)1120 def exportLiteralChildren(self, outfile, level, name_):1121 super(FlowCode, self).exportLiteralChildren(outfile, level, name_)1122 showIndent(outfile, level)1123 outfile.write('outlet=[\n')1124 level += 11125 for outlet_ in self.outlet:1126 showIndent(outfile, level)1127 outfile.write('model_.Outlet(\n')1128 outlet_.exportLiteral(outfile, level, name_='Outlet')1129 showIndent(outfile, level)1130 outfile.write('),\n')1131 level -= 11132 showIndent(outfile, level)1133 outfile.write('],\n')1134 if self.javascriptCode is not None:1135 showIndent(outfile, level)1136 outfile.write('javascriptCode=model_.javascriptCodeType(\n')1137 self.javascriptCode.exportLiteral(outfile, level, name_='javascriptCode')1138 showIndent(outfile, level)1139 outfile.write('),\n')1140 def build(self, node):1141 self.buildAttributes(node, node.attrib, [])1142 for child in node:1143 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1144 self.buildChildren(child, node, nodeName_)1145 def buildAttributes(self, node, attrs, already_processed):1146 value = find_attr_value_('exceptionReference', node)1147 if value is not None and 'exceptionReference' not in already_processed:1148 already_processed.append('exceptionReference')1149 self.exceptionReference = value1150 super(FlowCode, self).buildAttributes(node, attrs, already_processed)1151 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1152 if nodeName_ == 'outlet':1153 obj_ = Outlet.factory()1154 obj_.build(child_)1155 self.outlet.append(obj_)1156 elif nodeName_ == 'javascriptCode':1157 obj_ = javascriptCodeType.factory()1158 obj_.build(child_)1159 self.set_javascriptCode(obj_)1160 super(FlowCode, self).buildChildren(child_, node, nodeName_, True)1161# end class FlowCode1162class Widget(GeneratedsSuper):1163 subclass = None1164 superclass = None1165 def __init__(self, extensiontype_=None):1166 self.extensiontype_ = extensiontype_1167 def factory(*args_, **kwargs_):1168 if Widget.subclass:1169 return Widget.subclass(*args_, **kwargs_)1170 else:1171 return Widget(*args_, **kwargs_)1172 factory = staticmethod(factory)1173 def get_extensiontype_(self): return self.extensiontype_1174 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1175 def export(self, outfile, level, namespace_='mstns:', name_='Widget', namespacedef_=''):1176 showIndent(outfile, level)1177 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1178 already_processed = []1179 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Widget')1180 if self.hasContent_():1181 outfile.write('>\n')1182 self.exportChildren(outfile, level + 1, namespace_, name_)1183 outfile.write('</%s%s>\n' % (namespace_, name_))1184 else:1185 outfile.write('/>\n')1186 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Widget'):1187 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1188 already_processed.append('xsi:type')1189 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1190 outfile.write(' xsi:type="%s"' % self.extensiontype_)1191 pass1192 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Widget', fromsubclass_=False):1193 pass1194 def hasContent_(self):1195 if (1196 ):1197 return True1198 else:1199 return False1200 def exportLiteral(self, outfile, level, name_='Widget'):1201 level += 11202 self.exportLiteralAttributes(outfile, level, [], name_)1203 if self.hasContent_():1204 self.exportLiteralChildren(outfile, level, name_)1205 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1206 pass1207 def exportLiteralChildren(self, outfile, level, name_):1208 pass1209 def build(self, node):1210 self.buildAttributes(node, node.attrib, [])1211 for child in node:1212 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1213 self.buildChildren(child, node, nodeName_)1214 def buildAttributes(self, node, attrs, already_processed):1215 value = find_attr_value_('xsi:type', node)1216 if value is not None and 'xsi:type' not in already_processed:1217 already_processed.append('xsi:type')1218 self.extensiontype_ = value1219 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1220 pass1221# end class Widget1222class BaseSliderWidget(Widget):1223 subclass = None1224 superclass = Widget1225 def __init__(self, max=None, step=None, precision=None, unit=None, min=None, extensiontype_=None):1226 super(BaseSliderWidget, self).__init__(extensiontype_,)1227 self.max = _cast(float, max)1228 self.step = _cast(float, step)1229 self.precision = _cast(int, precision)1230 self.unit = _cast(None, unit)1231 self.min = _cast(float, min)1232 self.extensiontype_ = extensiontype_1233 def factory(*args_, **kwargs_):1234 if BaseSliderWidget.subclass:1235 return BaseSliderWidget.subclass(*args_, **kwargs_)1236 else:1237 return BaseSliderWidget(*args_, **kwargs_)1238 factory = staticmethod(factory)1239 def get_max(self): return self.max1240 def set_max(self, max): self.max = max1241 def get_step(self): return self.step1242 def set_step(self, step): self.step = step1243 def get_precision(self): return self.precision1244 def set_precision(self, precision): self.precision = precision1245 def get_unit(self): return self.unit1246 def set_unit(self, unit): self.unit = unit1247 def get_min(self): return self.min1248 def set_min(self, min): self.min = min1249 def get_extensiontype_(self): return self.extensiontype_1250 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1251 def export(self, outfile, level, namespace_='mstns:', name_='BaseSliderWidget', namespacedef_=''):1252 showIndent(outfile, level)1253 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1254 already_processed = []1255 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BaseSliderWidget')1256 if self.hasContent_():1257 outfile.write('>\n')1258 self.exportChildren(outfile, level + 1, namespace_, name_)1259 outfile.write('</%s%s>\n' % (namespace_, name_))1260 else:1261 outfile.write('/>\n')1262 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='BaseSliderWidget'):1263 super(BaseSliderWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BaseSliderWidget')1264 if self.max is not None and 'max' not in already_processed:1265 already_processed.append('max')1266 outfile.write(' max="%s"' % self.gds_format_float(self.max, input_name='max'))1267 if self.step is not None and 'step' not in already_processed:1268 already_processed.append('step')1269 outfile.write(' step="%s"' % self.gds_format_float(self.step, input_name='step'))1270 if self.precision is not None and 'precision' not in already_processed:1271 already_processed.append('precision')1272 outfile.write(' precision="%s"' % self.gds_format_integer(self.precision, input_name='precision'))1273 if self.unit is not None and 'unit' not in already_processed:1274 already_processed.append('unit')1275 outfile.write(' unit=%s' % (self.gds_format_string(quote_attrib(self.unit).encode(ExternalEncoding), input_name='unit'),))1276 if self.min is not None and 'min' not in already_processed:1277 already_processed.append('min')1278 outfile.write(' min="%s"' % self.gds_format_float(self.min, input_name='min'))1279 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1280 already_processed.append('xsi:type')1281 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1282 outfile.write(' xsi:type="%s"' % self.extensiontype_)1283 def exportChildren(self, outfile, level, namespace_='mstns:', name_='BaseSliderWidget', fromsubclass_=False):1284 super(BaseSliderWidget, self).exportChildren(outfile, level, namespace_, name_, True)1285 pass1286 def hasContent_(self):1287 if (1288 super(BaseSliderWidget, self).hasContent_()1289 ):1290 return True1291 else:1292 return False1293 def exportLiteral(self, outfile, level, name_='BaseSliderWidget'):1294 level += 11295 self.exportLiteralAttributes(outfile, level, [], name_)1296 if self.hasContent_():1297 self.exportLiteralChildren(outfile, level, name_)1298 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1299 if self.max is not None and 'max' not in already_processed:1300 already_processed.append('max')1301 showIndent(outfile, level)1302 outfile.write('max = %f,\n' % (self.max,))1303 if self.step is not None and 'step' not in already_processed:1304 already_processed.append('step')1305 showIndent(outfile, level)1306 outfile.write('step = %f,\n' % (self.step,))1307 if self.precision is not None and 'precision' not in already_processed:1308 already_processed.append('precision')1309 showIndent(outfile, level)1310 outfile.write('precision = %d,\n' % (self.precision,))1311 if self.unit is not None and 'unit' not in already_processed:1312 already_processed.append('unit')1313 showIndent(outfile, level)1314 outfile.write('unit = "%s",\n' % (self.unit,))1315 if self.min is not None and 'min' not in already_processed:1316 already_processed.append('min')1317 showIndent(outfile, level)1318 outfile.write('min = %f,\n' % (self.min,))1319 super(BaseSliderWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1320 def exportLiteralChildren(self, outfile, level, name_):1321 super(BaseSliderWidget, self).exportLiteralChildren(outfile, level, name_)1322 pass1323 def build(self, node):1324 self.buildAttributes(node, node.attrib, [])1325 for child in node:1326 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1327 self.buildChildren(child, node, nodeName_)1328 def buildAttributes(self, node, attrs, already_processed):1329 value = find_attr_value_('max', node)1330 if value is not None and 'max' not in already_processed:1331 already_processed.append('max')1332 try:1333 self.max = float(value)1334 except ValueError, exp:1335 raise ValueError('Bad float/double attribute (max): %s' % exp)1336 value = find_attr_value_('step', node)1337 if value is not None and 'step' not in already_processed:1338 already_processed.append('step')1339 try:1340 self.step = float(value)1341 except ValueError, exp:1342 raise ValueError('Bad float/double attribute (step): %s' % exp)1343 value = find_attr_value_('precision', node)1344 if value is not None and 'precision' not in already_processed:1345 already_processed.append('precision')1346 try:1347 self.precision = int(value)1348 except ValueError, exp:1349 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1350 value = find_attr_value_('unit', node)1351 if value is not None and 'unit' not in already_processed:1352 already_processed.append('unit')1353 self.unit = value1354 value = find_attr_value_('min', node)1355 if value is not None and 'min' not in already_processed:1356 already_processed.append('min')1357 try:1358 self.min = float(value)1359 except ValueError, exp:1360 raise ValueError('Bad float/double attribute (min): %s' % exp)1361 value = find_attr_value_('xsi:type', node)1362 if value is not None and 'xsi:type' not in already_processed:1363 already_processed.append('xsi:type')1364 self.extensiontype_ = value1365 super(BaseSliderWidget, self).buildAttributes(node, attrs, already_processed)1366 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1367 super(BaseSliderWidget, self).buildChildren(child_, node, nodeName_, True)1368 pass1369# end class BaseSliderWidget1370class SliderWidget(BaseSliderWidget):1371 subclass = None1372 superclass = BaseSliderWidget1373 def __init__(self, max=None, step=None, precision=None, unit=None, min=None, value=None):1374 super(SliderWidget, self).__init__(max, step, precision, unit, min,)1375 self.value = _cast(float, value)1376 pass1377 def factory(*args_, **kwargs_):1378 if SliderWidget.subclass:1379 return SliderWidget.subclass(*args_, **kwargs_)1380 else:1381 return SliderWidget(*args_, **kwargs_)1382 factory = staticmethod(factory)1383 def get_value(self): return self.value1384 def set_value(self, value): self.value = value1385 def export(self, outfile, level, namespace_='mstns:', name_='SliderWidget', namespacedef_=''):1386 showIndent(outfile, level)1387 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1388 already_processed = []1389 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SliderWidget')1390 if self.hasContent_():1391 outfile.write('>\n')1392 self.exportChildren(outfile, level + 1, namespace_, name_)1393 outfile.write('</%s%s>\n' % (namespace_, name_))1394 else:1395 outfile.write('/>\n')1396 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SliderWidget'):1397 super(SliderWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SliderWidget')1398 if self.value is not None and 'value' not in already_processed:1399 already_processed.append('value')1400 outfile.write(' value="%s"' % self.gds_format_float(self.value, input_name='value'))1401 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SliderWidget', fromsubclass_=False):1402 super(SliderWidget, self).exportChildren(outfile, level, namespace_, name_, True)1403 pass1404 def hasContent_(self):1405 if (1406 super(SliderWidget, self).hasContent_()1407 ):1408 return True1409 else:1410 return False1411 def exportLiteral(self, outfile, level, name_='SliderWidget'):1412 level += 11413 self.exportLiteralAttributes(outfile, level, [], name_)1414 if self.hasContent_():1415 self.exportLiteralChildren(outfile, level, name_)1416 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1417 if self.value is not None and 'value' not in already_processed:1418 already_processed.append('value')1419 showIndent(outfile, level)1420 outfile.write('value = %f,\n' % (self.value,))1421 super(SliderWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1422 def exportLiteralChildren(self, outfile, level, name_):1423 super(SliderWidget, self).exportLiteralChildren(outfile, level, name_)1424 pass1425 def build(self, node):1426 self.buildAttributes(node, node.attrib, [])1427 for child in node:1428 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1429 self.buildChildren(child, node, nodeName_)1430 def buildAttributes(self, node, attrs, already_processed):1431 value = find_attr_value_('value', node)1432 if value is not None and 'value' not in already_processed:1433 already_processed.append('value')1434 try:1435 self.value = float(value)1436 except ValueError, exp:1437 raise ValueError('Bad float/double attribute (value): %s' % exp)1438 super(SliderWidget, self).buildAttributes(node, attrs, already_processed)1439 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1440 super(SliderWidget, self).buildChildren(child_, node, nodeName_, True)1441 pass1442# end class SliderWidget1443class RangeSliderWidget(BaseSliderWidget):1444 subclass = None1445 superclass = BaseSliderWidget1446 def __init__(self, max=None, step=None, precision=None, unit=None, min=None, lowValue=None, highValue=None):1447 super(RangeSliderWidget, self).__init__(max, step, precision, unit, min,)1448 self.lowValue = _cast(float, lowValue)1449 self.highValue = _cast(float, highValue)1450 pass1451 def factory(*args_, **kwargs_):1452 if RangeSliderWidget.subclass:1453 return RangeSliderWidget.subclass(*args_, **kwargs_)1454 else:1455 return RangeSliderWidget(*args_, **kwargs_)1456 factory = staticmethod(factory)1457 def get_lowValue(self): return self.lowValue1458 def set_lowValue(self, lowValue): self.lowValue = lowValue1459 def get_highValue(self): return self.highValue1460 def set_highValue(self, highValue): self.highValue = highValue1461 def export(self, outfile, level, namespace_='mstns:', name_='RangeSliderWidget', namespacedef_=''):1462 showIndent(outfile, level)1463 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1464 already_processed = []1465 self.exportAttributes(outfile, level, already_processed, namespace_, name_='RangeSliderWidget')1466 if self.hasContent_():1467 outfile.write('>\n')1468 self.exportChildren(outfile, level + 1, namespace_, name_)1469 outfile.write('</%s%s>\n' % (namespace_, name_))1470 else:1471 outfile.write('/>\n')1472 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='RangeSliderWidget'):1473 super(RangeSliderWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RangeSliderWidget')1474 if self.lowValue is not None and 'lowValue' not in already_processed:1475 already_processed.append('lowValue')1476 outfile.write(' lowValue="%s"' % self.gds_format_float(self.lowValue, input_name='lowValue'))1477 if self.highValue is not None and 'highValue' not in already_processed:1478 already_processed.append('highValue')1479 outfile.write(' highValue="%s"' % self.gds_format_float(self.highValue, input_name='highValue'))1480 def exportChildren(self, outfile, level, namespace_='mstns:', name_='RangeSliderWidget', fromsubclass_=False):1481 super(RangeSliderWidget, self).exportChildren(outfile, level, namespace_, name_, True)1482 pass1483 def hasContent_(self):1484 if (1485 super(RangeSliderWidget, self).hasContent_()1486 ):1487 return True1488 else:1489 return False1490 def exportLiteral(self, outfile, level, name_='RangeSliderWidget'):1491 level += 11492 self.exportLiteralAttributes(outfile, level, [], name_)1493 if self.hasContent_():1494 self.exportLiteralChildren(outfile, level, name_)1495 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1496 if self.lowValue is not None and 'lowValue' not in already_processed:1497 already_processed.append('lowValue')1498 showIndent(outfile, level)1499 outfile.write('lowValue = %f,\n' % (self.lowValue,))1500 if self.highValue is not None and 'highValue' not in already_processed:1501 already_processed.append('highValue')1502 showIndent(outfile, level)1503 outfile.write('highValue = %f,\n' % (self.highValue,))1504 super(RangeSliderWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1505 def exportLiteralChildren(self, outfile, level, name_):1506 super(RangeSliderWidget, self).exportLiteralChildren(outfile, level, name_)1507 pass1508 def build(self, node):1509 self.buildAttributes(node, node.attrib, [])1510 for child in node:1511 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1512 self.buildChildren(child, node, nodeName_)1513 def buildAttributes(self, node, attrs, already_processed):1514 value = find_attr_value_('lowValue', node)1515 if value is not None and 'lowValue' not in already_processed:1516 already_processed.append('lowValue')1517 try:1518 self.lowValue = float(value)1519 except ValueError, exp:1520 raise ValueError('Bad float/double attribute (lowValue): %s' % exp)1521 value = find_attr_value_('highValue', node)1522 if value is not None and 'highValue' not in already_processed:1523 already_processed.append('highValue')1524 try:1525 self.highValue = float(value)1526 except ValueError, exp:1527 raise ValueError('Bad float/double attribute (highValue): %s' % exp)1528 super(RangeSliderWidget, self).buildAttributes(node, attrs, already_processed)1529 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1530 super(RangeSliderWidget, self).buildChildren(child_, node, nodeName_, True)1531 pass1532# end class RangeSliderWidget1533class PhotoUploadWidget(Widget):1534 subclass = None1535 superclass = Widget1536 def __init__(self, ratio=None, camera=None, quality=None, gallery=None):1537 super(PhotoUploadWidget, self).__init__()1538 self.ratio = _cast(None, ratio)1539 self.camera = _cast(bool, camera)1540 self.quality = _cast(None, quality)1541 self.gallery = _cast(bool, gallery)1542 pass1543 def factory(*args_, **kwargs_):1544 if PhotoUploadWidget.subclass:1545 return PhotoUploadWidget.subclass(*args_, **kwargs_)1546 else:1547 return PhotoUploadWidget(*args_, **kwargs_)1548 factory = staticmethod(factory)1549 def get_ratio(self): return self.ratio1550 def set_ratio(self, ratio): self.ratio = ratio1551 def get_camera(self): return self.camera1552 def set_camera(self, camera): self.camera = camera1553 def get_quality(self): return self.quality1554 def set_quality(self, quality): self.quality = quality1555 def get_gallery(self): return self.gallery1556 def set_gallery(self, gallery): self.gallery = gallery1557 def export(self, outfile, level, namespace_='mstns:', name_='PhotoUploadWidget', namespacedef_=''):1558 showIndent(outfile, level)1559 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1560 already_processed = []1561 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PhotoUploadWidget')1562 if self.hasContent_():1563 outfile.write('>\n')1564 self.exportChildren(outfile, level + 1, namespace_, name_)1565 outfile.write('</%s%s>\n' % (namespace_, name_))1566 else:1567 outfile.write('/>\n')1568 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='PhotoUploadWidget'):1569 super(PhotoUploadWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PhotoUploadWidget')1570 if self.ratio is not None and 'ratio' not in already_processed:1571 already_processed.append('ratio')1572 outfile.write(' ratio=%s' % (self.gds_format_string(quote_attrib(self.ratio).encode(ExternalEncoding), input_name='ratio'),))1573 if self.camera is not None and 'camera' not in already_processed:1574 already_processed.append('camera')1575 outfile.write(' camera="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.camera)), input_name='camera'))1576 if self.quality is not None and 'quality' not in already_processed:1577 already_processed.append('quality')1578 outfile.write(' quality=%s' % (self.gds_format_string(quote_attrib(self.quality).encode(ExternalEncoding), input_name='quality'),))1579 if self.gallery is not None and 'gallery' not in already_processed:1580 already_processed.append('gallery')1581 outfile.write(' gallery="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.gallery)), input_name='gallery'))1582 def exportChildren(self, outfile, level, namespace_='mstns:', name_='PhotoUploadWidget', fromsubclass_=False):1583 super(PhotoUploadWidget, self).exportChildren(outfile, level, namespace_, name_, True)1584 pass1585 def hasContent_(self):1586 if (1587 super(PhotoUploadWidget, self).hasContent_()1588 ):1589 return True1590 else:1591 return False1592 def exportLiteral(self, outfile, level, name_='PhotoUploadWidget'):1593 level += 11594 self.exportLiteralAttributes(outfile, level, [], name_)1595 if self.hasContent_():1596 self.exportLiteralChildren(outfile, level, name_)1597 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1598 if self.ratio is not None and 'ratio' not in already_processed:1599 already_processed.append('ratio')1600 showIndent(outfile, level)1601 outfile.write('ratio = "%s",\n' % (self.ratio,))1602 if self.camera is not None and 'camera' not in already_processed:1603 already_processed.append('camera')1604 showIndent(outfile, level)1605 outfile.write('camera = %s,\n' % (self.camera,))1606 if self.quality is not None and 'quality' not in already_processed:1607 already_processed.append('quality')1608 showIndent(outfile, level)1609 outfile.write('quality = "%s",\n' % (self.quality,))1610 if self.gallery is not None and 'gallery' not in already_processed:1611 already_processed.append('gallery')1612 showIndent(outfile, level)1613 outfile.write('gallery = %s,\n' % (self.gallery,))1614 super(PhotoUploadWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1615 def exportLiteralChildren(self, outfile, level, name_):1616 super(PhotoUploadWidget, self).exportLiteralChildren(outfile, level, name_)1617 pass1618 def build(self, node):1619 self.buildAttributes(node, node.attrib, [])1620 for child in node:1621 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1622 self.buildChildren(child, node, nodeName_)1623 def buildAttributes(self, node, attrs, already_processed):1624 value = find_attr_value_('ratio', node)1625 if value is not None and 'ratio' not in already_processed:1626 already_processed.append('ratio')1627 self.ratio = value1628 value = find_attr_value_('camera', node)1629 if value is not None and 'camera' not in already_processed:1630 already_processed.append('camera')1631 if value in ('true', '1'):1632 self.camera = True1633 elif value in ('false', '0'):1634 self.camera = False1635 else:1636 raise_parse_error(node, 'Bad boolean attribute')1637 value = find_attr_value_('quality', node)1638 if value is not None and 'quality' not in already_processed:1639 already_processed.append('quality')1640 self.quality = value1641 value = find_attr_value_('gallery', node)1642 if value is not None and 'gallery' not in already_processed:1643 already_processed.append('gallery')1644 if value in ('true', '1'):1645 self.gallery = True1646 elif value in ('false', '0'):1647 self.gallery = False1648 else:1649 raise_parse_error(node, 'Bad boolean attribute')1650 super(PhotoUploadWidget, self).buildAttributes(node, attrs, already_processed)1651 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1652 super(PhotoUploadWidget, self).buildChildren(child_, node, nodeName_, True)1653 pass1654# end class PhotoUploadWidget1655class GPSLocationWidget(Widget):1656 subclass = None1657 superclass = Widget1658 def __init__(self, gps=None):1659 super(GPSLocationWidget, self).__init__()1660 self.gps = _cast(bool, gps)1661 pass1662 def factory(*args_, **kwargs_):1663 if GPSLocationWidget.subclass:1664 return GPSLocationWidget.subclass(*args_, **kwargs_)1665 else:1666 return GPSLocationWidget(*args_, **kwargs_)1667 factory = staticmethod(factory)1668 def get_gps(self): return self.gps1669 def set_gps(self, gps): self.gps = gps1670 def export(self, outfile, level, namespace_='mstns:', name_='GPSLocationWidget', namespacedef_=''):1671 showIndent(outfile, level)1672 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1673 already_processed = []1674 self.exportAttributes(outfile, level, already_processed, namespace_, name_='GPSLocationWidget')1675 if self.hasContent_():1676 outfile.write('>\n')1677 self.exportChildren(outfile, level + 1, namespace_, name_)1678 outfile.write('</%s%s>\n' % (namespace_, name_))1679 else:1680 outfile.write('/>\n')1681 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='GPSLocationWidget'):1682 super(GPSLocationWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='GPSLocationWidget')1683 if self.gps is not None and 'gps' not in already_processed:1684 already_processed.append('gps')1685 outfile.write(' gps="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.gps)), input_name='gps'))1686 def exportChildren(self, outfile, level, namespace_='mstns:', name_='GPSLocationWidget', fromsubclass_=False):1687 super(GPSLocationWidget, self).exportChildren(outfile, level, namespace_, name_, True)1688 pass1689 def hasContent_(self):1690 if (1691 super(GPSLocationWidget, self).hasContent_()1692 ):1693 return True1694 else:1695 return False1696 def exportLiteral(self, outfile, level, name_='GPSLocationWidget'):1697 level += 11698 self.exportLiteralAttributes(outfile, level, [], name_)1699 if self.hasContent_():1700 self.exportLiteralChildren(outfile, level, name_)1701 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1702 if self.gps is not None and 'gps' not in already_processed:1703 already_processed.append('gps')1704 showIndent(outfile, level)1705 outfile.write('gps = %s,\n' % (self.gps,))1706 super(GPSLocationWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1707 def exportLiteralChildren(self, outfile, level, name_):1708 super(GPSLocationWidget, self).exportLiteralChildren(outfile, level, name_)1709 pass1710 def build(self, node):1711 self.buildAttributes(node, node.attrib, [])1712 for child in node:1713 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1714 self.buildChildren(child, node, nodeName_)1715 def buildAttributes(self, node, attrs, already_processed):1716 value = find_attr_value_('gps', node)1717 if value is not None and 'gps' not in already_processed:1718 already_processed.append('gps')1719 if value in ('true', '1'):1720 self.gps = True1721 elif value in ('false', '0'):1722 self.gps = False1723 else:1724 raise_parse_error(node, 'Bad boolean attribute')1725 super(GPSLocationWidget, self).buildAttributes(node, attrs, already_processed)1726 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1727 super(GPSLocationWidget, self).buildChildren(child_, node, nodeName_, True)1728 pass1729# end class GPSLocationWidget1730class TextWidget(Widget):1731 subclass = None1732 superclass = Widget1733 def __init__(self, maxChars=None, placeholder=None, value=None, extensiontype_=None):1734 super(TextWidget, self).__init__(extensiontype_,)1735 self.maxChars = _cast(int, maxChars)1736 self.placeholder = _cast(None, placeholder)1737 self.value = _cast(None, value)1738 self.extensiontype_ = extensiontype_1739 def factory(*args_, **kwargs_):1740 if TextWidget.subclass:1741 return TextWidget.subclass(*args_, **kwargs_)1742 else:1743 return TextWidget(*args_, **kwargs_)1744 factory = staticmethod(factory)1745 def get_maxChars(self): return self.maxChars1746 def set_maxChars(self, maxChars): self.maxChars = maxChars1747 def get_placeholder(self): return self.placeholder1748 def set_placeholder(self, placeholder): self.placeholder = placeholder1749 def get_value(self): return self.value1750 def set_value(self, value): self.value = value1751 def get_extensiontype_(self): return self.extensiontype_1752 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1753 def export(self, outfile, level, namespace_='mstns:', name_='TextWidget', namespacedef_=''):1754 showIndent(outfile, level)1755 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1756 already_processed = []1757 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TextWidget')1758 if self.hasContent_():1759 outfile.write('>\n')1760 self.exportChildren(outfile, level + 1, namespace_, name_)1761 outfile.write('</%s%s>\n' % (namespace_, name_))1762 else:1763 outfile.write('/>\n')1764 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='TextWidget'):1765 super(TextWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TextWidget')1766 if self.maxChars is not None and 'maxChars' not in already_processed:1767 already_processed.append('maxChars')1768 outfile.write(' maxChars="%s"' % self.gds_format_integer(self.maxChars, input_name='maxChars'))1769 if self.placeholder is not None and 'placeholder' not in already_processed:1770 already_processed.append('placeholder')1771 outfile.write(' placeholder=%s' % (self.gds_format_string(quote_attrib(self.placeholder).encode(ExternalEncoding), input_name='placeholder'),))1772 if self.value is not None and 'value' not in already_processed:1773 already_processed.append('value')1774 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))1775 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1776 already_processed.append('xsi:type')1777 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1778 outfile.write(' xsi:type="%s"' % self.extensiontype_)1779 def exportChildren(self, outfile, level, namespace_='mstns:', name_='TextWidget', fromsubclass_=False):1780 super(TextWidget, self).exportChildren(outfile, level, namespace_, name_, True)1781 pass1782 def hasContent_(self):1783 if (1784 super(TextWidget, self).hasContent_()1785 ):1786 return True1787 else:1788 return False1789 def exportLiteral(self, outfile, level, name_='TextWidget'):1790 level += 11791 self.exportLiteralAttributes(outfile, level, [], name_)1792 if self.hasContent_():1793 self.exportLiteralChildren(outfile, level, name_)1794 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1795 if self.maxChars is not None and 'maxChars' not in already_processed:1796 already_processed.append('maxChars')1797 showIndent(outfile, level)1798 outfile.write('maxChars = %d,\n' % (self.maxChars,))1799 if self.placeholder is not None and 'placeholder' not in already_processed:1800 already_processed.append('placeholder')1801 showIndent(outfile, level)1802 outfile.write('placeholder = "%s",\n' % (self.placeholder,))1803 if self.value is not None and 'value' not in already_processed:1804 already_processed.append('value')1805 showIndent(outfile, level)1806 outfile.write('value = "%s",\n' % (self.value,))1807 super(TextWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1808 def exportLiteralChildren(self, outfile, level, name_):1809 super(TextWidget, self).exportLiteralChildren(outfile, level, name_)1810 pass1811 def build(self, node):1812 self.buildAttributes(node, node.attrib, [])1813 for child in node:1814 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1815 self.buildChildren(child, node, nodeName_)1816 def buildAttributes(self, node, attrs, already_processed):1817 value = find_attr_value_('maxChars', node)1818 if value is not None and 'maxChars' not in already_processed:1819 already_processed.append('maxChars')1820 try:1821 self.maxChars = int(value)1822 except ValueError, exp:1823 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1824 value = find_attr_value_('placeholder', node)1825 if value is not None and 'placeholder' not in already_processed:1826 already_processed.append('placeholder')1827 self.placeholder = value1828 value = find_attr_value_('value', node)1829 if value is not None and 'value' not in already_processed:1830 already_processed.append('value')1831 self.value = value1832 value = find_attr_value_('xsi:type', node)1833 if value is not None and 'xsi:type' not in already_processed:1834 already_processed.append('xsi:type')1835 self.extensiontype_ = value1836 super(TextWidget, self).buildAttributes(node, attrs, already_processed)1837 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1838 super(TextWidget, self).buildChildren(child_, node, nodeName_, True)1839 pass1840# end class TextWidget1841class TextLineWidget(TextWidget):1842 subclass = None1843 superclass = TextWidget1844 def __init__(self, maxChars=None, placeholder=None, value=None):1845 super(TextLineWidget, self).__init__(maxChars, placeholder, value,)1846 pass1847 def factory(*args_, **kwargs_):1848 if TextLineWidget.subclass:1849 return TextLineWidget.subclass(*args_, **kwargs_)1850 else:1851 return TextLineWidget(*args_, **kwargs_)1852 factory = staticmethod(factory)1853 def export(self, outfile, level, namespace_='mstns:', name_='TextLineWidget', namespacedef_=''):1854 showIndent(outfile, level)1855 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1856 already_processed = []1857 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TextLineWidget')1858 if self.hasContent_():1859 outfile.write('>\n')1860 self.exportChildren(outfile, level + 1, namespace_, name_)1861 outfile.write('</%s%s>\n' % (namespace_, name_))1862 else:1863 outfile.write('/>\n')1864 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='TextLineWidget'):1865 super(TextLineWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TextLineWidget')1866 def exportChildren(self, outfile, level, namespace_='mstns:', name_='TextLineWidget', fromsubclass_=False):1867 super(TextLineWidget, self).exportChildren(outfile, level, namespace_, name_, True)1868 pass1869 def hasContent_(self):1870 if (1871 super(TextLineWidget, self).hasContent_()1872 ):1873 return True1874 else:1875 return False1876 def exportLiteral(self, outfile, level, name_='TextLineWidget'):1877 level += 11878 self.exportLiteralAttributes(outfile, level, [], name_)1879 if self.hasContent_():1880 self.exportLiteralChildren(outfile, level, name_)1881 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1882 super(TextLineWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1883 def exportLiteralChildren(self, outfile, level, name_):1884 super(TextLineWidget, self).exportLiteralChildren(outfile, level, name_)1885 pass1886 def build(self, node):1887 self.buildAttributes(node, node.attrib, [])1888 for child in node:1889 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1890 self.buildChildren(child, node, nodeName_)1891 def buildAttributes(self, node, attrs, already_processed):1892 super(TextLineWidget, self).buildAttributes(node, attrs, already_processed)1893 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1894 super(TextLineWidget, self).buildChildren(child_, node, nodeName_, True)1895 pass1896# end class TextLineWidget1897class TextBlockWidget(TextWidget):1898 subclass = None1899 superclass = TextWidget1900 def __init__(self, maxChars=None, placeholder=None, value=None):1901 super(TextBlockWidget, self).__init__(maxChars, placeholder, value,)1902 pass1903 def factory(*args_, **kwargs_):1904 if TextBlockWidget.subclass:1905 return TextBlockWidget.subclass(*args_, **kwargs_)1906 else:1907 return TextBlockWidget(*args_, **kwargs_)1908 factory = staticmethod(factory)1909 def export(self, outfile, level, namespace_='mstns:', name_='TextBlockWidget', namespacedef_=''):1910 showIndent(outfile, level)1911 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1912 already_processed = []1913 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TextBlockWidget')1914 if self.hasContent_():1915 outfile.write('>\n')1916 self.exportChildren(outfile, level + 1, namespace_, name_)1917 outfile.write('</%s%s>\n' % (namespace_, name_))1918 else:1919 outfile.write('/>\n')1920 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='TextBlockWidget'):1921 super(TextBlockWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TextBlockWidget')1922 def exportChildren(self, outfile, level, namespace_='mstns:', name_='TextBlockWidget', fromsubclass_=False):1923 super(TextBlockWidget, self).exportChildren(outfile, level, namespace_, name_, True)1924 pass1925 def hasContent_(self):1926 if (1927 super(TextBlockWidget, self).hasContent_()1928 ):1929 return True1930 else:1931 return False1932 def exportLiteral(self, outfile, level, name_='TextBlockWidget'):1933 level += 11934 self.exportLiteralAttributes(outfile, level, [], name_)1935 if self.hasContent_():1936 self.exportLiteralChildren(outfile, level, name_)1937 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1938 super(TextBlockWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)1939 def exportLiteralChildren(self, outfile, level, name_):1940 super(TextBlockWidget, self).exportLiteralChildren(outfile, level, name_)1941 pass1942 def build(self, node):1943 self.buildAttributes(node, node.attrib, [])1944 for child in node:1945 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1946 self.buildChildren(child, node, nodeName_)1947 def buildAttributes(self, node, attrs, already_processed):1948 super(TextBlockWidget, self).buildAttributes(node, attrs, already_processed)1949 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1950 super(TextBlockWidget, self).buildChildren(child_, node, nodeName_, True)1951 pass1952# end class TextBlockWidget1953class Value(GeneratedsSuper):1954 subclass = None1955 superclass = None1956 def __init__(self, value=None, extensiontype_=None):1957 self.value = _cast(None, value)1958 self.extensiontype_ = extensiontype_1959 def factory(*args_, **kwargs_):1960 if Value.subclass:1961 return Value.subclass(*args_, **kwargs_)1962 else:1963 return Value(*args_, **kwargs_)1964 factory = staticmethod(factory)1965 def get_value(self): return self.value1966 def set_value(self, value): self.value = value1967 def get_extensiontype_(self): return self.extensiontype_1968 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1969 def export(self, outfile, level, namespace_='mstns:', name_='Value', namespacedef_=''):1970 showIndent(outfile, level)1971 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))1972 already_processed = []1973 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Value')1974 if self.hasContent_():1975 outfile.write('>\n')1976 self.exportChildren(outfile, level + 1, namespace_, name_)1977 outfile.write('</%s%s>\n' % (namespace_, name_))1978 else:1979 outfile.write('/>\n')1980 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Value'):1981 if self.value is not None and 'value' not in already_processed:1982 already_processed.append('value')1983 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))1984 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1985 already_processed.append('xsi:type')1986 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1987 outfile.write(' xsi:type="%s"' % self.extensiontype_)1988 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Value', fromsubclass_=False):1989 pass1990 def hasContent_(self):1991 if (1992 ):1993 return True1994 else:1995 return False1996 def exportLiteral(self, outfile, level, name_='Value'):1997 level += 11998 self.exportLiteralAttributes(outfile, level, [], name_)1999 if self.hasContent_():2000 self.exportLiteralChildren(outfile, level, name_)2001 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2002 if self.value is not None and 'value' not in already_processed:2003 already_processed.append('value')2004 showIndent(outfile, level)2005 outfile.write('value = "%s",\n' % (self.value,))2006 def exportLiteralChildren(self, outfile, level, name_):2007 pass2008 def build(self, node):2009 self.buildAttributes(node, node.attrib, [])2010 for child in node:2011 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2012 self.buildChildren(child, node, nodeName_)2013 def buildAttributes(self, node, attrs, already_processed):2014 value = find_attr_value_('value', node)2015 if value is not None and 'value' not in already_processed:2016 already_processed.append('value')2017 self.value = value2018 value = find_attr_value_('xsi:type', node)2019 if value is not None and 'xsi:type' not in already_processed:2020 already_processed.append('xsi:type')2021 self.extensiontype_ = value2022 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2023 pass2024# end class Value2025class FloatValue(GeneratedsSuper):2026 subclass = None2027 superclass = None2028 def __init__(self, value=None):2029 self.value = _cast(float, value)2030 pass2031 def factory(*args_, **kwargs_):2032 if FloatValue.subclass:2033 return FloatValue.subclass(*args_, **kwargs_)2034 else:2035 return FloatValue(*args_, **kwargs_)2036 factory = staticmethod(factory)2037 def get_value(self): return self.value2038 def set_value(self, value): self.value = value2039 def export(self, outfile, level, namespace_='mstns:', name_='FloatValue', namespacedef_=''):2040 showIndent(outfile, level)2041 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2042 already_processed = []2043 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FloatValue')2044 if self.hasContent_():2045 outfile.write('>\n')2046 self.exportChildren(outfile, level + 1, namespace_, name_)2047 outfile.write('</%s%s>\n' % (namespace_, name_))2048 else:2049 outfile.write('/>\n')2050 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='FloatValue'):2051 if self.value is not None and 'value' not in already_processed:2052 already_processed.append('value')2053 outfile.write(' value="%s"' % self.gds_format_float(self.value, input_name='value'))2054 def exportChildren(self, outfile, level, namespace_='mstns:', name_='FloatValue', fromsubclass_=False):2055 pass2056 def hasContent_(self):2057 if (2058 ):2059 return True2060 else:2061 return False2062 def exportLiteral(self, outfile, level, name_='FloatValue'):2063 level += 12064 self.exportLiteralAttributes(outfile, level, [], name_)2065 if self.hasContent_():2066 self.exportLiteralChildren(outfile, level, name_)2067 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2068 if self.value is not None and 'value' not in already_processed:2069 already_processed.append('value')2070 showIndent(outfile, level)2071 outfile.write('value = %f,\n' % (self.value,))2072 def exportLiteralChildren(self, outfile, level, name_):2073 pass2074 def build(self, node):2075 self.buildAttributes(node, node.attrib, [])2076 for child in node:2077 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2078 self.buildChildren(child, node, nodeName_)2079 def buildAttributes(self, node, attrs, already_processed):2080 value = find_attr_value_('value', node)2081 if value is not None and 'value' not in already_processed:2082 already_processed.append('value')2083 try:2084 self.value = float(value)2085 except ValueError, exp:2086 raise ValueError('Bad float/double attribute (value): %s' % exp)2087 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2088 pass2089# end class FloatValue2090class AdvancedOrderCategory(GeneratedsSuper):2091 subclass = None2092 superclass = None2093 def __init__(self, id=None, name=None, item=None):2094 self.id = _cast(None, id)2095 self.name = _cast(None, name)2096 if item is None:2097 self.item = []2098 else:2099 self.item = item2100 def factory(*args_, **kwargs_):2101 if AdvancedOrderCategory.subclass:2102 return AdvancedOrderCategory.subclass(*args_, **kwargs_)2103 else:2104 return AdvancedOrderCategory(*args_, **kwargs_)2105 factory = staticmethod(factory)2106 def get_item(self): return self.item2107 def set_item(self, item): self.item = item2108 def add_item(self, value): self.item.append(value)2109 def insert_item(self, index, value): self.item[index] = value2110 def get_id(self): return self.id2111 def set_id(self, id): self.id = id2112 def get_name(self): return self.name2113 def set_name(self, name): self.name = name2114 def export(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderCategory', namespacedef_=''):2115 showIndent(outfile, level)2116 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2117 already_processed = []2118 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdvancedOrderCategory')2119 if self.hasContent_():2120 outfile.write('>\n')2121 self.exportChildren(outfile, level + 1, namespace_, name_)2122 showIndent(outfile, level)2123 outfile.write('</%s%s>\n' % (namespace_, name_))2124 else:2125 outfile.write('/>\n')2126 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='AdvancedOrderCategory'):2127 if self.id is not None and 'id' not in already_processed:2128 already_processed.append('id')2129 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'),))2130 if self.name is not None and 'name' not in already_processed:2131 already_processed.append('name')2132 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'),))2133 def exportChildren(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderCategory', fromsubclass_=False):2134 for item_ in self.item:2135 item_.export(outfile, level, namespace_, name_='item')2136 def hasContent_(self):2137 if (2138 self.item2139 ):2140 return True2141 else:2142 return False2143 def exportLiteral(self, outfile, level, name_='AdvancedOrderCategory'):2144 level += 12145 self.exportLiteralAttributes(outfile, level, [], name_)2146 if self.hasContent_():2147 self.exportLiteralChildren(outfile, level, name_)2148 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2149 if self.id is not None and 'id' not in already_processed:2150 already_processed.append('id')2151 showIndent(outfile, level)2152 outfile.write('id = "%s",\n' % (self.id,))2153 if self.name is not None and 'name' not in already_processed:2154 already_processed.append('name')2155 showIndent(outfile, level)2156 outfile.write('name = "%s",\n' % (self.name,))2157 def exportLiteralChildren(self, outfile, level, name_):2158 showIndent(outfile, level)2159 outfile.write('item=[\n')2160 level += 12161 for item_ in self.item:2162 showIndent(outfile, level)2163 outfile.write('model_.AdvancedOrderItem(\n')2164 item_.exportLiteral(outfile, level, name_='AdvancedOrderItem')2165 showIndent(outfile, level)2166 outfile.write('),\n')2167 level -= 12168 showIndent(outfile, level)2169 outfile.write('],\n')2170 def build(self, node):2171 self.buildAttributes(node, node.attrib, [])2172 for child in node:2173 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2174 self.buildChildren(child, node, nodeName_)2175 def buildAttributes(self, node, attrs, already_processed):2176 value = find_attr_value_('id', node)2177 if value is not None and 'id' not in already_processed:2178 already_processed.append('id')2179 self.id = value2180 value = find_attr_value_('name', node)2181 if value is not None and 'name' not in already_processed:2182 already_processed.append('name')2183 self.name = value2184 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2185 if nodeName_ == 'item':2186 obj_ = AdvancedOrderItem.factory()2187 obj_.build(child_)2188 self.item.append(obj_)2189# end class AdvancedOrderCategory2190class AdvancedOrderItem(GeneratedsSuper):2191 subclass = None2192 superclass = None2193 def __init__(self, stepUnit=None, description=None, stepUnitConversion=None, imageUrl=None, value=None, hasPrice=True, step=None, unitPrice=None, id=None, unit=None, name=None):2194 self.stepUnit = _cast(None, stepUnit)2195 self.description = _cast(None, description)2196 self.stepUnitConversion = _cast(int, stepUnitConversion)2197 self.imageUrl = _cast(None, imageUrl)2198 self.value = _cast(int, value)2199 self.hasPrice = _cast(bool, hasPrice)2200 self.step = _cast(int, step)2201 self.unitPrice = _cast(int, unitPrice)2202 self.id = _cast(None, id)2203 self.unit = _cast(None, unit)2204 self.name = _cast(None, name)2205 pass2206 def factory(*args_, **kwargs_):2207 if AdvancedOrderItem.subclass:2208 return AdvancedOrderItem.subclass(*args_, **kwargs_)2209 else:2210 return AdvancedOrderItem(*args_, **kwargs_)2211 factory = staticmethod(factory)2212 def get_stepUnit(self): return self.stepUnit2213 def set_stepUnit(self, stepUnit): self.stepUnit = stepUnit2214 def get_description(self): return self.description2215 def set_description(self, description): self.description = description2216 def get_stepUnitConversion(self): return self.stepUnitConversion2217 def set_stepUnitConversion(self, stepUnitConversion): self.stepUnitConversion = stepUnitConversion2218 def get_imageUrl(self): return self.imageUrl2219 def set_imageUrl(self, imageUrl): self.imageUrl = imageUrl2220 def get_value(self): return self.value2221 def set_value(self, value): self.value = value2222 def get_hasPrice(self): return self.hasPrice2223 def set_hasPrice(self, hasPrice): self.hasPrice = hasPrice2224 def get_step(self): return self.step2225 def set_step(self, step): self.step = step2226 def get_unitPrice(self): return self.unitPrice2227 def set_unitPrice(self, unitPrice): self.unitPrice = unitPrice2228 def get_id(self): return self.id2229 def set_id(self, id): self.id = id2230 def get_unit(self): return self.unit2231 def set_unit(self, unit): self.unit = unit2232 def get_name(self): return self.name2233 def set_name(self, name): self.name = name2234 def export(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderItem', namespacedef_=''):2235 showIndent(outfile, level)2236 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2237 already_processed = []2238 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdvancedOrderItem')2239 if self.hasContent_():2240 outfile.write('>\n')2241 self.exportChildren(outfile, level + 1, namespace_, name_)2242 outfile.write('</%s%s>\n' % (namespace_, name_))2243 else:2244 outfile.write('/>\n')2245 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='AdvancedOrderItem'):2246 if self.stepUnit is not None and 'stepUnit' not in already_processed:2247 already_processed.append('stepUnit')2248 outfile.write(' stepUnit=%s' % (self.gds_format_string(quote_attrib(self.stepUnit).encode(ExternalEncoding), input_name='stepUnit'),))2249 if self.description is not None and 'description' not in already_processed:2250 already_processed.append('description')2251 outfile.write(' description=%s' % (self.gds_format_string(quote_attrib(self.description).encode(ExternalEncoding), input_name='description'),))2252 if self.stepUnitConversion is not None and 'stepUnitConversion' not in already_processed:2253 already_processed.append('stepUnitConversion')2254 outfile.write(' stepUnitConversion="%s"' % self.gds_format_integer(self.stepUnitConversion, input_name='stepUnitConversion'))2255 if self.imageUrl is not None and 'imageUrl' not in already_processed:2256 already_processed.append('imageUrl')2257 outfile.write(' imageUrl=%s' % (self.gds_format_string(quote_attrib(self.imageUrl).encode(ExternalEncoding), input_name='imageUrl'),))2258 if self.value is not None and 'value' not in already_processed:2259 already_processed.append('value')2260 outfile.write(' value="%s"' % self.gds_format_integer(self.value, input_name='value'))2261 if self.hasPrice is not None and 'hasPrice' not in already_processed:2262 already_processed.append('hasPrice')2263 outfile.write(' hasPrice="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.hasPrice)), input_name='hasPrice'))2264 if self.step is not None and 'step' not in already_processed:2265 already_processed.append('step')2266 outfile.write(' step="%s"' % self.gds_format_integer(self.step, input_name='step'))2267 if self.unitPrice is not None and 'unitPrice' not in already_processed:2268 already_processed.append('unitPrice')2269 outfile.write(' unitPrice="%s"' % self.gds_format_integer(self.unitPrice, input_name='unitPrice'))2270 if self.id is not None and 'id' not in already_processed:2271 already_processed.append('id')2272 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'),))2273 if self.unit is not None and 'unit' not in already_processed:2274 already_processed.append('unit')2275 outfile.write(' unit=%s' % (self.gds_format_string(quote_attrib(self.unit).encode(ExternalEncoding), input_name='unit'),))2276 if self.name is not None and 'name' not in already_processed:2277 already_processed.append('name')2278 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'),))2279 def exportChildren(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderItem', fromsubclass_=False):2280 pass2281 def hasContent_(self):2282 if (2283 ):2284 return True2285 else:2286 return False2287 def exportLiteral(self, outfile, level, name_='AdvancedOrderItem'):2288 level += 12289 self.exportLiteralAttributes(outfile, level, [], name_)2290 if self.hasContent_():2291 self.exportLiteralChildren(outfile, level, name_)2292 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2293 if self.stepUnit is not None and 'stepUnit' not in already_processed:2294 already_processed.append('stepUnit')2295 showIndent(outfile, level)2296 outfile.write('stepUnit = "%s",\n' % (self.stepUnit,))2297 if self.description is not None and 'description' not in already_processed:2298 already_processed.append('description')2299 showIndent(outfile, level)2300 outfile.write('description = "%s",\n' % (self.description,))2301 if self.stepUnitConversion is not None and 'stepUnitConversion' not in already_processed:2302 already_processed.append('stepUnitConversion')2303 showIndent(outfile, level)2304 outfile.write('stepUnitConversion = %d,\n' % (self.stepUnitConversion,))2305 if self.imageUrl is not None and 'imageUrl' not in already_processed:2306 already_processed.append('imageUrl')2307 showIndent(outfile, level)2308 outfile.write('imageUrl = "%s",\n' % (self.imageUrl,))2309 if self.value is not None and 'value' not in already_processed:2310 already_processed.append('value')2311 showIndent(outfile, level)2312 outfile.write('value = %d,\n' % (self.value,))2313 if self.hasPrice is not None and 'hasPrice' not in already_processed:2314 already_processed.append('hasPrice')2315 showIndent(outfile, level)2316 outfile.write('hasPrice = %s,\n' % (self.hasPrice,))2317 if self.step is not None and 'step' not in already_processed:2318 already_processed.append('step')2319 showIndent(outfile, level)2320 outfile.write('step = %d,\n' % (self.step,))2321 if self.unitPrice is not None and 'unitPrice' not in already_processed:2322 already_processed.append('unitPrice')2323 showIndent(outfile, level)2324 outfile.write('unitPrice = %d,\n' % (self.unitPrice,))2325 if self.id is not None and 'id' not in already_processed:2326 already_processed.append('id')2327 showIndent(outfile, level)2328 outfile.write('id = "%s",\n' % (self.id,))2329 if self.unit is not None and 'unit' not in already_processed:2330 already_processed.append('unit')2331 showIndent(outfile, level)2332 outfile.write('unit = "%s",\n' % (self.unit,))2333 if self.name is not None and 'name' not in already_processed:2334 already_processed.append('name')2335 showIndent(outfile, level)2336 outfile.write('name = "%s",\n' % (self.name,))2337 def exportLiteralChildren(self, outfile, level, name_):2338 pass2339 def build(self, node):2340 self.buildAttributes(node, node.attrib, [])2341 for child in node:2342 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2343 self.buildChildren(child, node, nodeName_)2344 def buildAttributes(self, node, attrs, already_processed):2345 value = find_attr_value_('stepUnit', node)2346 if value is not None and 'stepUnit' not in already_processed:2347 already_processed.append('stepUnit')2348 self.stepUnit = value2349 value = find_attr_value_('description', node)2350 if value is not None and 'description' not in already_processed:2351 already_processed.append('description')2352 self.description = value2353 value = find_attr_value_('stepUnitConversion', node)2354 if value is not None and 'stepUnitConversion' not in already_processed:2355 already_processed.append('stepUnitConversion')2356 try:2357 self.stepUnitConversion = int(value)2358 except ValueError, exp:2359 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2360 value = find_attr_value_('imageUrl', node)2361 if value is not None and 'imageUrl' not in already_processed:2362 already_processed.append('imageUrl')2363 self.imageUrl = value2364 value = find_attr_value_('value', node)2365 if value is not None and 'value' not in already_processed:2366 already_processed.append('value')2367 try:2368 self.value = int(value)2369 except ValueError, exp:2370 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2371 value = find_attr_value_('hasPrice', node)2372 if value is not None and 'hasPrice' not in already_processed:2373 already_processed.append('hasPrice')2374 if value in ('true', '1'):2375 self.hasPrice = True2376 elif value in ('false', '0'):2377 self.hasPrice = False2378 else:2379 raise_parse_error(node, 'Bad boolean attribute')2380 value = find_attr_value_('step', node)2381 if value is not None and 'step' not in already_processed:2382 already_processed.append('step')2383 try:2384 self.step = int(value)2385 except ValueError, exp:2386 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2387 value = find_attr_value_('unitPrice', node)2388 if value is not None and 'unitPrice' not in already_processed:2389 already_processed.append('unitPrice')2390 try:2391 self.unitPrice = int(value)2392 except ValueError, exp:2393 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2394 value = find_attr_value_('id', node)2395 if value is not None and 'id' not in already_processed:2396 already_processed.append('id')2397 self.id = value2398 value = find_attr_value_('unit', node)2399 if value is not None and 'unit' not in already_processed:2400 already_processed.append('unit')2401 self.unit = value2402 value = find_attr_value_('name', node)2403 if value is not None and 'name' not in already_processed:2404 already_processed.append('name')2405 self.name = value2406 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2407 pass2408# end class AdvancedOrderItem2409class TextAutocompleteWidget(TextWidget):2410 subclass = None2411 superclass = TextWidget2412 def __init__(self, maxChars=None, placeholder=None, value=None, suggestion=None):2413 super(TextAutocompleteWidget, self).__init__(maxChars, placeholder, value,)2414 if suggestion is None:2415 self.suggestion = []2416 else:2417 self.suggestion = suggestion2418 def factory(*args_, **kwargs_):2419 if TextAutocompleteWidget.subclass:2420 return TextAutocompleteWidget.subclass(*args_, **kwargs_)2421 else:2422 return TextAutocompleteWidget(*args_, **kwargs_)2423 factory = staticmethod(factory)2424 def get_suggestion(self): return self.suggestion2425 def set_suggestion(self, suggestion): self.suggestion = suggestion2426 def add_suggestion(self, value): self.suggestion.append(value)2427 def insert_suggestion(self, index, value): self.suggestion[index] = value2428 def export(self, outfile, level, namespace_='mstns:', name_='TextAutocompleteWidget', namespacedef_=''):2429 showIndent(outfile, level)2430 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2431 already_processed = []2432 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TextAutocompleteWidget')2433 if self.hasContent_():2434 outfile.write('>\n')2435 self.exportChildren(outfile, level + 1, namespace_, name_)2436 showIndent(outfile, level)2437 outfile.write('</%s%s>\n' % (namespace_, name_))2438 else:2439 outfile.write('/>\n')2440 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='TextAutocompleteWidget'):2441 super(TextAutocompleteWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TextAutocompleteWidget')2442 def exportChildren(self, outfile, level, namespace_='mstns:', name_='TextAutocompleteWidget', fromsubclass_=False):2443 super(TextAutocompleteWidget, self).exportChildren(outfile, level, namespace_, name_, True)2444 for suggestion_ in self.suggestion:2445 suggestion_.export(outfile, level, namespace_, name_='suggestion')2446 def hasContent_(self):2447 if (2448 self.suggestion or2449 super(TextAutocompleteWidget, self).hasContent_()2450 ):2451 return True2452 else:2453 return False2454 def exportLiteral(self, outfile, level, name_='TextAutocompleteWidget'):2455 level += 12456 self.exportLiteralAttributes(outfile, level, [], name_)2457 if self.hasContent_():2458 self.exportLiteralChildren(outfile, level, name_)2459 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2460 super(TextAutocompleteWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)2461 def exportLiteralChildren(self, outfile, level, name_):2462 super(TextAutocompleteWidget, self).exportLiteralChildren(outfile, level, name_)2463 showIndent(outfile, level)2464 outfile.write('suggestion=[\n')2465 level += 12466 for suggestion_ in self.suggestion:2467 showIndent(outfile, level)2468 outfile.write('model_.Value(\n')2469 suggestion_.exportLiteral(outfile, level, name_='Value')2470 showIndent(outfile, level)2471 outfile.write('),\n')2472 level -= 12473 showIndent(outfile, level)2474 outfile.write('],\n')2475 def build(self, node):2476 self.buildAttributes(node, node.attrib, [])2477 for child in node:2478 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2479 self.buildChildren(child, node, nodeName_)2480 def buildAttributes(self, node, attrs, already_processed):2481 super(TextAutocompleteWidget, self).buildAttributes(node, attrs, already_processed)2482 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2483 if nodeName_ == 'suggestion':2484 class_obj_ = self.get_class_obj_(child_, Value)2485 obj_ = class_obj_.factory()2486 obj_.build(child_)2487 self.suggestion.append(obj_)2488 super(TextAutocompleteWidget, self).buildChildren(child_, node, nodeName_, True)2489# end class TextAutocompleteWidget2490class Choice(Value):2491 subclass = None2492 superclass = Value2493 def __init__(self, value=None, label=None):2494 super(Choice, self).__init__(value,)2495 self.label = _cast(None, label)2496 pass2497 def factory(*args_, **kwargs_):2498 if Choice.subclass:2499 return Choice.subclass(*args_, **kwargs_)2500 else:2501 return Choice(*args_, **kwargs_)2502 factory = staticmethod(factory)2503 def get_label(self): return self.label2504 def set_label(self, label): self.label = label2505 def export(self, outfile, level, namespace_='mstns:', name_='Choice', namespacedef_=''):2506 showIndent(outfile, level)2507 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2508 already_processed = []2509 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Choice')2510 if self.hasContent_():2511 outfile.write('>\n')2512 self.exportChildren(outfile, level + 1, namespace_, name_)2513 outfile.write('</%s%s>\n' % (namespace_, name_))2514 else:2515 outfile.write('/>\n')2516 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Choice'):2517 super(Choice, self).exportAttributes(outfile, level, already_processed, namespace_, name_='Choice')2518 if self.label is not None and 'label' not in already_processed:2519 already_processed.append('label')2520 outfile.write(' label=%s' % (self.gds_format_string(quote_attrib(self.label).encode(ExternalEncoding), input_name='label'),))2521 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Choice', fromsubclass_=False):2522 super(Choice, self).exportChildren(outfile, level, namespace_, name_, True)2523 pass2524 def hasContent_(self):2525 if (2526 super(Choice, self).hasContent_()2527 ):2528 return True2529 else:2530 return False2531 def exportLiteral(self, outfile, level, name_='Choice'):2532 level += 12533 self.exportLiteralAttributes(outfile, level, [], name_)2534 if self.hasContent_():2535 self.exportLiteralChildren(outfile, level, name_)2536 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2537 if self.label is not None and 'label' not in already_processed:2538 already_processed.append('label')2539 showIndent(outfile, level)2540 outfile.write('label = "%s",\n' % (self.label,))2541 super(Choice, self).exportLiteralAttributes(outfile, level, already_processed, name_)2542 def exportLiteralChildren(self, outfile, level, name_):2543 super(Choice, self).exportLiteralChildren(outfile, level, name_)2544 pass2545 def build(self, node):2546 self.buildAttributes(node, node.attrib, [])2547 for child in node:2548 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2549 self.buildChildren(child, node, nodeName_)2550 def buildAttributes(self, node, attrs, already_processed):2551 value = find_attr_value_('label', node)2552 if value is not None and 'label' not in already_processed:2553 already_processed.append('label')2554 self.label = value2555 super(Choice, self).buildAttributes(node, attrs, already_processed)2556 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2557 super(Choice, self).buildChildren(child_, node, nodeName_, True)2558 pass2559# end class Choice2560class SelectWidget(Widget):2561 subclass = None2562 superclass = Widget2563 def __init__(self, choice=None, extensiontype_=None):2564 super(SelectWidget, self).__init__(extensiontype_,)2565 if choice is None:2566 self.choice = []2567 else:2568 self.choice = choice2569 self.extensiontype_ = extensiontype_2570 def factory(*args_, **kwargs_):2571 if SelectWidget.subclass:2572 return SelectWidget.subclass(*args_, **kwargs_)2573 else:2574 return SelectWidget(*args_, **kwargs_)2575 factory = staticmethod(factory)2576 def get_choice(self): return self.choice2577 def set_choice(self, choice): self.choice = choice2578 def add_choice(self, value): self.choice.append(value)2579 def insert_choice(self, index, value): self.choice[index] = value2580 def get_extensiontype_(self): return self.extensiontype_2581 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_2582 def export(self, outfile, level, namespace_='mstns:', name_='SelectWidget', namespacedef_=''):2583 showIndent(outfile, level)2584 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2585 already_processed = []2586 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SelectWidget')2587 if self.hasContent_():2588 outfile.write('>\n')2589 self.exportChildren(outfile, level + 1, namespace_, name_)2590 showIndent(outfile, level)2591 outfile.write('</%s%s>\n' % (namespace_, name_))2592 else:2593 outfile.write('/>\n')2594 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SelectWidget'):2595 super(SelectWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SelectWidget')2596 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:2597 already_processed.append('xsi:type')2598 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')2599 outfile.write(' xsi:type="%s"' % self.extensiontype_)2600 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SelectWidget', fromsubclass_=False):2601 super(SelectWidget, self).exportChildren(outfile, level, namespace_, name_, True)2602 for choice_ in self.choice:2603 choice_.export(outfile, level, namespace_, name_='choice')2604 def hasContent_(self):2605 if (2606 self.choice or2607 super(SelectWidget, self).hasContent_()2608 ):2609 return True2610 else:2611 return False2612 def exportLiteral(self, outfile, level, name_='SelectWidget'):2613 level += 12614 self.exportLiteralAttributes(outfile, level, [], name_)2615 if self.hasContent_():2616 self.exportLiteralChildren(outfile, level, name_)2617 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2618 super(SelectWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)2619 def exportLiteralChildren(self, outfile, level, name_):2620 super(SelectWidget, self).exportLiteralChildren(outfile, level, name_)2621 showIndent(outfile, level)2622 outfile.write('choice=[\n')2623 level += 12624 for choice_ in self.choice:2625 showIndent(outfile, level)2626 outfile.write('model_.Choice(\n')2627 choice_.exportLiteral(outfile, level, name_='Choice')2628 showIndent(outfile, level)2629 outfile.write('),\n')2630 level -= 12631 showIndent(outfile, level)2632 outfile.write('],\n')2633 def build(self, node):2634 self.buildAttributes(node, node.attrib, [])2635 for child in node:2636 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2637 self.buildChildren(child, node, nodeName_)2638 def buildAttributes(self, node, attrs, already_processed):2639 value = find_attr_value_('xsi:type', node)2640 if value is not None and 'xsi:type' not in already_processed:2641 already_processed.append('xsi:type')2642 self.extensiontype_ = value2643 super(SelectWidget, self).buildAttributes(node, attrs, already_processed)2644 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2645 if nodeName_ == 'choice':2646 obj_ = Choice.factory()2647 obj_.build(child_)2648 self.choice.append(obj_)2649 super(SelectWidget, self).buildChildren(child_, node, nodeName_, True)2650# end class SelectWidget2651class SelectSingleWidget(SelectWidget):2652 subclass = None2653 superclass = SelectWidget2654 def __init__(self, choice=None, value=None):2655 super(SelectSingleWidget, self).__init__(choice,)2656 self.value = _cast(None, value)2657 pass2658 def factory(*args_, **kwargs_):2659 if SelectSingleWidget.subclass:2660 return SelectSingleWidget.subclass(*args_, **kwargs_)2661 else:2662 return SelectSingleWidget(*args_, **kwargs_)2663 factory = staticmethod(factory)2664 def get_value(self): return self.value2665 def set_value(self, value): self.value = value2666 def export(self, outfile, level, namespace_='mstns:', name_='SelectSingleWidget', namespacedef_=''):2667 showIndent(outfile, level)2668 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2669 already_processed = []2670 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SelectSingleWidget')2671 if self.hasContent_():2672 outfile.write('>\n')2673 self.exportChildren(outfile, level + 1, namespace_, name_)2674 showIndent(outfile, level)2675 outfile.write('</%s%s>\n' % (namespace_, name_))2676 else:2677 outfile.write('/>\n')2678 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SelectSingleWidget'):2679 super(SelectSingleWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SelectSingleWidget')2680 if self.value is not None and 'value' not in already_processed:2681 already_processed.append('value')2682 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))2683 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SelectSingleWidget', fromsubclass_=False):2684 super(SelectSingleWidget, self).exportChildren(outfile, level, namespace_, name_, True)2685 def hasContent_(self):2686 if (2687 super(SelectSingleWidget, self).hasContent_()2688 ):2689 return True2690 else:2691 return False2692 def exportLiteral(self, outfile, level, name_='SelectSingleWidget'):2693 level += 12694 self.exportLiteralAttributes(outfile, level, [], name_)2695 if self.hasContent_():2696 self.exportLiteralChildren(outfile, level, name_)2697 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2698 if self.value is not None and 'value' not in already_processed:2699 already_processed.append('value')2700 showIndent(outfile, level)2701 outfile.write('value = "%s",\n' % (self.value,))2702 super(SelectSingleWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)2703 def exportLiteralChildren(self, outfile, level, name_):2704 super(SelectSingleWidget, self).exportLiteralChildren(outfile, level, name_)2705 def build(self, node):2706 self.buildAttributes(node, node.attrib, [])2707 for child in node:2708 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2709 self.buildChildren(child, node, nodeName_)2710 def buildAttributes(self, node, attrs, already_processed):2711 value = find_attr_value_('value', node)2712 if value is not None and 'value' not in already_processed:2713 already_processed.append('value')2714 self.value = value2715 super(SelectSingleWidget, self).buildAttributes(node, attrs, already_processed)2716 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2717 super(SelectSingleWidget, self).buildChildren(child_, node, nodeName_, True)2718 pass2719# end class SelectSingleWidget2720class SelectMultiWidget(SelectWidget):2721 subclass = None2722 superclass = SelectWidget2723 def __init__(self, choice=None, value=None):2724 super(SelectMultiWidget, self).__init__(choice,)2725 if value is None:2726 self.value = []2727 else:2728 self.value = value2729 def factory(*args_, **kwargs_):2730 if SelectMultiWidget.subclass:2731 return SelectMultiWidget.subclass(*args_, **kwargs_)2732 else:2733 return SelectMultiWidget(*args_, **kwargs_)2734 factory = staticmethod(factory)2735 def get_value(self): return self.value2736 def set_value(self, value): self.value = value2737 def add_value(self, value): self.value.append(value)2738 def insert_value(self, index, value): self.value[index] = value2739 def export(self, outfile, level, namespace_='mstns:', name_='SelectMultiWidget', namespacedef_=''):2740 showIndent(outfile, level)2741 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2742 already_processed = []2743 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SelectMultiWidget')2744 if self.hasContent_():2745 outfile.write('>\n')2746 self.exportChildren(outfile, level + 1, namespace_, name_)2747 showIndent(outfile, level)2748 outfile.write('</%s%s>\n' % (namespace_, name_))2749 else:2750 outfile.write('/>\n')2751 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SelectMultiWidget'):2752 super(SelectMultiWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SelectMultiWidget')2753 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SelectMultiWidget', fromsubclass_=False):2754 super(SelectMultiWidget, self).exportChildren(outfile, level, namespace_, name_, True)2755 for value_ in self.value:2756 value_.export(outfile, level, namespace_, name_='value')2757 def hasContent_(self):2758 if (2759 self.value or2760 super(SelectMultiWidget, self).hasContent_()2761 ):2762 return True2763 else:2764 return False2765 def exportLiteral(self, outfile, level, name_='SelectMultiWidget'):2766 level += 12767 self.exportLiteralAttributes(outfile, level, [], name_)2768 if self.hasContent_():2769 self.exportLiteralChildren(outfile, level, name_)2770 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2771 super(SelectMultiWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)2772 def exportLiteralChildren(self, outfile, level, name_):2773 super(SelectMultiWidget, self).exportLiteralChildren(outfile, level, name_)2774 showIndent(outfile, level)2775 outfile.write('value=[\n')2776 level += 12777 for value_ in self.value:2778 showIndent(outfile, level)2779 outfile.write('model_.Value(\n')2780 value_.exportLiteral(outfile, level, name_='Value')2781 showIndent(outfile, level)2782 outfile.write('),\n')2783 level -= 12784 showIndent(outfile, level)2785 outfile.write('],\n')2786 def build(self, node):2787 self.buildAttributes(node, node.attrib, [])2788 for child in node:2789 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2790 self.buildChildren(child, node, nodeName_)2791 def buildAttributes(self, node, attrs, already_processed):2792 super(SelectMultiWidget, self).buildAttributes(node, attrs, already_processed)2793 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2794 if nodeName_ == 'value':2795 class_obj_ = self.get_class_obj_(child_, Value)2796 obj_ = class_obj_.factory()2797 obj_.build(child_)2798 self.value.append(obj_)2799 super(SelectMultiWidget, self).buildChildren(child_, node, nodeName_, True)2800# end class SelectMultiWidget2801class SelectDateWidget(Widget):2802 subclass = None2803 superclass = Widget2804 def __init__(self, minuteInterval=None, maxDate=None, mode=None, date=None, unit=None, minDate=None):2805 super(SelectDateWidget, self).__init__()2806 self.minuteInterval = _cast(int, minuteInterval)2807 self.maxDate = _cast(int, maxDate)2808 self.mode = _cast(None, mode)2809 self.date = _cast(int, date)2810 self.unit = _cast(None, unit)2811 self.minDate = _cast(int, minDate)2812 pass2813 def factory(*args_, **kwargs_):2814 if SelectDateWidget.subclass:2815 return SelectDateWidget.subclass(*args_, **kwargs_)2816 else:2817 return SelectDateWidget(*args_, **kwargs_)2818 factory = staticmethod(factory)2819 def get_minuteInterval(self): return self.minuteInterval2820 def set_minuteInterval(self, minuteInterval): self.minuteInterval = minuteInterval2821 def get_maxDate(self): return self.maxDate2822 def set_maxDate(self, maxDate): self.maxDate = maxDate2823 def get_mode(self): return self.mode2824 def set_mode(self, mode): self.mode = mode2825 def get_date(self): return self.date2826 def set_date(self, date): self.date = date2827 def get_unit(self): return self.unit2828 def set_unit(self, unit): self.unit = unit2829 def get_minDate(self): return self.minDate2830 def set_minDate(self, minDate): self.minDate = minDate2831 def export(self, outfile, level, namespace_='mstns:', name_='SelectDateWidget', namespacedef_=''):2832 showIndent(outfile, level)2833 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2834 already_processed = []2835 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SelectDateWidget')2836 if self.hasContent_():2837 outfile.write('>\n')2838 self.exportChildren(outfile, level + 1, namespace_, name_)2839 outfile.write('</%s%s>\n' % (namespace_, name_))2840 else:2841 outfile.write('/>\n')2842 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SelectDateWidget'):2843 super(SelectDateWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SelectDateWidget')2844 if self.minuteInterval is not None and 'minuteInterval' not in already_processed:2845 already_processed.append('minuteInterval')2846 outfile.write(' minuteInterval="%s"' % self.gds_format_integer(self.minuteInterval, input_name='minuteInterval'))2847 if self.maxDate is not None and 'maxDate' not in already_processed:2848 already_processed.append('maxDate')2849 outfile.write(' maxDate="%s"' % self.gds_format_integer(self.maxDate, input_name='maxDate'))2850 if self.mode is not None and 'mode' not in already_processed:2851 already_processed.append('mode')2852 outfile.write(' mode=%s' % (self.gds_format_string(quote_attrib(self.mode).encode(ExternalEncoding), input_name='mode'),))2853 if self.date is not None and 'date' not in already_processed:2854 already_processed.append('date')2855 outfile.write(' date="%s"' % self.gds_format_integer(self.date, input_name='date'))2856 if self.unit is not None and 'unit' not in already_processed:2857 already_processed.append('unit')2858 outfile.write(' unit=%s' % (self.gds_format_string(quote_attrib(self.unit).encode(ExternalEncoding), input_name='unit'),))2859 if self.minDate is not None and 'minDate' not in already_processed:2860 already_processed.append('minDate')2861 outfile.write(' minDate="%s"' % self.gds_format_integer(self.minDate, input_name='minDate'))2862 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SelectDateWidget', fromsubclass_=False):2863 super(SelectDateWidget, self).exportChildren(outfile, level, namespace_, name_, True)2864 pass2865 def hasContent_(self):2866 if (2867 super(SelectDateWidget, self).hasContent_()2868 ):2869 return True2870 else:2871 return False2872 def exportLiteral(self, outfile, level, name_='SelectDateWidget'):2873 level += 12874 self.exportLiteralAttributes(outfile, level, [], name_)2875 if self.hasContent_():2876 self.exportLiteralChildren(outfile, level, name_)2877 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2878 if self.minuteInterval is not None and 'minuteInterval' not in already_processed:2879 already_processed.append('minuteInterval')2880 showIndent(outfile, level)2881 outfile.write('minuteInterval = %d,\n' % (self.minuteInterval,))2882 if self.maxDate is not None and 'maxDate' not in already_processed:2883 already_processed.append('maxDate')2884 showIndent(outfile, level)2885 outfile.write('maxDate = %d,\n' % (self.maxDate,))2886 if self.mode is not None and 'mode' not in already_processed:2887 already_processed.append('mode')2888 showIndent(outfile, level)2889 outfile.write('mode = "%s",\n' % (self.mode,))2890 if self.date is not None and 'date' not in already_processed:2891 already_processed.append('date')2892 showIndent(outfile, level)2893 outfile.write('date = %d,\n' % (self.date,))2894 if self.unit is not None and 'unit' not in already_processed:2895 already_processed.append('unit')2896 showIndent(outfile, level)2897 outfile.write('unit = "%s",\n' % (self.unit,))2898 if self.minDate is not None and 'minDate' not in already_processed:2899 already_processed.append('minDate')2900 showIndent(outfile, level)2901 outfile.write('minDate = %d,\n' % (self.minDate,))2902 super(SelectDateWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)2903 def exportLiteralChildren(self, outfile, level, name_):2904 super(SelectDateWidget, self).exportLiteralChildren(outfile, level, name_)2905 pass2906 def build(self, node):2907 self.buildAttributes(node, node.attrib, [])2908 for child in node:2909 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2910 self.buildChildren(child, node, nodeName_)2911 def buildAttributes(self, node, attrs, already_processed):2912 value = find_attr_value_('minuteInterval', node)2913 if value is not None and 'minuteInterval' not in already_processed:2914 already_processed.append('minuteInterval')2915 try:2916 self.minuteInterval = int(value)2917 except ValueError, exp:2918 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2919 value = find_attr_value_('maxDate', node)2920 if value is not None and 'maxDate' not in already_processed:2921 already_processed.append('maxDate')2922 try:2923 self.maxDate = int(value)2924 except ValueError, exp:2925 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2926 value = find_attr_value_('mode', node)2927 if value is not None and 'mode' not in already_processed:2928 already_processed.append('mode')2929 self.mode = value2930 value = find_attr_value_('date', node)2931 if value is not None and 'date' not in already_processed:2932 already_processed.append('date')2933 try:2934 self.date = int(value)2935 except ValueError, exp:2936 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2937 value = find_attr_value_('unit', node)2938 if value is not None and 'unit' not in already_processed:2939 already_processed.append('unit')2940 self.unit = value2941 value = find_attr_value_('minDate', node)2942 if value is not None and 'minDate' not in already_processed:2943 already_processed.append('minDate')2944 try:2945 self.minDate = int(value)2946 except ValueError, exp:2947 raise_parse_error(node, 'Bad integer attribute: %s' % exp)2948 super(SelectDateWidget, self).buildAttributes(node, attrs, already_processed)2949 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2950 super(SelectDateWidget, self).buildChildren(child_, node, nodeName_, True)2951 pass2952# end class SelectDateWidget2953class MyDigiPassWidget(Widget):2954 subclass = None2955 superclass = Widget2956 def __init__(self, scope=None):2957 super(MyDigiPassWidget, self).__init__()2958 self.scope = _cast(None, scope)2959 pass2960 def factory(*args_, **kwargs_):2961 if MyDigiPassWidget.subclass:2962 return MyDigiPassWidget.subclass(*args_, **kwargs_)2963 else:2964 return MyDigiPassWidget(*args_, **kwargs_)2965 factory = staticmethod(factory)2966 def get_scope(self): return self.scope2967 def set_scope(self, scope): self.scope = scope2968 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassWidget', namespacedef_=''):2969 showIndent(outfile, level)2970 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))2971 already_processed = []2972 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassWidget')2973 if self.hasContent_():2974 outfile.write('>\n')2975 self.exportChildren(outfile, level + 1, namespace_, name_)2976 outfile.write('</%s%s>\n' % (namespace_, name_))2977 else:2978 outfile.write('/>\n')2979 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassWidget'):2980 super(MyDigiPassWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassWidget')2981 if self.scope is not None and 'scope' not in already_processed:2982 already_processed.append('scope')2983 outfile.write(' scope=%s' % (self.gds_format_string(quote_attrib(self.scope).encode(ExternalEncoding), input_name='scope'),))2984 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassWidget', fromsubclass_=False):2985 super(MyDigiPassWidget, self).exportChildren(outfile, level, namespace_, name_, True)2986 pass2987 def hasContent_(self):2988 if (2989 super(MyDigiPassWidget, self).hasContent_()2990 ):2991 return True2992 else:2993 return False2994 def exportLiteral(self, outfile, level, name_='MyDigiPassWidget'):2995 level += 12996 self.exportLiteralAttributes(outfile, level, [], name_)2997 if self.hasContent_():2998 self.exportLiteralChildren(outfile, level, name_)2999 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3000 if self.scope is not None and 'scope' not in already_processed:3001 already_processed.append('scope')3002 showIndent(outfile, level)3003 outfile.write('scope = "%s",\n' % (self.scope,))3004 super(MyDigiPassWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)3005 def exportLiteralChildren(self, outfile, level, name_):3006 super(MyDigiPassWidget, self).exportLiteralChildren(outfile, level, name_)3007 pass3008 def build(self, node):3009 self.buildAttributes(node, node.attrib, [])3010 for child in node:3011 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3012 self.buildChildren(child, node, nodeName_)3013 def buildAttributes(self, node, attrs, already_processed):3014 value = find_attr_value_('scope', node)3015 if value is not None and 'scope' not in already_processed:3016 already_processed.append('scope')3017 self.scope = value3018 super(MyDigiPassWidget, self).buildAttributes(node, attrs, already_processed)3019 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3020 super(MyDigiPassWidget, self).buildChildren(child_, node, nodeName_, True)3021 pass3022# end class MyDigiPassWidget3023class AdvancedOrderWidget(Widget):3024 subclass = None3025 superclass = Widget3026 def __init__(self, currency=None, leapTime=None, category=None):3027 super(AdvancedOrderWidget, self).__init__()3028 self.currency = _cast(None, currency)3029 self.leapTime = _cast(int, leapTime)3030 if category is None:3031 self.category = []3032 else:3033 self.category = category3034 def factory(*args_, **kwargs_):3035 if AdvancedOrderWidget.subclass:3036 return AdvancedOrderWidget.subclass(*args_, **kwargs_)3037 else:3038 return AdvancedOrderWidget(*args_, **kwargs_)3039 factory = staticmethod(factory)3040 def get_category(self): return self.category3041 def set_category(self, category): self.category = category3042 def add_category(self, value): self.category.append(value)3043 def insert_category(self, index, value): self.category[index] = value3044 def get_currency(self): return self.currency3045 def set_currency(self, currency): self.currency = currency3046 def get_leapTime(self): return self.leapTime3047 def set_leapTime(self, leapTime): self.leapTime = leapTime3048 def export(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderWidget', namespacedef_=''):3049 showIndent(outfile, level)3050 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3051 already_processed = []3052 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdvancedOrderWidget')3053 if self.hasContent_():3054 outfile.write('>\n')3055 self.exportChildren(outfile, level + 1, namespace_, name_)3056 showIndent(outfile, level)3057 outfile.write('</%s%s>\n' % (namespace_, name_))3058 else:3059 outfile.write('/>\n')3060 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='AdvancedOrderWidget'):3061 super(AdvancedOrderWidget, self).exportAttributes(outfile, level, already_processed, namespace_, name_='AdvancedOrderWidget')3062 if self.currency is not None and 'currency' not in already_processed:3063 already_processed.append('currency')3064 outfile.write(' currency=%s' % (self.gds_format_string(quote_attrib(self.currency).encode(ExternalEncoding), input_name='currency'),))3065 if self.leapTime is not None and 'leapTime' not in already_processed:3066 already_processed.append('leapTime')3067 outfile.write(' leapTime="%s"' % self.gds_format_integer(self.leapTime, input_name='leapTime'))3068 def exportChildren(self, outfile, level, namespace_='mstns:', name_='AdvancedOrderWidget', fromsubclass_=False):3069 super(AdvancedOrderWidget, self).exportChildren(outfile, level, namespace_, name_, True)3070 for category_ in self.category:3071 category_.export(outfile, level, namespace_, name_='category')3072 def hasContent_(self):3073 if (3074 self.category or3075 super(AdvancedOrderWidget, self).hasContent_()3076 ):3077 return True3078 else:3079 return False3080 def exportLiteral(self, outfile, level, name_='AdvancedOrderWidget'):3081 level += 13082 self.exportLiteralAttributes(outfile, level, [], name_)3083 if self.hasContent_():3084 self.exportLiteralChildren(outfile, level, name_)3085 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3086 if self.currency is not None and 'currency' not in already_processed:3087 already_processed.append('currency')3088 showIndent(outfile, level)3089 outfile.write('currency = "%s",\n' % (self.currency,))3090 if self.leapTime is not None and 'leapTime' not in already_processed:3091 already_processed.append('leapTime')3092 showIndent(outfile, level)3093 outfile.write('leapTime = %d,\n' % (self.leapTime,))3094 super(AdvancedOrderWidget, self).exportLiteralAttributes(outfile, level, already_processed, name_)3095 def exportLiteralChildren(self, outfile, level, name_):3096 super(AdvancedOrderWidget, self).exportLiteralChildren(outfile, level, name_)3097 showIndent(outfile, level)3098 outfile.write('category=[\n')3099 level += 13100 for category_ in self.category:3101 showIndent(outfile, level)3102 outfile.write('model_.AdvancedOrderCategory(\n')3103 category_.exportLiteral(outfile, level, name_='AdvancedOrderCategory')3104 showIndent(outfile, level)3105 outfile.write('),\n')3106 level -= 13107 showIndent(outfile, level)3108 outfile.write('],\n')3109 def build(self, node):3110 self.buildAttributes(node, node.attrib, [])3111 for child in node:3112 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3113 self.buildChildren(child, node, nodeName_)3114 def buildAttributes(self, node, attrs, already_processed):3115 value = find_attr_value_('currency', node)3116 if value is not None and 'currency' not in already_processed:3117 already_processed.append('currency')3118 self.currency = value3119 value = find_attr_value_('leapTime', node)3120 if value is not None and 'leapTime' not in already_processed:3121 already_processed.append('leapTime')3122 try:3123 self.leapTime = int(value)3124 except ValueError, exp:3125 raise_parse_error(node, 'Bad integer attribute: %s' % exp)3126 super(AdvancedOrderWidget, self).buildAttributes(node, attrs, already_processed)3127 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3128 if nodeName_ == 'category':3129 obj_ = AdvancedOrderCategory.factory()3130 obj_.build(child_)3131 self.category.append(obj_)3132 super(AdvancedOrderWidget, self).buildChildren(child_, node, nodeName_, True)3133# end class AdvancedOrderWidget3134class Form(GeneratedsSuper):3135 subclass = None3136 superclass = None3137 def __init__(self, positiveButtonConfirmation=None, negativeButtonCaption=None, positiveButtonCaption=None, negativeButtonConfirmation=None, widget=None, javascriptValidation=None):3138 self.positiveButtonConfirmation = _cast(None, positiveButtonConfirmation)3139 self.negativeButtonCaption = _cast(None, negativeButtonCaption)3140 self.positiveButtonCaption = _cast(None, positiveButtonCaption)3141 self.negativeButtonConfirmation = _cast(None, negativeButtonConfirmation)3142 self.widget = widget3143 self.javascriptValidation = javascriptValidation3144 def factory(*args_, **kwargs_):3145 if Form.subclass:3146 return Form.subclass(*args_, **kwargs_)3147 else:3148 return Form(*args_, **kwargs_)3149 factory = staticmethod(factory)3150 def get_widget(self): return self.widget3151 def set_widget(self, widget): self.widget = widget3152 def get_javascriptValidation(self): return self.javascriptValidation3153 def set_javascriptValidation(self, javascriptValidation): self.javascriptValidation = javascriptValidation3154 def get_positiveButtonConfirmation(self): return self.positiveButtonConfirmation3155 def set_positiveButtonConfirmation(self, positiveButtonConfirmation): self.positiveButtonConfirmation = positiveButtonConfirmation3156 def get_negativeButtonCaption(self): return self.negativeButtonCaption3157 def set_negativeButtonCaption(self, negativeButtonCaption): self.negativeButtonCaption = negativeButtonCaption3158 def get_positiveButtonCaption(self): return self.positiveButtonCaption3159 def set_positiveButtonCaption(self, positiveButtonCaption): self.positiveButtonCaption = positiveButtonCaption3160 def get_negativeButtonConfirmation(self): return self.negativeButtonConfirmation3161 def set_negativeButtonConfirmation(self, negativeButtonConfirmation): self.negativeButtonConfirmation = negativeButtonConfirmation3162 def export(self, outfile, level, namespace_='mstns:', name_='Form', namespacedef_=''):3163 showIndent(outfile, level)3164 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3165 already_processed = []3166 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Form')3167 if self.hasContent_():3168 outfile.write('>\n')3169 self.exportChildren(outfile, level + 1, namespace_, name_)3170 showIndent(outfile, level)3171 outfile.write('</%s%s>\n' % (namespace_, name_))3172 else:3173 outfile.write('/>\n')3174 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Form'):3175 if self.positiveButtonConfirmation is not None and 'positiveButtonConfirmation' not in already_processed:3176 already_processed.append('positiveButtonConfirmation')3177 outfile.write(' positiveButtonConfirmation=%s' % (self.gds_format_string(quote_attrib(self.positiveButtonConfirmation).encode(ExternalEncoding), input_name='positiveButtonConfirmation'),))3178 if self.negativeButtonCaption is not None and 'negativeButtonCaption' not in already_processed:3179 already_processed.append('negativeButtonCaption')3180 outfile.write(' negativeButtonCaption=%s' % (self.gds_format_string(quote_attrib(self.negativeButtonCaption).encode(ExternalEncoding), input_name='negativeButtonCaption'),))3181 if self.positiveButtonCaption is not None and 'positiveButtonCaption' not in already_processed:3182 already_processed.append('positiveButtonCaption')3183 outfile.write(' positiveButtonCaption=%s' % (self.gds_format_string(quote_attrib(self.positiveButtonCaption).encode(ExternalEncoding), input_name='positiveButtonCaption'),))3184 if self.negativeButtonConfirmation is not None and 'negativeButtonConfirmation' not in already_processed:3185 already_processed.append('negativeButtonConfirmation')3186 outfile.write(' negativeButtonConfirmation=%s' % (self.gds_format_string(quote_attrib(self.negativeButtonConfirmation).encode(ExternalEncoding), input_name='negativeButtonConfirmation'),))3187 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Form', fromsubclass_=False):3188 if self.widget is not None:3189 self.widget.export(outfile, level, namespace_, name_='widget',)3190 if self.javascriptValidation is not None:3191 showIndent(outfile, level)3192 outfile.write('<%sjavascriptValidation>%s</%sjavascriptValidation>\n' % (namespace_, self.gds_format_string(quote_xml(self.javascriptValidation).encode(ExternalEncoding), input_name='javascriptValidation'), namespace_))3193 def hasContent_(self):3194 if (3195 self.widget is not None or3196 self.javascriptValidation is not None3197 ):3198 return True3199 else:3200 return False3201 def exportLiteral(self, outfile, level, name_='Form'):3202 level += 13203 self.exportLiteralAttributes(outfile, level, [], name_)3204 if self.hasContent_():3205 self.exportLiteralChildren(outfile, level, name_)3206 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3207 if self.positiveButtonConfirmation is not None and 'positiveButtonConfirmation' not in already_processed:3208 already_processed.append('positiveButtonConfirmation')3209 showIndent(outfile, level)3210 outfile.write('positiveButtonConfirmation = "%s",\n' % (self.positiveButtonConfirmation,))3211 if self.negativeButtonCaption is not None and 'negativeButtonCaption' not in already_processed:3212 already_processed.append('negativeButtonCaption')3213 showIndent(outfile, level)3214 outfile.write('negativeButtonCaption = "%s",\n' % (self.negativeButtonCaption,))3215 if self.positiveButtonCaption is not None and 'positiveButtonCaption' not in already_processed:3216 already_processed.append('positiveButtonCaption')3217 showIndent(outfile, level)3218 outfile.write('positiveButtonCaption = "%s",\n' % (self.positiveButtonCaption,))3219 if self.negativeButtonConfirmation is not None and 'negativeButtonConfirmation' not in already_processed:3220 already_processed.append('negativeButtonConfirmation')3221 showIndent(outfile, level)3222 outfile.write('negativeButtonConfirmation = "%s",\n' % (self.negativeButtonConfirmation,))3223 def exportLiteralChildren(self, outfile, level, name_):3224 if self.widget is not None:3225 showIndent(outfile, level)3226 outfile.write('widget=model_.Widget(\n')3227 self.widget.exportLiteral(outfile, level, name_='widget')3228 showIndent(outfile, level)3229 outfile.write('),\n')3230 if self.javascriptValidation is not None:3231 showIndent(outfile, level)3232 outfile.write('javascriptValidation=%s,\n' % quote_python(self.javascriptValidation).encode(ExternalEncoding))3233 def build(self, node):3234 self.buildAttributes(node, node.attrib, [])3235 for child in node:3236 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3237 self.buildChildren(child, node, nodeName_)3238 def buildAttributes(self, node, attrs, already_processed):3239 value = find_attr_value_('positiveButtonConfirmation', node)3240 if value is not None and 'positiveButtonConfirmation' not in already_processed:3241 already_processed.append('positiveButtonConfirmation')3242 self.positiveButtonConfirmation = value3243 value = find_attr_value_('negativeButtonCaption', node)3244 if value is not None and 'negativeButtonCaption' not in already_processed:3245 already_processed.append('negativeButtonCaption')3246 self.negativeButtonCaption = value3247 value = find_attr_value_('positiveButtonCaption', node)3248 if value is not None and 'positiveButtonCaption' not in already_processed:3249 already_processed.append('positiveButtonCaption')3250 self.positiveButtonCaption = value3251 value = find_attr_value_('negativeButtonConfirmation', node)3252 if value is not None and 'negativeButtonConfirmation' not in already_processed:3253 already_processed.append('negativeButtonConfirmation')3254 self.negativeButtonConfirmation = value3255 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3256 if nodeName_ == 'widget':3257 class_obj_ = self.get_class_obj_(child_, Widget)3258 obj_ = class_obj_.factory()3259 obj_.build(child_)3260 self.set_widget(obj_)3261 elif nodeName_ == 'javascriptValidation':3262 javascriptValidation_ = child_.text3263 javascriptValidation_ = self.gds_validate_string(javascriptValidation_, node, 'javascriptValidation')3264 self.javascriptValidation = javascriptValidation_3265# end class Form3266class FormMessage(FlowElement):3267 subclass = None3268 superclass = FlowElement3269 def __init__(self, id=None, alertIntervalType=None, alertType=None, brandingKey=None, positiveReference=None, vibrate=None, member=None, autoLock=None, negativeReference=None, content=None, form=None, attachment=None):3270 super(FormMessage, self).__init__(id,)3271 self.alertIntervalType = _cast(None, alertIntervalType)3272 self.alertType = _cast(None, alertType)3273 self.brandingKey = _cast(None, brandingKey)3274 self.positiveReference = _cast(None, positiveReference)3275 self.vibrate = _cast(bool, vibrate)3276 self.member = _cast(None, member)3277 self.autoLock = _cast(bool, autoLock)3278 self.negativeReference = _cast(None, negativeReference)3279 self.content = content3280 self.form = form3281 if attachment is None:3282 self.attachment = []3283 else:3284 self.attachment = attachment3285 def factory(*args_, **kwargs_):3286 if FormMessage.subclass:3287 return FormMessage.subclass(*args_, **kwargs_)3288 else:3289 return FormMessage(*args_, **kwargs_)3290 factory = staticmethod(factory)3291 def get_content(self): return self.content3292 def set_content(self, content): self.content = content3293 def get_form(self): return self.form3294 def set_form(self, form): self.form = form3295 def get_attachment(self): return self.attachment3296 def set_attachment(self, attachment): self.attachment = attachment3297 def add_attachment(self, value): self.attachment.append(value)3298 def insert_attachment(self, index, value): self.attachment[index] = value3299 def get_alertIntervalType(self): return self.alertIntervalType3300 def set_alertIntervalType(self, alertIntervalType): self.alertIntervalType = alertIntervalType3301 def validate_AlertIntervalType(self, value):3302 # Validate type AlertIntervalType, a restriction on xs:string.3303 pass3304 def get_alertType(self): return self.alertType3305 def set_alertType(self, alertType): self.alertType = alertType3306 def validate_AlertType(self, value):3307 # Validate type AlertType, a restriction on xs:string.3308 pass3309 def get_brandingKey(self): return self.brandingKey3310 def set_brandingKey(self, brandingKey): self.brandingKey = brandingKey3311 def get_positiveReference(self): return self.positiveReference3312 def set_positiveReference(self, positiveReference): self.positiveReference = positiveReference3313 def get_vibrate(self): return self.vibrate3314 def set_vibrate(self, vibrate): self.vibrate = vibrate3315 def get_member(self): return self.member3316 def set_member(self, member): self.member = member3317 def get_autoLock(self): return self.autoLock3318 def set_autoLock(self, autoLock): self.autoLock = autoLock3319 def get_negativeReference(self): return self.negativeReference3320 def set_negativeReference(self, negativeReference): self.negativeReference = negativeReference3321 def export(self, outfile, level, namespace_='mstns:', name_='FormMessage', namespacedef_=''):3322 showIndent(outfile, level)3323 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3324 already_processed = []3325 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FormMessage')3326 if self.hasContent_():3327 outfile.write('>\n')3328 self.exportChildren(outfile, level + 1, namespace_, name_)3329 showIndent(outfile, level)3330 outfile.write('</%s%s>\n' % (namespace_, name_))3331 else:3332 outfile.write('/>\n')3333 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='FormMessage'):3334 super(FormMessage, self).exportAttributes(outfile, level, already_processed, namespace_, name_='FormMessage')3335 if self.alertIntervalType is not None and 'alertIntervalType' not in already_processed:3336 already_processed.append('alertIntervalType')3337 outfile.write(' alertIntervalType=%s' % (quote_attrib(self.alertIntervalType),))3338 if self.alertType is not None and 'alertType' not in already_processed:3339 already_processed.append('alertType')3340 outfile.write(' alertType=%s' % (quote_attrib(self.alertType),))3341 if self.brandingKey is not None and 'brandingKey' not in already_processed:3342 already_processed.append('brandingKey')3343 outfile.write(' brandingKey=%s' % (self.gds_format_string(quote_attrib(self.brandingKey).encode(ExternalEncoding), input_name='brandingKey'),))3344 if self.positiveReference is not None and 'positiveReference' not in already_processed:3345 already_processed.append('positiveReference')3346 outfile.write(' positiveReference=%s' % (self.gds_format_string(quote_attrib(self.positiveReference).encode(ExternalEncoding), input_name='positiveReference'),))3347 if self.vibrate is not None and 'vibrate' not in already_processed:3348 already_processed.append('vibrate')3349 outfile.write(' vibrate="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.vibrate)), input_name='vibrate'))3350 if self.member is not None and 'member' not in already_processed:3351 already_processed.append('member')3352 outfile.write(' member=%s' % (self.gds_format_string(quote_attrib(self.member).encode(ExternalEncoding), input_name='member'),))3353 if self.autoLock is not None and 'autoLock' not in already_processed:3354 already_processed.append('autoLock')3355 outfile.write(' autoLock="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.autoLock)), input_name='autoLock'))3356 if self.negativeReference is not None and 'negativeReference' not in already_processed:3357 already_processed.append('negativeReference')3358 outfile.write(' negativeReference=%s' % (self.gds_format_string(quote_attrib(self.negativeReference).encode(ExternalEncoding), input_name='negativeReference'),))3359 def exportChildren(self, outfile, level, namespace_='mstns:', name_='FormMessage', fromsubclass_=False):3360 super(FormMessage, self).exportChildren(outfile, level, namespace_, name_, True)3361 if self.content is not None:3362 self.content.export(outfile, level, namespace_, name_='content',)3363 if self.form is not None:3364 self.form.export(outfile, level, namespace_, name_='form',)3365 for attachment_ in self.attachment:3366 attachment_.export(outfile, level, namespace_, name_='attachment')3367 def hasContent_(self):3368 if (3369 self.content is not None or3370 self.form is not None or3371 self.attachment or3372 super(FormMessage, self).hasContent_()3373 ):3374 return True3375 else:3376 return False3377 def exportLiteral(self, outfile, level, name_='FormMessage'):3378 level += 13379 self.exportLiteralAttributes(outfile, level, [], name_)3380 if self.hasContent_():3381 self.exportLiteralChildren(outfile, level, name_)3382 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3383 if self.alertIntervalType is not None and 'alertIntervalType' not in already_processed:3384 already_processed.append('alertIntervalType')3385 showIndent(outfile, level)3386 outfile.write('alertIntervalType = "%s",\n' % (self.alertIntervalType,))3387 if self.alertType is not None and 'alertType' not in already_processed:3388 already_processed.append('alertType')3389 showIndent(outfile, level)3390 outfile.write('alertType = "%s",\n' % (self.alertType,))3391 if self.brandingKey is not None and 'brandingKey' not in already_processed:3392 already_processed.append('brandingKey')3393 showIndent(outfile, level)3394 outfile.write('brandingKey = "%s",\n' % (self.brandingKey,))3395 if self.positiveReference is not None and 'positiveReference' not in already_processed:3396 already_processed.append('positiveReference')3397 showIndent(outfile, level)3398 outfile.write('positiveReference = "%s",\n' % (self.positiveReference,))3399 if self.vibrate is not None and 'vibrate' not in already_processed:3400 already_processed.append('vibrate')3401 showIndent(outfile, level)3402 outfile.write('vibrate = %s,\n' % (self.vibrate,))3403 if self.member is not None and 'member' not in already_processed:3404 already_processed.append('member')3405 showIndent(outfile, level)3406 outfile.write('member = "%s",\n' % (self.member,))3407 if self.autoLock is not None and 'autoLock' not in already_processed:3408 already_processed.append('autoLock')3409 showIndent(outfile, level)3410 outfile.write('autoLock = %s,\n' % (self.autoLock,))3411 if self.negativeReference is not None and 'negativeReference' not in already_processed:3412 already_processed.append('negativeReference')3413 showIndent(outfile, level)3414 outfile.write('negativeReference = "%s",\n' % (self.negativeReference,))3415 super(FormMessage, self).exportLiteralAttributes(outfile, level, already_processed, name_)3416 def exportLiteralChildren(self, outfile, level, name_):3417 super(FormMessage, self).exportLiteralChildren(outfile, level, name_)3418 if self.content is not None:3419 showIndent(outfile, level)3420 outfile.write('content=model_.contentType1(\n')3421 self.content.exportLiteral(outfile, level, name_='content')3422 showIndent(outfile, level)3423 outfile.write('),\n')3424 if self.form is not None:3425 showIndent(outfile, level)3426 outfile.write('form=model_.Form(\n')3427 self.form.exportLiteral(outfile, level, name_='form')3428 showIndent(outfile, level)3429 outfile.write('),\n')3430 showIndent(outfile, level)3431 outfile.write('attachment=[\n')3432 level += 13433 for attachment_ in self.attachment:3434 showIndent(outfile, level)3435 outfile.write('model_.Attachment(\n')3436 attachment_.exportLiteral(outfile, level, name_='Attachment')3437 showIndent(outfile, level)3438 outfile.write('),\n')3439 level -= 13440 showIndent(outfile, level)3441 outfile.write('],\n')3442 def build(self, node):3443 self.buildAttributes(node, node.attrib, [])3444 for child in node:3445 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3446 self.buildChildren(child, node, nodeName_)3447 def buildAttributes(self, node, attrs, already_processed):3448 value = find_attr_value_('alertIntervalType', node)3449 if value is not None and 'alertIntervalType' not in already_processed:3450 already_processed.append('alertIntervalType')3451 self.alertIntervalType = value3452 self.validate_AlertIntervalType(self.alertIntervalType) # validate type AlertIntervalType3453 value = find_attr_value_('alertType', node)3454 if value is not None and 'alertType' not in already_processed:3455 already_processed.append('alertType')3456 self.alertType = value3457 self.validate_AlertType(self.alertType) # validate type AlertType3458 value = find_attr_value_('brandingKey', node)3459 if value is not None and 'brandingKey' not in already_processed:3460 already_processed.append('brandingKey')3461 self.brandingKey = value3462 value = find_attr_value_('positiveReference', node)3463 if value is not None and 'positiveReference' not in already_processed:3464 already_processed.append('positiveReference')3465 self.positiveReference = value3466 value = find_attr_value_('vibrate', node)3467 if value is not None and 'vibrate' not in already_processed:3468 already_processed.append('vibrate')3469 if value in ('true', '1'):3470 self.vibrate = True3471 elif value in ('false', '0'):3472 self.vibrate = False3473 else:3474 raise_parse_error(node, 'Bad boolean attribute')3475 value = find_attr_value_('member', node)3476 if value is not None and 'member' not in already_processed:3477 already_processed.append('member')3478 self.member = value3479 value = find_attr_value_('autoLock', node)3480 if value is not None and 'autoLock' not in already_processed:3481 already_processed.append('autoLock')3482 if value in ('true', '1'):3483 self.autoLock = True3484 elif value in ('false', '0'):3485 self.autoLock = False3486 else:3487 raise_parse_error(node, 'Bad boolean attribute')3488 value = find_attr_value_('negativeReference', node)3489 if value is not None and 'negativeReference' not in already_processed:3490 already_processed.append('negativeReference')3491 self.negativeReference = value3492 super(FormMessage, self).buildAttributes(node, attrs, already_processed)3493 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3494 if nodeName_ == 'content':3495 obj_ = contentType1.factory()3496 obj_.build(child_)3497 self.set_content(obj_)3498 elif nodeName_ == 'form':3499 obj_ = Form.factory()3500 obj_.build(child_)3501 self.set_form(obj_)3502 elif nodeName_ == 'attachment':3503 obj_ = Attachment.factory()3504 obj_.build(child_)3505 self.attachment.append(obj_)3506 super(FormMessage, self).buildChildren(child_, node, nodeName_, True)3507# end class FormMessage3508class Outlet(GeneratedsSuper):3509 subclass = None3510 superclass = None3511 def __init__(self, reference=None, name=None, value=None):3512 self.reference = _cast(None, reference)3513 self.name = _cast(None, name)3514 self.value = _cast(None, value)3515 pass3516 def factory(*args_, **kwargs_):3517 if Outlet.subclass:3518 return Outlet.subclass(*args_, **kwargs_)3519 else:3520 return Outlet(*args_, **kwargs_)3521 factory = staticmethod(factory)3522 def get_reference(self): return self.reference3523 def set_reference(self, reference): self.reference = reference3524 def get_name(self): return self.name3525 def set_name(self, name): self.name = name3526 def get_value(self): return self.value3527 def set_value(self, value): self.value = value3528 def export(self, outfile, level, namespace_='mstns:', name_='Outlet', namespacedef_=''):3529 showIndent(outfile, level)3530 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3531 already_processed = []3532 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Outlet')3533 if self.hasContent_():3534 outfile.write('>\n')3535 self.exportChildren(outfile, level + 1, namespace_, name_)3536 outfile.write('</%s%s>\n' % (namespace_, name_))3537 else:3538 outfile.write('/>\n')3539 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Outlet'):3540 if self.reference is not None and 'reference' not in already_processed:3541 already_processed.append('reference')3542 outfile.write(' reference=%s' % (self.gds_format_string(quote_attrib(self.reference).encode(ExternalEncoding), input_name='reference'),))3543 if self.name is not None and 'name' not in already_processed:3544 already_processed.append('name')3545 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'),))3546 if self.value is not None and 'value' not in already_processed:3547 already_processed.append('value')3548 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))3549 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Outlet', fromsubclass_=False):3550 pass3551 def hasContent_(self):3552 if (3553 ):3554 return True3555 else:3556 return False3557 def exportLiteral(self, outfile, level, name_='Outlet'):3558 level += 13559 self.exportLiteralAttributes(outfile, level, [], name_)3560 if self.hasContent_():3561 self.exportLiteralChildren(outfile, level, name_)3562 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3563 if self.reference is not None and 'reference' not in already_processed:3564 already_processed.append('reference')3565 showIndent(outfile, level)3566 outfile.write('reference = "%s",\n' % (self.reference,))3567 if self.name is not None and 'name' not in already_processed:3568 already_processed.append('name')3569 showIndent(outfile, level)3570 outfile.write('name = "%s",\n' % (self.name,))3571 if self.value is not None and 'value' not in already_processed:3572 already_processed.append('value')3573 showIndent(outfile, level)3574 outfile.write('value = "%s",\n' % (self.value,))3575 def exportLiteralChildren(self, outfile, level, name_):3576 pass3577 def build(self, node):3578 self.buildAttributes(node, node.attrib, [])3579 for child in node:3580 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3581 self.buildChildren(child, node, nodeName_)3582 def buildAttributes(self, node, attrs, already_processed):3583 value = find_attr_value_('reference', node)3584 if value is not None and 'reference' not in already_processed:3585 already_processed.append('reference')3586 self.reference = value3587 value = find_attr_value_('name', node)3588 if value is not None and 'name' not in already_processed:3589 already_processed.append('name')3590 self.name = value3591 value = find_attr_value_('value', node)3592 if value is not None and 'value' not in already_processed:3593 already_processed.append('value')3594 self.value = value3595 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3596 pass3597# end class Outlet3598class End(FlowElement):3599 subclass = None3600 superclass = FlowElement3601 def __init__(self, id=None, waitForFollowUpMessage=False):3602 super(End, self).__init__(id,)3603 self.waitForFollowUpMessage = _cast(bool, waitForFollowUpMessage)3604 pass3605 def factory(*args_, **kwargs_):3606 if End.subclass:3607 return End.subclass(*args_, **kwargs_)3608 else:3609 return End(*args_, **kwargs_)3610 factory = staticmethod(factory)3611 def get_waitForFollowUpMessage(self): return self.waitForFollowUpMessage3612 def set_waitForFollowUpMessage(self, waitForFollowUpMessage): self.waitForFollowUpMessage = waitForFollowUpMessage3613 def export(self, outfile, level, namespace_='mstns:', name_='End', namespacedef_=''):3614 showIndent(outfile, level)3615 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3616 already_processed = []3617 self.exportAttributes(outfile, level, already_processed, namespace_, name_='End')3618 if self.hasContent_():3619 outfile.write('>\n')3620 self.exportChildren(outfile, level + 1, namespace_, name_)3621 outfile.write('</%s%s>\n' % (namespace_, name_))3622 else:3623 outfile.write('/>\n')3624 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='End'):3625 super(End, self).exportAttributes(outfile, level, already_processed, namespace_, name_='End')3626 if self.waitForFollowUpMessage is not None and 'waitForFollowUpMessage' not in already_processed:3627 already_processed.append('waitForFollowUpMessage')3628 outfile.write(' waitForFollowUpMessage="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.waitForFollowUpMessage)), input_name='waitForFollowUpMessage'))3629 def exportChildren(self, outfile, level, namespace_='mstns:', name_='End', fromsubclass_=False):3630 super(End, self).exportChildren(outfile, level, namespace_, name_, True)3631 pass3632 def hasContent_(self):3633 if (3634 super(End, self).hasContent_()3635 ):3636 return True3637 else:3638 return False3639 def exportLiteral(self, outfile, level, name_='End'):3640 level += 13641 self.exportLiteralAttributes(outfile, level, [], name_)3642 if self.hasContent_():3643 self.exportLiteralChildren(outfile, level, name_)3644 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3645 if self.waitForFollowUpMessage is not None and 'waitForFollowUpMessage' not in already_processed:3646 already_processed.append('waitForFollowUpMessage')3647 showIndent(outfile, level)3648 outfile.write('waitForFollowUpMessage = %s,\n' % (self.waitForFollowUpMessage,))3649 super(End, self).exportLiteralAttributes(outfile, level, already_processed, name_)3650 def exportLiteralChildren(self, outfile, level, name_):3651 super(End, self).exportLiteralChildren(outfile, level, name_)3652 pass3653 def build(self, node):3654 self.buildAttributes(node, node.attrib, [])3655 for child in node:3656 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3657 self.buildChildren(child, node, nodeName_)3658 def buildAttributes(self, node, attrs, already_processed):3659 value = find_attr_value_('waitForFollowUpMessage', node)3660 if value is not None and 'waitForFollowUpMessage' not in already_processed:3661 already_processed.append('waitForFollowUpMessage')3662 if value in ('true', '1'):3663 self.waitForFollowUpMessage = True3664 elif value in ('false', '0'):3665 self.waitForFollowUpMessage = False3666 else:3667 raise_parse_error(node, 'Bad boolean attribute')3668 super(End, self).buildAttributes(node, attrs, already_processed)3669 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3670 super(End, self).buildChildren(child_, node, nodeName_, True)3671 pass3672# end class End3673class MessageFlowDefinition(GeneratedsSuper):3674 subclass = None3675 superclass = None3676 def __init__(self, name=None, language=None, startReference=None, end=None, message=None, formMessage=None, resultsFlush=None, resultsEmail=None, flowCode=None):3677 self.name = _cast(None, name)3678 self.language = _cast(None, language)3679 self.startReference = _cast(None, startReference)3680 if end is None:3681 self.end = []3682 else:3683 self.end = end3684 if message is None:3685 self.message = []3686 else:3687 self.message = message3688 if formMessage is None:3689 self.formMessage = []3690 else:3691 self.formMessage = formMessage3692 if resultsFlush is None:3693 self.resultsFlush = []3694 else:3695 self.resultsFlush = resultsFlush3696 if resultsEmail is None:3697 self.resultsEmail = []3698 else:3699 self.resultsEmail = resultsEmail3700 if flowCode is None:3701 self.flowCode = []3702 else:3703 self.flowCode = flowCode3704 def factory(*args_, **kwargs_):3705 if MessageFlowDefinition.subclass:3706 return MessageFlowDefinition.subclass(*args_, **kwargs_)3707 else:3708 return MessageFlowDefinition(*args_, **kwargs_)3709 factory = staticmethod(factory)3710 def get_end(self): return self.end3711 def set_end(self, end): self.end = end3712 def add_end(self, value): self.end.append(value)3713 def insert_end(self, index, value): self.end[index] = value3714 def get_message(self): return self.message3715 def set_message(self, message): self.message = message3716 def add_message(self, value): self.message.append(value)3717 def insert_message(self, index, value): self.message[index] = value3718 def get_formMessage(self): return self.formMessage3719 def set_formMessage(self, formMessage): self.formMessage = formMessage3720 def add_formMessage(self, value): self.formMessage.append(value)3721 def insert_formMessage(self, index, value): self.formMessage[index] = value3722 def get_resultsFlush(self): return self.resultsFlush3723 def set_resultsFlush(self, resultsFlush): self.resultsFlush = resultsFlush3724 def add_resultsFlush(self, value): self.resultsFlush.append(value)3725 def insert_resultsFlush(self, index, value): self.resultsFlush[index] = value3726 def get_resultsEmail(self): return self.resultsEmail3727 def set_resultsEmail(self, resultsEmail): self.resultsEmail = resultsEmail3728 def add_resultsEmail(self, value): self.resultsEmail.append(value)3729 def insert_resultsEmail(self, index, value): self.resultsEmail[index] = value3730 def get_flowCode(self): return self.flowCode3731 def set_flowCode(self, flowCode): self.flowCode = flowCode3732 def add_flowCode(self, value): self.flowCode.append(value)3733 def insert_flowCode(self, index, value): self.flowCode[index] = value3734 def get_name(self): return self.name3735 def set_name(self, name): self.name = name3736 def get_language(self): return self.language3737 def set_language(self, language): self.language = language3738 def get_startReference(self): return self.startReference3739 def set_startReference(self, startReference): self.startReference = startReference3740 def export(self, outfile, level, namespace_='mstns:', name_='MessageFlowDefinition', namespacedef_=''):3741 showIndent(outfile, level)3742 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3743 already_processed = []3744 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MessageFlowDefinition')3745 if self.hasContent_():3746 outfile.write('>\n')3747 self.exportChildren(outfile, level + 1, namespace_, name_)3748 showIndent(outfile, level)3749 outfile.write('</%s%s>\n' % (namespace_, name_))3750 else:3751 outfile.write('/>\n')3752 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MessageFlowDefinition'):3753 if self.name is not None and 'name' not in already_processed:3754 already_processed.append('name')3755 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'),))3756 if self.language is not None and 'language' not in already_processed:3757 already_processed.append('language')3758 outfile.write(' language=%s' % (self.gds_format_string(quote_attrib(self.language).encode(ExternalEncoding), input_name='language'),))3759 if self.startReference is not None and 'startReference' not in already_processed:3760 already_processed.append('startReference')3761 outfile.write(' startReference=%s' % (self.gds_format_string(quote_attrib(self.startReference).encode(ExternalEncoding), input_name='startReference'),))3762 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MessageFlowDefinition', fromsubclass_=False):3763 for end_ in self.end:3764 end_.export(outfile, level, namespace_, name_='end')3765 for message_ in self.message:3766 message_.export(outfile, level, namespace_, name_='message')3767 for formMessage_ in self.formMessage:3768 formMessage_.export(outfile, level, namespace_, name_='formMessage')3769 for resultsFlush_ in self.resultsFlush:3770 resultsFlush_.export(outfile, level, namespace_, name_='resultsFlush')3771 for resultsEmail_ in self.resultsEmail:3772 resultsEmail_.export(outfile, level, namespace_, name_='resultsEmail')3773 for flowCode_ in self.flowCode:3774 flowCode_.export(outfile, level, namespace_, name_='flowCode')3775 def hasContent_(self):3776 if (3777 self.end or3778 self.message or3779 self.formMessage or3780 self.resultsFlush or3781 self.resultsEmail or3782 self.flowCode3783 ):3784 return True3785 else:3786 return False3787 def exportLiteral(self, outfile, level, name_='MessageFlowDefinition'):3788 level += 13789 self.exportLiteralAttributes(outfile, level, [], name_)3790 if self.hasContent_():3791 self.exportLiteralChildren(outfile, level, name_)3792 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3793 if self.name is not None and 'name' not in already_processed:3794 already_processed.append('name')3795 showIndent(outfile, level)3796 outfile.write('name = "%s",\n' % (self.name,))3797 if self.language is not None and 'language' not in already_processed:3798 already_processed.append('language')3799 showIndent(outfile, level)3800 outfile.write('language = "%s",\n' % (self.language,))3801 if self.startReference is not None and 'startReference' not in already_processed:3802 already_processed.append('startReference')3803 showIndent(outfile, level)3804 outfile.write('startReference = "%s",\n' % (self.startReference,))3805 def exportLiteralChildren(self, outfile, level, name_):3806 showIndent(outfile, level)3807 outfile.write('end=[\n')3808 level += 13809 for end_ in self.end:3810 showIndent(outfile, level)3811 outfile.write('model_.End(\n')3812 end_.exportLiteral(outfile, level, name_='End')3813 showIndent(outfile, level)3814 outfile.write('),\n')3815 level -= 13816 showIndent(outfile, level)3817 outfile.write('],\n')3818 showIndent(outfile, level)3819 outfile.write('message=[\n')3820 level += 13821 for message_ in self.message:3822 showIndent(outfile, level)3823 outfile.write('model_.Message(\n')3824 message_.exportLiteral(outfile, level, name_='Message')3825 showIndent(outfile, level)3826 outfile.write('),\n')3827 level -= 13828 showIndent(outfile, level)3829 outfile.write('],\n')3830 showIndent(outfile, level)3831 outfile.write('formMessage=[\n')3832 level += 13833 for formMessage_ in self.formMessage:3834 showIndent(outfile, level)3835 outfile.write('model_.FormMessage(\n')3836 formMessage_.exportLiteral(outfile, level, name_='FormMessage')3837 showIndent(outfile, level)3838 outfile.write('),\n')3839 level -= 13840 showIndent(outfile, level)3841 outfile.write('],\n')3842 showIndent(outfile, level)3843 outfile.write('resultsFlush=[\n')3844 level += 13845 for resultsFlush_ in self.resultsFlush:3846 showIndent(outfile, level)3847 outfile.write('model_.ResultsFlush(\n')3848 resultsFlush_.exportLiteral(outfile, level, name_='ResultsFlush')3849 showIndent(outfile, level)3850 outfile.write('),\n')3851 level -= 13852 showIndent(outfile, level)3853 outfile.write('],\n')3854 showIndent(outfile, level)3855 outfile.write('resultsEmail=[\n')3856 level += 13857 for resultsEmail_ in self.resultsEmail:3858 showIndent(outfile, level)3859 outfile.write('model_.ResultsEmail(\n')3860 resultsEmail_.exportLiteral(outfile, level, name_='ResultsEmail')3861 showIndent(outfile, level)3862 outfile.write('),\n')3863 level -= 13864 showIndent(outfile, level)3865 outfile.write('],\n')3866 showIndent(outfile, level)3867 outfile.write('flowCode=[\n')3868 level += 13869 for flowCode_ in self.flowCode:3870 showIndent(outfile, level)3871 outfile.write('model_.FlowCode(\n')3872 flowCode_.exportLiteral(outfile, level, name_='FlowCode')3873 showIndent(outfile, level)3874 outfile.write('),\n')3875 level -= 13876 showIndent(outfile, level)3877 outfile.write('],\n')3878 def build(self, node):3879 self.buildAttributes(node, node.attrib, [])3880 for child in node:3881 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3882 self.buildChildren(child, node, nodeName_)3883 def buildAttributes(self, node, attrs, already_processed):3884 value = find_attr_value_('name', node)3885 if value is not None and 'name' not in already_processed:3886 already_processed.append('name')3887 self.name = value3888 value = find_attr_value_('language', node)3889 if value is not None and 'language' not in already_processed:3890 already_processed.append('language')3891 self.language = value3892 value = find_attr_value_('startReference', node)3893 if value is not None and 'startReference' not in already_processed:3894 already_processed.append('startReference')3895 self.startReference = value3896 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3897 if nodeName_ == 'end':3898 obj_ = End.factory()3899 obj_.build(child_)3900 self.end.append(obj_)3901 elif nodeName_ == 'message':3902 obj_ = Message.factory()3903 obj_.build(child_)3904 self.message.append(obj_)3905 elif nodeName_ == 'formMessage':3906 obj_ = FormMessage.factory()3907 obj_.build(child_)3908 self.formMessage.append(obj_)3909 elif nodeName_ == 'resultsFlush':3910 obj_ = ResultsFlush.factory()3911 obj_.build(child_)3912 self.resultsFlush.append(obj_)3913 elif nodeName_ == 'resultsEmail':3914 obj_ = ResultsEmail.factory()3915 obj_.build(child_)3916 self.resultsEmail.append(obj_)3917 elif nodeName_ == 'flowCode':3918 obj_ = FlowCode.factory()3919 obj_.build(child_)3920 self.flowCode.append(obj_)3921# end class MessageFlowDefinition3922class MessageFlowDefinitionSet(GeneratedsSuper):3923 subclass = None3924 superclass = None3925 def __init__(self, definition=None):3926 if definition is None:3927 self.definition = []3928 else:3929 self.definition = definition3930 def factory(*args_, **kwargs_):3931 if MessageFlowDefinitionSet.subclass:3932 return MessageFlowDefinitionSet.subclass(*args_, **kwargs_)3933 else:3934 return MessageFlowDefinitionSet(*args_, **kwargs_)3935 factory = staticmethod(factory)3936 def get_definition(self): return self.definition3937 def set_definition(self, definition): self.definition = definition3938 def add_definition(self, value): self.definition.append(value)3939 def insert_definition(self, index, value): self.definition[index] = value3940 def export(self, outfile, level, namespace_='mstns:', name_='MessageFlowDefinitionSet', namespacedef_=''):3941 showIndent(outfile, level)3942 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))3943 already_processed = []3944 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MessageFlowDefinitionSet')3945 if self.hasContent_():3946 outfile.write('>\n')3947 self.exportChildren(outfile, level + 1, namespace_, name_)3948 showIndent(outfile, level)3949 outfile.write('</%s%s>\n' % (namespace_, name_))3950 else:3951 outfile.write('/>\n')3952 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MessageFlowDefinitionSet'):3953 pass3954 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MessageFlowDefinitionSet', fromsubclass_=False):3955 for definition_ in self.definition:3956 definition_.export(outfile, level, namespace_, name_='definition')3957 def hasContent_(self):3958 if (3959 self.definition3960 ):3961 return True3962 else:3963 return False3964 def exportLiteral(self, outfile, level, name_='MessageFlowDefinitionSet'):3965 level += 13966 self.exportLiteralAttributes(outfile, level, [], name_)3967 if self.hasContent_():3968 self.exportLiteralChildren(outfile, level, name_)3969 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3970 pass3971 def exportLiteralChildren(self, outfile, level, name_):3972 showIndent(outfile, level)3973 outfile.write('definition=[\n')3974 level += 13975 for definition_ in self.definition:3976 showIndent(outfile, level)3977 outfile.write('model_.MessageFlowDefinition(\n')3978 definition_.exportLiteral(outfile, level, name_='MessageFlowDefinition')3979 showIndent(outfile, level)3980 outfile.write('),\n')3981 level -= 13982 showIndent(outfile, level)3983 outfile.write('],\n')3984 def build(self, node):3985 self.buildAttributes(node, node.attrib, [])3986 for child in node:3987 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3988 self.buildChildren(child, node, nodeName_)3989 def buildAttributes(self, node, attrs, already_processed):3990 pass3991 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3992 if nodeName_ == 'definition':3993 obj_ = MessageFlowDefinition.factory()3994 obj_.build(child_)3995 self.definition.append(obj_)3996# end class MessageFlowDefinitionSet3997class Step(GeneratedsSuper):3998 subclass = None3999 superclass = None4000 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, extensiontype_=None):4001 self.definition = _cast(None, definition)4002 self.previousStep = _cast(None, previousStep)4003 self.button = _cast(None, button)4004 self.nextStep = _cast(None, nextStep)4005 self.message = _cast(None, message)4006 self.creationTimestamp = _cast(int, creationTimestamp)4007 self.id = _cast(None, id)4008 self.extensiontype_ = extensiontype_4009 def factory(*args_, **kwargs_):4010 if Step.subclass:4011 return Step.subclass(*args_, **kwargs_)4012 else:4013 return Step(*args_, **kwargs_)4014 factory = staticmethod(factory)4015 def get_definition(self): return self.definition4016 def set_definition(self, definition): self.definition = definition4017 def get_previousStep(self): return self.previousStep4018 def set_previousStep(self, previousStep): self.previousStep = previousStep4019 def get_button(self): return self.button4020 def set_button(self, button): self.button = button4021 def get_nextStep(self): return self.nextStep4022 def set_nextStep(self, nextStep): self.nextStep = nextStep4023 def get_message(self): return self.message4024 def set_message(self, message): self.message = message4025 def get_creationTimestamp(self): return self.creationTimestamp4026 def set_creationTimestamp(self, creationTimestamp): self.creationTimestamp = creationTimestamp4027 def get_id(self): return self.id4028 def set_id(self, id): self.id = id4029 def get_extensiontype_(self): return self.extensiontype_4030 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_4031 def export(self, outfile, level, namespace_='mstns:', name_='Step', namespacedef_=''):4032 showIndent(outfile, level)4033 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4034 already_processed = []4035 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Step')4036 if self.hasContent_():4037 outfile.write('>\n')4038 self.exportChildren(outfile, level + 1, namespace_, name_)4039 outfile.write('</%s%s>\n' % (namespace_, name_))4040 else:4041 outfile.write('/>\n')4042 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='Step'):4043 if self.definition is not None and 'definition' not in already_processed:4044 already_processed.append('definition')4045 outfile.write(' definition=%s' % (self.gds_format_string(quote_attrib(self.definition).encode(ExternalEncoding), input_name='definition'),))4046 if self.previousStep is not None and 'previousStep' not in already_processed:4047 already_processed.append('previousStep')4048 outfile.write(' previousStep=%s' % (self.gds_format_string(quote_attrib(self.previousStep).encode(ExternalEncoding), input_name='previousStep'),))4049 if self.button is not None and 'button' not in already_processed:4050 already_processed.append('button')4051 outfile.write(' button=%s' % (self.gds_format_string(quote_attrib(self.button).encode(ExternalEncoding), input_name='button'),))4052 if self.nextStep is not None and 'nextStep' not in already_processed:4053 already_processed.append('nextStep')4054 outfile.write(' nextStep=%s' % (self.gds_format_string(quote_attrib(self.nextStep).encode(ExternalEncoding), input_name='nextStep'),))4055 if self.message is not None and 'message' not in already_processed:4056 already_processed.append('message')4057 outfile.write(' message=%s' % (self.gds_format_string(quote_attrib(self.message).encode(ExternalEncoding), input_name='message'),))4058 if self.creationTimestamp is not None and 'creationTimestamp' not in already_processed:4059 already_processed.append('creationTimestamp')4060 outfile.write(' creationTimestamp="%s"' % self.gds_format_integer(self.creationTimestamp, input_name='creationTimestamp'))4061 if self.id is not None and 'id' not in already_processed:4062 already_processed.append('id')4063 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'),))4064 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:4065 already_processed.append('xsi:type')4066 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')4067 outfile.write(' xsi:type="%s"' % self.extensiontype_)4068 def exportChildren(self, outfile, level, namespace_='mstns:', name_='Step', fromsubclass_=False):4069 pass4070 def hasContent_(self):4071 if (4072 ):4073 return True4074 else:4075 return False4076 def exportLiteral(self, outfile, level, name_='Step'):4077 level += 14078 self.exportLiteralAttributes(outfile, level, [], name_)4079 if self.hasContent_():4080 self.exportLiteralChildren(outfile, level, name_)4081 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4082 if self.definition is not None and 'definition' not in already_processed:4083 already_processed.append('definition')4084 showIndent(outfile, level)4085 outfile.write('definition = "%s",\n' % (self.definition,))4086 if self.previousStep is not None and 'previousStep' not in already_processed:4087 already_processed.append('previousStep')4088 showIndent(outfile, level)4089 outfile.write('previousStep = "%s",\n' % (self.previousStep,))4090 if self.button is not None and 'button' not in already_processed:4091 already_processed.append('button')4092 showIndent(outfile, level)4093 outfile.write('button = "%s",\n' % (self.button,))4094 if self.nextStep is not None and 'nextStep' not in already_processed:4095 already_processed.append('nextStep')4096 showIndent(outfile, level)4097 outfile.write('nextStep = "%s",\n' % (self.nextStep,))4098 if self.message is not None and 'message' not in already_processed:4099 already_processed.append('message')4100 showIndent(outfile, level)4101 outfile.write('message = "%s",\n' % (self.message,))4102 if self.creationTimestamp is not None and 'creationTimestamp' not in already_processed:4103 already_processed.append('creationTimestamp')4104 showIndent(outfile, level)4105 outfile.write('creationTimestamp = %d,\n' % (self.creationTimestamp,))4106 if self.id is not None and 'id' not in already_processed:4107 already_processed.append('id')4108 showIndent(outfile, level)4109 outfile.write('id = "%s",\n' % (self.id,))4110 def exportLiteralChildren(self, outfile, level, name_):4111 pass4112 def build(self, node):4113 self.buildAttributes(node, node.attrib, [])4114 for child in node:4115 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4116 self.buildChildren(child, node, nodeName_)4117 def buildAttributes(self, node, attrs, already_processed):4118 value = find_attr_value_('definition', node)4119 if value is not None and 'definition' not in already_processed:4120 already_processed.append('definition')4121 self.definition = value4122 value = find_attr_value_('previousStep', node)4123 if value is not None and 'previousStep' not in already_processed:4124 already_processed.append('previousStep')4125 self.previousStep = value4126 value = find_attr_value_('button', node)4127 if value is not None and 'button' not in already_processed:4128 already_processed.append('button')4129 self.button = value4130 value = find_attr_value_('nextStep', node)4131 if value is not None and 'nextStep' not in already_processed:4132 already_processed.append('nextStep')4133 self.nextStep = value4134 value = find_attr_value_('message', node)4135 if value is not None and 'message' not in already_processed:4136 already_processed.append('message')4137 self.message = value4138 value = find_attr_value_('creationTimestamp', node)4139 if value is not None and 'creationTimestamp' not in already_processed:4140 already_processed.append('creationTimestamp')4141 try:4142 self.creationTimestamp = int(value)4143 except ValueError, exp:4144 raise_parse_error(node, 'Bad integer attribute: %s' % exp)4145 value = find_attr_value_('id', node)4146 if value is not None and 'id' not in already_processed:4147 already_processed.append('id')4148 self.id = value4149 value = find_attr_value_('xsi:type', node)4150 if value is not None and 'xsi:type' not in already_processed:4151 already_processed.append('xsi:type')4152 self.extensiontype_ = value4153 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4154 pass4155# end class Step4156class BaseMessageStep(Step):4157 subclass = None4158 superclass = Step4159 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, extensiontype_=None):4160 super(BaseMessageStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, extensiontype_,)4161 self.receivedTimestamp = _cast(int, receivedTimestamp)4162 self.acknowledgedTimestamp = _cast(int, acknowledgedTimestamp)4163 self.extensiontype_ = extensiontype_4164 def factory(*args_, **kwargs_):4165 if BaseMessageStep.subclass:4166 return BaseMessageStep.subclass(*args_, **kwargs_)4167 else:4168 return BaseMessageStep(*args_, **kwargs_)4169 factory = staticmethod(factory)4170 def get_receivedTimestamp(self): return self.receivedTimestamp4171 def set_receivedTimestamp(self, receivedTimestamp): self.receivedTimestamp = receivedTimestamp4172 def get_acknowledgedTimestamp(self): return self.acknowledgedTimestamp4173 def set_acknowledgedTimestamp(self, acknowledgedTimestamp): self.acknowledgedTimestamp = acknowledgedTimestamp4174 def get_extensiontype_(self): return self.extensiontype_4175 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_4176 def export(self, outfile, level, namespace_='mstns:', name_='BaseMessageStep', namespacedef_=''):4177 showIndent(outfile, level)4178 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4179 already_processed = []4180 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BaseMessageStep')4181 if self.hasContent_():4182 outfile.write('>\n')4183 self.exportChildren(outfile, level + 1, namespace_, name_)4184 outfile.write('</%s%s>\n' % (namespace_, name_))4185 else:4186 outfile.write('/>\n')4187 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='BaseMessageStep'):4188 super(BaseMessageStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BaseMessageStep')4189 if self.receivedTimestamp is not None and 'receivedTimestamp' not in already_processed:4190 already_processed.append('receivedTimestamp')4191 outfile.write(' receivedTimestamp="%s"' % self.gds_format_integer(self.receivedTimestamp, input_name='receivedTimestamp'))4192 if self.acknowledgedTimestamp is not None and 'acknowledgedTimestamp' not in already_processed:4193 already_processed.append('acknowledgedTimestamp')4194 outfile.write(' acknowledgedTimestamp="%s"' % self.gds_format_integer(self.acknowledgedTimestamp, input_name='acknowledgedTimestamp'))4195 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:4196 already_processed.append('xsi:type')4197 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')4198 outfile.write(' xsi:type="%s"' % self.extensiontype_)4199 def exportChildren(self, outfile, level, namespace_='mstns:', name_='BaseMessageStep', fromsubclass_=False):4200 super(BaseMessageStep, self).exportChildren(outfile, level, namespace_, name_, True)4201 pass4202 def hasContent_(self):4203 if (4204 super(BaseMessageStep, self).hasContent_()4205 ):4206 return True4207 else:4208 return False4209 def exportLiteral(self, outfile, level, name_='BaseMessageStep'):4210 level += 14211 self.exportLiteralAttributes(outfile, level, [], name_)4212 if self.hasContent_():4213 self.exportLiteralChildren(outfile, level, name_)4214 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4215 if self.receivedTimestamp is not None and 'receivedTimestamp' not in already_processed:4216 already_processed.append('receivedTimestamp')4217 showIndent(outfile, level)4218 outfile.write('receivedTimestamp = %d,\n' % (self.receivedTimestamp,))4219 if self.acknowledgedTimestamp is not None and 'acknowledgedTimestamp' not in already_processed:4220 already_processed.append('acknowledgedTimestamp')4221 showIndent(outfile, level)4222 outfile.write('acknowledgedTimestamp = %d,\n' % (self.acknowledgedTimestamp,))4223 super(BaseMessageStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4224 def exportLiteralChildren(self, outfile, level, name_):4225 super(BaseMessageStep, self).exportLiteralChildren(outfile, level, name_)4226 pass4227 def build(self, node):4228 self.buildAttributes(node, node.attrib, [])4229 for child in node:4230 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4231 self.buildChildren(child, node, nodeName_)4232 def buildAttributes(self, node, attrs, already_processed):4233 value = find_attr_value_('receivedTimestamp', node)4234 if value is not None and 'receivedTimestamp' not in already_processed:4235 already_processed.append('receivedTimestamp')4236 try:4237 self.receivedTimestamp = int(value)4238 except ValueError, exp:4239 raise_parse_error(node, 'Bad integer attribute: %s' % exp)4240 value = find_attr_value_('acknowledgedTimestamp', node)4241 if value is not None and 'acknowledgedTimestamp' not in already_processed:4242 already_processed.append('acknowledgedTimestamp')4243 try:4244 self.acknowledgedTimestamp = int(value)4245 except ValueError, exp:4246 raise_parse_error(node, 'Bad integer attribute: %s' % exp)4247 value = find_attr_value_('xsi:type', node)4248 if value is not None and 'xsi:type' not in already_processed:4249 already_processed.append('xsi:type')4250 self.extensiontype_ = value4251 super(BaseMessageStep, self).buildAttributes(node, attrs, already_processed)4252 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4253 super(BaseMessageStep, self).buildChildren(child_, node, nodeName_, True)4254 pass4255# end class BaseMessageStep4256class MessageStep(BaseMessageStep):4257 subclass = None4258 superclass = BaseMessageStep4259 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, answer=None):4260 super(MessageStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp,)4261 self.answer = _cast(None, answer)4262 pass4263 def factory(*args_, **kwargs_):4264 if MessageStep.subclass:4265 return MessageStep.subclass(*args_, **kwargs_)4266 else:4267 return MessageStep(*args_, **kwargs_)4268 factory = staticmethod(factory)4269 def get_answer(self): return self.answer4270 def set_answer(self, answer): self.answer = answer4271 def export(self, outfile, level, namespace_='mstns:', name_='MessageStep', namespacedef_=''):4272 showIndent(outfile, level)4273 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4274 already_processed = []4275 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MessageStep')4276 if self.hasContent_():4277 outfile.write('>\n')4278 self.exportChildren(outfile, level + 1, namespace_, name_)4279 outfile.write('</%s%s>\n' % (namespace_, name_))4280 else:4281 outfile.write('/>\n')4282 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MessageStep'):4283 super(MessageStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MessageStep')4284 if self.answer is not None and 'answer' not in already_processed:4285 already_processed.append('answer')4286 outfile.write(' answer=%s' % (self.gds_format_string(quote_attrib(self.answer).encode(ExternalEncoding), input_name='answer'),))4287 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MessageStep', fromsubclass_=False):4288 super(MessageStep, self).exportChildren(outfile, level, namespace_, name_, True)4289 pass4290 def hasContent_(self):4291 if (4292 super(MessageStep, self).hasContent_()4293 ):4294 return True4295 else:4296 return False4297 def exportLiteral(self, outfile, level, name_='MessageStep'):4298 level += 14299 self.exportLiteralAttributes(outfile, level, [], name_)4300 if self.hasContent_():4301 self.exportLiteralChildren(outfile, level, name_)4302 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4303 if self.answer is not None and 'answer' not in already_processed:4304 already_processed.append('answer')4305 showIndent(outfile, level)4306 outfile.write('answer = "%s",\n' % (self.answer,))4307 super(MessageStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4308 def exportLiteralChildren(self, outfile, level, name_):4309 super(MessageStep, self).exportLiteralChildren(outfile, level, name_)4310 pass4311 def build(self, node):4312 self.buildAttributes(node, node.attrib, [])4313 for child in node:4314 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4315 self.buildChildren(child, node, nodeName_)4316 def buildAttributes(self, node, attrs, already_processed):4317 value = find_attr_value_('answer', node)4318 if value is not None and 'answer' not in already_processed:4319 already_processed.append('answer')4320 self.answer = value4321 super(MessageStep, self).buildAttributes(node, attrs, already_processed)4322 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4323 super(MessageStep, self).buildChildren(child_, node, nodeName_, True)4324 pass4325# end class MessageStep4326class WidgetStep(BaseMessageStep):4327 subclass = None4328 superclass = BaseMessageStep4329 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, extensiontype_=None):4330 super(WidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, extensiontype_,)4331 self.formButton = _cast(None, formButton)4332 self.displayValue = _cast(None, displayValue)4333 self.extensiontype_ = extensiontype_4334 def factory(*args_, **kwargs_):4335 if WidgetStep.subclass:4336 return WidgetStep.subclass(*args_, **kwargs_)4337 else:4338 return WidgetStep(*args_, **kwargs_)4339 factory = staticmethod(factory)4340 def get_formButton(self): return self.formButton4341 def set_formButton(self, formButton): self.formButton = formButton4342 def validate_FormButton(self, value):4343 # Validate type FormButton, a restriction on xs:string.4344 pass4345 def get_displayValue(self): return self.displayValue4346 def set_displayValue(self, displayValue): self.displayValue = displayValue4347 def get_extensiontype_(self): return self.extensiontype_4348 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_4349 def export(self, outfile, level, namespace_='mstns:', name_='WidgetStep', namespacedef_=''):4350 showIndent(outfile, level)4351 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4352 already_processed = []4353 self.exportAttributes(outfile, level, already_processed, namespace_, name_='WidgetStep')4354 if self.hasContent_():4355 outfile.write('>\n')4356 self.exportChildren(outfile, level + 1, namespace_, name_)4357 outfile.write('</%s%s>\n' % (namespace_, name_))4358 else:4359 outfile.write('/>\n')4360 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='WidgetStep'):4361 super(WidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='WidgetStep')4362 if self.formButton is not None and 'formButton' not in already_processed:4363 already_processed.append('formButton')4364 outfile.write(' formButton=%s' % (quote_attrib(self.formButton),))4365 if self.displayValue is not None and 'displayValue' not in already_processed:4366 already_processed.append('displayValue')4367 outfile.write(' displayValue=%s' % (self.gds_format_string(quote_attrib(self.displayValue).encode(ExternalEncoding), input_name='displayValue'),))4368 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:4369 already_processed.append('xsi:type')4370 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')4371 outfile.write(' xsi:type="%s"' % self.extensiontype_)4372 def exportChildren(self, outfile, level, namespace_='mstns:', name_='WidgetStep', fromsubclass_=False):4373 super(WidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4374 pass4375 def hasContent_(self):4376 if (4377 super(WidgetStep, self).hasContent_()4378 ):4379 return True4380 else:4381 return False4382 def exportLiteral(self, outfile, level, name_='WidgetStep'):4383 level += 14384 self.exportLiteralAttributes(outfile, level, [], name_)4385 if self.hasContent_():4386 self.exportLiteralChildren(outfile, level, name_)4387 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4388 if self.formButton is not None and 'formButton' not in already_processed:4389 already_processed.append('formButton')4390 showIndent(outfile, level)4391 outfile.write('formButton = "%s",\n' % (self.formButton,))4392 if self.displayValue is not None and 'displayValue' not in already_processed:4393 already_processed.append('displayValue')4394 showIndent(outfile, level)4395 outfile.write('displayValue = "%s",\n' % (self.displayValue,))4396 super(WidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4397 def exportLiteralChildren(self, outfile, level, name_):4398 super(WidgetStep, self).exportLiteralChildren(outfile, level, name_)4399 pass4400 def build(self, node):4401 self.buildAttributes(node, node.attrib, [])4402 for child in node:4403 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4404 self.buildChildren(child, node, nodeName_)4405 def buildAttributes(self, node, attrs, already_processed):4406 value = find_attr_value_('formButton', node)4407 if value is not None and 'formButton' not in already_processed:4408 already_processed.append('formButton')4409 self.formButton = value4410 self.validate_FormButton(self.formButton) # validate type FormButton4411 value = find_attr_value_('displayValue', node)4412 if value is not None and 'displayValue' not in already_processed:4413 already_processed.append('displayValue')4414 self.displayValue = value4415 value = find_attr_value_('xsi:type', node)4416 if value is not None and 'xsi:type' not in already_processed:4417 already_processed.append('xsi:type')4418 self.extensiontype_ = value4419 super(WidgetStep, self).buildAttributes(node, attrs, already_processed)4420 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4421 super(WidgetStep, self).buildChildren(child_, node, nodeName_, True)4422 pass4423# end class WidgetStep4424class TextWidgetStep(WidgetStep):4425 subclass = None4426 superclass = WidgetStep4427 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, value=None):4428 super(TextWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)4429 self.value = _cast(None, value)4430 pass4431 def factory(*args_, **kwargs_):4432 if TextWidgetStep.subclass:4433 return TextWidgetStep.subclass(*args_, **kwargs_)4434 else:4435 return TextWidgetStep(*args_, **kwargs_)4436 factory = staticmethod(factory)4437 def get_value(self): return self.value4438 def set_value(self, value): self.value = value4439 def export(self, outfile, level, namespace_='mstns:', name_='TextWidgetStep', namespacedef_=''):4440 showIndent(outfile, level)4441 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4442 already_processed = []4443 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TextWidgetStep')4444 if self.hasContent_():4445 outfile.write('>\n')4446 self.exportChildren(outfile, level + 1, namespace_, name_)4447 outfile.write('</%s%s>\n' % (namespace_, name_))4448 else:4449 outfile.write('/>\n')4450 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='TextWidgetStep'):4451 super(TextWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TextWidgetStep')4452 if self.value is not None and 'value' not in already_processed:4453 already_processed.append('value')4454 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))4455 def exportChildren(self, outfile, level, namespace_='mstns:', name_='TextWidgetStep', fromsubclass_=False):4456 super(TextWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4457 pass4458 def hasContent_(self):4459 if (4460 super(TextWidgetStep, self).hasContent_()4461 ):4462 return True4463 else:4464 return False4465 def exportLiteral(self, outfile, level, name_='TextWidgetStep'):4466 level += 14467 self.exportLiteralAttributes(outfile, level, [], name_)4468 if self.hasContent_():4469 self.exportLiteralChildren(outfile, level, name_)4470 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4471 if self.value is not None and 'value' not in already_processed:4472 already_processed.append('value')4473 showIndent(outfile, level)4474 outfile.write('value = "%s",\n' % (self.value,))4475 super(TextWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4476 def exportLiteralChildren(self, outfile, level, name_):4477 super(TextWidgetStep, self).exportLiteralChildren(outfile, level, name_)4478 pass4479 def build(self, node):4480 self.buildAttributes(node, node.attrib, [])4481 for child in node:4482 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4483 self.buildChildren(child, node, nodeName_)4484 def buildAttributes(self, node, attrs, already_processed):4485 value = find_attr_value_('value', node)4486 if value is not None and 'value' not in already_processed:4487 already_processed.append('value')4488 self.value = value4489 super(TextWidgetStep, self).buildAttributes(node, attrs, already_processed)4490 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4491 super(TextWidgetStep, self).buildChildren(child_, node, nodeName_, True)4492 pass4493# end class TextWidgetStep4494class SliderWidgetStep(WidgetStep):4495 subclass = None4496 superclass = WidgetStep4497 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, value=None):4498 super(SliderWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)4499 self.value = _cast(float, value)4500 pass4501 def factory(*args_, **kwargs_):4502 if SliderWidgetStep.subclass:4503 return SliderWidgetStep.subclass(*args_, **kwargs_)4504 else:4505 return SliderWidgetStep(*args_, **kwargs_)4506 factory = staticmethod(factory)4507 def get_value(self): return self.value4508 def set_value(self, value): self.value = value4509 def export(self, outfile, level, namespace_='mstns:', name_='SliderWidgetStep', namespacedef_=''):4510 showIndent(outfile, level)4511 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4512 already_processed = []4513 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SliderWidgetStep')4514 if self.hasContent_():4515 outfile.write('>\n')4516 self.exportChildren(outfile, level + 1, namespace_, name_)4517 outfile.write('</%s%s>\n' % (namespace_, name_))4518 else:4519 outfile.write('/>\n')4520 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='SliderWidgetStep'):4521 super(SliderWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SliderWidgetStep')4522 if self.value is not None and 'value' not in already_processed:4523 already_processed.append('value')4524 outfile.write(' value="%s"' % self.gds_format_float(self.value, input_name='value'))4525 def exportChildren(self, outfile, level, namespace_='mstns:', name_='SliderWidgetStep', fromsubclass_=False):4526 super(SliderWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4527 pass4528 def hasContent_(self):4529 if (4530 super(SliderWidgetStep, self).hasContent_()4531 ):4532 return True4533 else:4534 return False4535 def exportLiteral(self, outfile, level, name_='SliderWidgetStep'):4536 level += 14537 self.exportLiteralAttributes(outfile, level, [], name_)4538 if self.hasContent_():4539 self.exportLiteralChildren(outfile, level, name_)4540 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4541 if self.value is not None and 'value' not in already_processed:4542 already_processed.append('value')4543 showIndent(outfile, level)4544 outfile.write('value = %f,\n' % (self.value,))4545 super(SliderWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4546 def exportLiteralChildren(self, outfile, level, name_):4547 super(SliderWidgetStep, self).exportLiteralChildren(outfile, level, name_)4548 pass4549 def build(self, node):4550 self.buildAttributes(node, node.attrib, [])4551 for child in node:4552 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4553 self.buildChildren(child, node, nodeName_)4554 def buildAttributes(self, node, attrs, already_processed):4555 value = find_attr_value_('value', node)4556 if value is not None and 'value' not in already_processed:4557 already_processed.append('value')4558 try:4559 self.value = float(value)4560 except ValueError, exp:4561 raise ValueError('Bad float/double attribute (value): %s' % exp)4562 super(SliderWidgetStep, self).buildAttributes(node, attrs, already_processed)4563 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4564 super(SliderWidgetStep, self).buildChildren(child_, node, nodeName_, True)4565 pass4566# end class SliderWidgetStep4567class RangeSliderWidgetStep(WidgetStep):4568 subclass = None4569 superclass = WidgetStep4570 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, value=None):4571 super(RangeSliderWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)4572 if value is None:4573 self.value = []4574 else:4575 self.value = value4576 def factory(*args_, **kwargs_):4577 if RangeSliderWidgetStep.subclass:4578 return RangeSliderWidgetStep.subclass(*args_, **kwargs_)4579 else:4580 return RangeSliderWidgetStep(*args_, **kwargs_)4581 factory = staticmethod(factory)4582 def get_value(self): return self.value4583 def set_value(self, value): self.value = value4584 def add_value(self, value): self.value.append(value)4585 def insert_value(self, index, value): self.value[index] = value4586 def export(self, outfile, level, namespace_='mstns:', name_='RangeSliderWidgetStep', namespacedef_=''):4587 showIndent(outfile, level)4588 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4589 already_processed = []4590 self.exportAttributes(outfile, level, already_processed, namespace_, name_='RangeSliderWidgetStep')4591 if self.hasContent_():4592 outfile.write('>\n')4593 self.exportChildren(outfile, level + 1, namespace_, name_)4594 showIndent(outfile, level)4595 outfile.write('</%s%s>\n' % (namespace_, name_))4596 else:4597 outfile.write('/>\n')4598 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='RangeSliderWidgetStep'):4599 super(RangeSliderWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RangeSliderWidgetStep')4600 def exportChildren(self, outfile, level, namespace_='mstns:', name_='RangeSliderWidgetStep', fromsubclass_=False):4601 super(RangeSliderWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4602 for value_ in self.value:4603 value_.export(outfile, level, namespace_, name_='value')4604 def hasContent_(self):4605 if (4606 self.value or4607 super(RangeSliderWidgetStep, self).hasContent_()4608 ):4609 return True4610 else:4611 return False4612 def exportLiteral(self, outfile, level, name_='RangeSliderWidgetStep'):4613 level += 14614 self.exportLiteralAttributes(outfile, level, [], name_)4615 if self.hasContent_():4616 self.exportLiteralChildren(outfile, level, name_)4617 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4618 super(RangeSliderWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4619 def exportLiteralChildren(self, outfile, level, name_):4620 super(RangeSliderWidgetStep, self).exportLiteralChildren(outfile, level, name_)4621 showIndent(outfile, level)4622 outfile.write('value=[\n')4623 level += 14624 for value_ in self.value:4625 showIndent(outfile, level)4626 outfile.write('model_.FloatValue(\n')4627 value_.exportLiteral(outfile, level, name_='FloatValue')4628 showIndent(outfile, level)4629 outfile.write('),\n')4630 level -= 14631 showIndent(outfile, level)4632 outfile.write('],\n')4633 def build(self, node):4634 self.buildAttributes(node, node.attrib, [])4635 for child in node:4636 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4637 self.buildChildren(child, node, nodeName_)4638 def buildAttributes(self, node, attrs, already_processed):4639 super(RangeSliderWidgetStep, self).buildAttributes(node, attrs, already_processed)4640 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4641 if nodeName_ == 'value':4642 obj_ = FloatValue.factory()4643 obj_.build(child_)4644 self.value.append(obj_)4645 super(RangeSliderWidgetStep, self).buildChildren(child_, node, nodeName_, True)4646# end class RangeSliderWidgetStep4647class PhotoUploadWidgetStep(WidgetStep):4648 subclass = None4649 superclass = WidgetStep4650 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, value=None):4651 super(PhotoUploadWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)4652 self.value = _cast(None, value)4653 pass4654 def factory(*args_, **kwargs_):4655 if PhotoUploadWidgetStep.subclass:4656 return PhotoUploadWidgetStep.subclass(*args_, **kwargs_)4657 else:4658 return PhotoUploadWidgetStep(*args_, **kwargs_)4659 factory = staticmethod(factory)4660 def get_value(self): return self.value4661 def set_value(self, value): self.value = value4662 def export(self, outfile, level, namespace_='mstns:', name_='PhotoUploadWidgetStep', namespacedef_=''):4663 showIndent(outfile, level)4664 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4665 already_processed = []4666 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PhotoUploadWidgetStep')4667 if self.hasContent_():4668 outfile.write('>\n')4669 self.exportChildren(outfile, level + 1, namespace_, name_)4670 outfile.write('</%s%s>\n' % (namespace_, name_))4671 else:4672 outfile.write('/>\n')4673 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='PhotoUploadWidgetStep'):4674 super(PhotoUploadWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PhotoUploadWidgetStep')4675 if self.value is not None and 'value' not in already_processed:4676 already_processed.append('value')4677 outfile.write(' value=%s' % (self.gds_format_string(quote_attrib(self.value).encode(ExternalEncoding), input_name='value'),))4678 def exportChildren(self, outfile, level, namespace_='mstns:', name_='PhotoUploadWidgetStep', fromsubclass_=False):4679 super(PhotoUploadWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4680 pass4681 def hasContent_(self):4682 if (4683 super(PhotoUploadWidgetStep, self).hasContent_()4684 ):4685 return True4686 else:4687 return False4688 def exportLiteral(self, outfile, level, name_='PhotoUploadWidgetStep'):4689 level += 14690 self.exportLiteralAttributes(outfile, level, [], name_)4691 if self.hasContent_():4692 self.exportLiteralChildren(outfile, level, name_)4693 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4694 if self.value is not None and 'value' not in already_processed:4695 already_processed.append('value')4696 showIndent(outfile, level)4697 outfile.write('value = "%s",\n' % (self.value,))4698 super(PhotoUploadWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4699 def exportLiteralChildren(self, outfile, level, name_):4700 super(PhotoUploadWidgetStep, self).exportLiteralChildren(outfile, level, name_)4701 pass4702 def build(self, node):4703 self.buildAttributes(node, node.attrib, [])4704 for child in node:4705 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4706 self.buildChildren(child, node, nodeName_)4707 def buildAttributes(self, node, attrs, already_processed):4708 value = find_attr_value_('value', node)4709 if value is not None and 'value' not in already_processed:4710 already_processed.append('value')4711 self.value = value4712 super(PhotoUploadWidgetStep, self).buildAttributes(node, attrs, already_processed)4713 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4714 super(PhotoUploadWidgetStep, self).buildChildren(child_, node, nodeName_, True)4715 pass4716# end class PhotoUploadWidgetStep4717class GPSLocationWidgetStep(WidgetStep):4718 subclass = None4719 superclass = WidgetStep4720 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, timestamp=None, altitude=None, longitude=None, horizontalAccuracy=None, latitude=None, verticalAccuracy=None):4721 super(GPSLocationWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)4722 self.timestamp = _cast(int, timestamp)4723 self.altitude = _cast(float, altitude)4724 self.longitude = _cast(float, longitude)4725 self.horizontalAccuracy = _cast(float, horizontalAccuracy)4726 self.latitude = _cast(float, latitude)4727 self.verticalAccuracy = _cast(float, verticalAccuracy)4728 pass4729 def factory(*args_, **kwargs_):4730 if GPSLocationWidgetStep.subclass:4731 return GPSLocationWidgetStep.subclass(*args_, **kwargs_)4732 else:4733 return GPSLocationWidgetStep(*args_, **kwargs_)4734 factory = staticmethod(factory)4735 def get_timestamp(self): return self.timestamp4736 def set_timestamp(self, timestamp): self.timestamp = timestamp4737 def get_altitude(self): return self.altitude4738 def set_altitude(self, altitude): self.altitude = altitude4739 def get_longitude(self): return self.longitude4740 def set_longitude(self, longitude): self.longitude = longitude4741 def get_horizontalAccuracy(self): return self.horizontalAccuracy4742 def set_horizontalAccuracy(self, horizontalAccuracy): self.horizontalAccuracy = horizontalAccuracy4743 def get_latitude(self): return self.latitude4744 def set_latitude(self, latitude): self.latitude = latitude4745 def get_verticalAccuracy(self): return self.verticalAccuracy4746 def set_verticalAccuracy(self, verticalAccuracy): self.verticalAccuracy = verticalAccuracy4747 def export(self, outfile, level, namespace_='mstns:', name_='GPSLocationWidgetStep', namespacedef_=''):4748 showIndent(outfile, level)4749 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4750 already_processed = []4751 self.exportAttributes(outfile, level, already_processed, namespace_, name_='GPSLocationWidgetStep')4752 if self.hasContent_():4753 outfile.write('>\n')4754 self.exportChildren(outfile, level + 1, namespace_, name_)4755 outfile.write('</%s%s>\n' % (namespace_, name_))4756 else:4757 outfile.write('/>\n')4758 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='GPSLocationWidgetStep'):4759 super(GPSLocationWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='GPSLocationWidgetStep')4760 if self.timestamp is not None and 'timestamp' not in already_processed:4761 already_processed.append('timestamp')4762 outfile.write(' timestamp="%s"' % self.gds_format_integer(self.timestamp, input_name='timestamp'))4763 if self.altitude is not None and 'altitude' not in already_processed:4764 already_processed.append('altitude')4765 outfile.write(' altitude="%s"' % self.gds_format_float(self.altitude, input_name='altitude'))4766 if self.longitude is not None and 'longitude' not in already_processed:4767 already_processed.append('longitude')4768 outfile.write(' longitude="%s"' % self.gds_format_float(self.longitude, input_name='longitude'))4769 if self.horizontalAccuracy is not None and 'horizontalAccuracy' not in already_processed:4770 already_processed.append('horizontalAccuracy')4771 outfile.write(' horizontalAccuracy="%s"' % self.gds_format_float(self.horizontalAccuracy, input_name='horizontalAccuracy'))4772 if self.latitude is not None and 'latitude' not in already_processed:4773 already_processed.append('latitude')4774 outfile.write(' latitude="%s"' % self.gds_format_float(self.latitude, input_name='latitude'))4775 if self.verticalAccuracy is not None and 'verticalAccuracy' not in already_processed:4776 already_processed.append('verticalAccuracy')4777 outfile.write(' verticalAccuracy="%s"' % self.gds_format_float(self.verticalAccuracy, input_name='verticalAccuracy'))4778 def exportChildren(self, outfile, level, namespace_='mstns:', name_='GPSLocationWidgetStep', fromsubclass_=False):4779 super(GPSLocationWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)4780 pass4781 def hasContent_(self):4782 if (4783 super(GPSLocationWidgetStep, self).hasContent_()4784 ):4785 return True4786 else:4787 return False4788 def exportLiteral(self, outfile, level, name_='GPSLocationWidgetStep'):4789 level += 14790 self.exportLiteralAttributes(outfile, level, [], name_)4791 if self.hasContent_():4792 self.exportLiteralChildren(outfile, level, name_)4793 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4794 if self.timestamp is not None and 'timestamp' not in already_processed:4795 already_processed.append('timestamp')4796 showIndent(outfile, level)4797 outfile.write('timestamp = %d,\n' % (self.timestamp,))4798 if self.altitude is not None and 'altitude' not in already_processed:4799 already_processed.append('altitude')4800 showIndent(outfile, level)4801 outfile.write('altitude = %f,\n' % (self.altitude,))4802 if self.longitude is not None and 'longitude' not in already_processed:4803 already_processed.append('longitude')4804 showIndent(outfile, level)4805 outfile.write('longitude = %f,\n' % (self.longitude,))4806 if self.horizontalAccuracy is not None and 'horizontalAccuracy' not in already_processed:4807 already_processed.append('horizontalAccuracy')4808 showIndent(outfile, level)4809 outfile.write('horizontalAccuracy = %f,\n' % (self.horizontalAccuracy,))4810 if self.latitude is not None and 'latitude' not in already_processed:4811 already_processed.append('latitude')4812 showIndent(outfile, level)4813 outfile.write('latitude = %f,\n' % (self.latitude,))4814 if self.verticalAccuracy is not None and 'verticalAccuracy' not in already_processed:4815 already_processed.append('verticalAccuracy')4816 showIndent(outfile, level)4817 outfile.write('verticalAccuracy = %f,\n' % (self.verticalAccuracy,))4818 super(GPSLocationWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)4819 def exportLiteralChildren(self, outfile, level, name_):4820 super(GPSLocationWidgetStep, self).exportLiteralChildren(outfile, level, name_)4821 pass4822 def build(self, node):4823 self.buildAttributes(node, node.attrib, [])4824 for child in node:4825 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4826 self.buildChildren(child, node, nodeName_)4827 def buildAttributes(self, node, attrs, already_processed):4828 value = find_attr_value_('timestamp', node)4829 if value is not None and 'timestamp' not in already_processed:4830 already_processed.append('timestamp')4831 try:4832 self.timestamp = int(value)4833 except ValueError, exp:4834 raise_parse_error(node, 'Bad integer attribute: %s' % exp)4835 value = find_attr_value_('altitude', node)4836 if value is not None and 'altitude' not in already_processed:4837 already_processed.append('altitude')4838 try:4839 self.altitude = float(value)4840 except ValueError, exp:4841 raise ValueError('Bad float/double attribute (altitude): %s' % exp)4842 value = find_attr_value_('longitude', node)4843 if value is not None and 'longitude' not in already_processed:4844 already_processed.append('longitude')4845 try:4846 self.longitude = float(value)4847 except ValueError, exp:4848 raise ValueError('Bad float/double attribute (longitude): %s' % exp)4849 value = find_attr_value_('horizontalAccuracy', node)4850 if value is not None and 'horizontalAccuracy' not in already_processed:4851 already_processed.append('horizontalAccuracy')4852 try:4853 self.horizontalAccuracy = float(value)4854 except ValueError, exp:4855 raise ValueError('Bad float/double attribute (horizontalAccuracy): %s' % exp)4856 value = find_attr_value_('latitude', node)4857 if value is not None and 'latitude' not in already_processed:4858 already_processed.append('latitude')4859 try:4860 self.latitude = float(value)4861 except ValueError, exp:4862 raise ValueError('Bad float/double attribute (latitude): %s' % exp)4863 value = find_attr_value_('verticalAccuracy', node)4864 if value is not None and 'verticalAccuracy' not in already_processed:4865 already_processed.append('verticalAccuracy')4866 try:4867 self.verticalAccuracy = float(value)4868 except ValueError, exp:4869 raise ValueError('Bad float/double attribute (verticalAccuracy): %s' % exp)4870 super(GPSLocationWidgetStep, self).buildAttributes(node, attrs, already_processed)4871 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4872 super(GPSLocationWidgetStep, self).buildChildren(child_, node, nodeName_, True)4873 pass4874# end class GPSLocationWidgetStep4875class MyDigiPassEidProfile(GeneratedsSuper):4876 subclass = None4877 superclass = None4878 def __init__(self, locationOfBirth=None, validityEndsAt=None, firstName=None, chipNumber=None, lastName=None, nobleCondition=None, validityBeginsAt=None, dateOfBirth=None, cardNumber=None, firstName3=None, gender=None, nationality=None, createdAt=None, issuingMunicipality=None):4879 self.locationOfBirth = _cast(None, locationOfBirth)4880 self.validityEndsAt = _cast(None, validityEndsAt)4881 self.firstName = _cast(None, firstName)4882 self.chipNumber = _cast(None, chipNumber)4883 self.lastName = _cast(None, lastName)4884 self.nobleCondition = _cast(None, nobleCondition)4885 self.validityBeginsAt = _cast(None, validityBeginsAt)4886 self.dateOfBirth = _cast(None, dateOfBirth)4887 self.cardNumber = _cast(None, cardNumber)4888 self.firstName3 = _cast(None, firstName3)4889 self.gender = _cast(None, gender)4890 self.nationality = _cast(None, nationality)4891 self.createdAt = _cast(None, createdAt)4892 self.issuingMunicipality = _cast(None, issuingMunicipality)4893 pass4894 def factory(*args_, **kwargs_):4895 if MyDigiPassEidProfile.subclass:4896 return MyDigiPassEidProfile.subclass(*args_, **kwargs_)4897 else:4898 return MyDigiPassEidProfile(*args_, **kwargs_)4899 factory = staticmethod(factory)4900 def get_locationOfBirth(self): return self.locationOfBirth4901 def set_locationOfBirth(self, locationOfBirth): self.locationOfBirth = locationOfBirth4902 def get_validityEndsAt(self): return self.validityEndsAt4903 def set_validityEndsAt(self, validityEndsAt): self.validityEndsAt = validityEndsAt4904 def get_firstName(self): return self.firstName4905 def set_firstName(self, firstName): self.firstName = firstName4906 def get_chipNumber(self): return self.chipNumber4907 def set_chipNumber(self, chipNumber): self.chipNumber = chipNumber4908 def get_lastName(self): return self.lastName4909 def set_lastName(self, lastName): self.lastName = lastName4910 def get_nobleCondition(self): return self.nobleCondition4911 def set_nobleCondition(self, nobleCondition): self.nobleCondition = nobleCondition4912 def get_validityBeginsAt(self): return self.validityBeginsAt4913 def set_validityBeginsAt(self, validityBeginsAt): self.validityBeginsAt = validityBeginsAt4914 def get_dateOfBirth(self): return self.dateOfBirth4915 def set_dateOfBirth(self, dateOfBirth): self.dateOfBirth = dateOfBirth4916 def get_cardNumber(self): return self.cardNumber4917 def set_cardNumber(self, cardNumber): self.cardNumber = cardNumber4918 def get_firstName3(self): return self.firstName34919 def set_firstName3(self, firstName3): self.firstName3 = firstName34920 def get_gender(self): return self.gender4921 def set_gender(self, gender): self.gender = gender4922 def get_nationality(self): return self.nationality4923 def set_nationality(self, nationality): self.nationality = nationality4924 def get_createdAt(self): return self.createdAt4925 def set_createdAt(self, createdAt): self.createdAt = createdAt4926 def get_issuingMunicipality(self): return self.issuingMunicipality4927 def set_issuingMunicipality(self, issuingMunicipality): self.issuingMunicipality = issuingMunicipality4928 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassEidProfile', namespacedef_=''):4929 showIndent(outfile, level)4930 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))4931 already_processed = []4932 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassEidProfile')4933 if self.hasContent_():4934 outfile.write('>\n')4935 self.exportChildren(outfile, level + 1, namespace_, name_)4936 outfile.write('</%s%s>\n' % (namespace_, name_))4937 else:4938 outfile.write('/>\n')4939 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassEidProfile'):4940 if self.locationOfBirth is not None and 'locationOfBirth' not in already_processed:4941 already_processed.append('locationOfBirth')4942 outfile.write(' locationOfBirth=%s' % (self.gds_format_string(quote_attrib(self.locationOfBirth).encode(ExternalEncoding), input_name='locationOfBirth'),))4943 if self.validityEndsAt is not None and 'validityEndsAt' not in already_processed:4944 already_processed.append('validityEndsAt')4945 outfile.write(' validityEndsAt=%s' % (self.gds_format_string(quote_attrib(self.validityEndsAt).encode(ExternalEncoding), input_name='validityEndsAt'),))4946 if self.firstName is not None and 'firstName' not in already_processed:4947 already_processed.append('firstName')4948 outfile.write(' firstName=%s' % (self.gds_format_string(quote_attrib(self.firstName).encode(ExternalEncoding), input_name='firstName'),))4949 if self.chipNumber is not None and 'chipNumber' not in already_processed:4950 already_processed.append('chipNumber')4951 outfile.write(' chipNumber=%s' % (self.gds_format_string(quote_attrib(self.chipNumber).encode(ExternalEncoding), input_name='chipNumber'),))4952 if self.lastName is not None and 'lastName' not in already_processed:4953 already_processed.append('lastName')4954 outfile.write(' lastName=%s' % (self.gds_format_string(quote_attrib(self.lastName).encode(ExternalEncoding), input_name='lastName'),))4955 if self.nobleCondition is not None and 'nobleCondition' not in already_processed:4956 already_processed.append('nobleCondition')4957 outfile.write(' nobleCondition=%s' % (self.gds_format_string(quote_attrib(self.nobleCondition).encode(ExternalEncoding), input_name='nobleCondition'),))4958 if self.validityBeginsAt is not None and 'validityBeginsAt' not in already_processed:4959 already_processed.append('validityBeginsAt')4960 outfile.write(' validityBeginsAt=%s' % (self.gds_format_string(quote_attrib(self.validityBeginsAt).encode(ExternalEncoding), input_name='validityBeginsAt'),))4961 if self.dateOfBirth is not None and 'dateOfBirth' not in already_processed:4962 already_processed.append('dateOfBirth')4963 outfile.write(' dateOfBirth=%s' % (self.gds_format_string(quote_attrib(self.dateOfBirth).encode(ExternalEncoding), input_name='dateOfBirth'),))4964 if self.cardNumber is not None and 'cardNumber' not in already_processed:4965 already_processed.append('cardNumber')4966 outfile.write(' cardNumber=%s' % (self.gds_format_string(quote_attrib(self.cardNumber).encode(ExternalEncoding), input_name='cardNumber'),))4967 if self.firstName3 is not None and 'firstName3' not in already_processed:4968 already_processed.append('firstName3')4969 outfile.write(' firstName3=%s' % (self.gds_format_string(quote_attrib(self.firstName3).encode(ExternalEncoding), input_name='firstName3'),))4970 if self.gender is not None and 'gender' not in already_processed:4971 already_processed.append('gender')4972 outfile.write(' gender=%s' % (self.gds_format_string(quote_attrib(self.gender).encode(ExternalEncoding), input_name='gender'),))4973 if self.nationality is not None and 'nationality' not in already_processed:4974 already_processed.append('nationality')4975 outfile.write(' nationality=%s' % (self.gds_format_string(quote_attrib(self.nationality).encode(ExternalEncoding), input_name='nationality'),))4976 if self.createdAt is not None and 'createdAt' not in already_processed:4977 already_processed.append('createdAt')4978 outfile.write(' createdAt=%s' % (self.gds_format_string(quote_attrib(self.createdAt).encode(ExternalEncoding), input_name='createdAt'),))4979 if self.issuingMunicipality is not None and 'issuingMunicipality' not in already_processed:4980 already_processed.append('issuingMunicipality')4981 outfile.write(' issuingMunicipality=%s' % (self.gds_format_string(quote_attrib(self.issuingMunicipality).encode(ExternalEncoding), input_name='issuingMunicipality'),))4982 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassEidProfile', fromsubclass_=False):4983 pass4984 def hasContent_(self):4985 if (4986 ):4987 return True4988 else:4989 return False4990 def exportLiteral(self, outfile, level, name_='MyDigiPassEidProfile'):4991 level += 14992 self.exportLiteralAttributes(outfile, level, [], name_)4993 if self.hasContent_():4994 self.exportLiteralChildren(outfile, level, name_)4995 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4996 if self.locationOfBirth is not None and 'locationOfBirth' not in already_processed:4997 already_processed.append('locationOfBirth')4998 showIndent(outfile, level)4999 outfile.write('locationOfBirth = "%s",\n' % (self.locationOfBirth,))5000 if self.validityEndsAt is not None and 'validityEndsAt' not in already_processed:5001 already_processed.append('validityEndsAt')5002 showIndent(outfile, level)5003 outfile.write('validityEndsAt = "%s",\n' % (self.validityEndsAt,))5004 if self.firstName is not None and 'firstName' not in already_processed:5005 already_processed.append('firstName')5006 showIndent(outfile, level)5007 outfile.write('firstName = "%s",\n' % (self.firstName,))5008 if self.chipNumber is not None and 'chipNumber' not in already_processed:5009 already_processed.append('chipNumber')5010 showIndent(outfile, level)5011 outfile.write('chipNumber = "%s",\n' % (self.chipNumber,))5012 if self.lastName is not None and 'lastName' not in already_processed:5013 already_processed.append('lastName')5014 showIndent(outfile, level)5015 outfile.write('lastName = "%s",\n' % (self.lastName,))5016 if self.nobleCondition is not None and 'nobleCondition' not in already_processed:5017 already_processed.append('nobleCondition')5018 showIndent(outfile, level)5019 outfile.write('nobleCondition = "%s",\n' % (self.nobleCondition,))5020 if self.validityBeginsAt is not None and 'validityBeginsAt' not in already_processed:5021 already_processed.append('validityBeginsAt')5022 showIndent(outfile, level)5023 outfile.write('validityBeginsAt = "%s",\n' % (self.validityBeginsAt,))5024 if self.dateOfBirth is not None and 'dateOfBirth' not in already_processed:5025 already_processed.append('dateOfBirth')5026 showIndent(outfile, level)5027 outfile.write('dateOfBirth = "%s",\n' % (self.dateOfBirth,))5028 if self.cardNumber is not None and 'cardNumber' not in already_processed:5029 already_processed.append('cardNumber')5030 showIndent(outfile, level)5031 outfile.write('cardNumber = "%s",\n' % (self.cardNumber,))5032 if self.firstName3 is not None and 'firstName3' not in already_processed:5033 already_processed.append('firstName3')5034 showIndent(outfile, level)5035 outfile.write('firstName3 = "%s",\n' % (self.firstName3,))5036 if self.gender is not None and 'gender' not in already_processed:5037 already_processed.append('gender')5038 showIndent(outfile, level)5039 outfile.write('gender = "%s",\n' % (self.gender,))5040 if self.nationality is not None and 'nationality' not in already_processed:5041 already_processed.append('nationality')5042 showIndent(outfile, level)5043 outfile.write('nationality = "%s",\n' % (self.nationality,))5044 if self.createdAt is not None and 'createdAt' not in already_processed:5045 already_processed.append('createdAt')5046 showIndent(outfile, level)5047 outfile.write('createdAt = "%s",\n' % (self.createdAt,))5048 if self.issuingMunicipality is not None and 'issuingMunicipality' not in already_processed:5049 already_processed.append('issuingMunicipality')5050 showIndent(outfile, level)5051 outfile.write('issuingMunicipality = "%s",\n' % (self.issuingMunicipality,))5052 def exportLiteralChildren(self, outfile, level, name_):5053 pass5054 def build(self, node):5055 self.buildAttributes(node, node.attrib, [])5056 for child in node:5057 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5058 self.buildChildren(child, node, nodeName_)5059 def buildAttributes(self, node, attrs, already_processed):5060 value = find_attr_value_('locationOfBirth', node)5061 if value is not None and 'locationOfBirth' not in already_processed:5062 already_processed.append('locationOfBirth')5063 self.locationOfBirth = value5064 value = find_attr_value_('validityEndsAt', node)5065 if value is not None and 'validityEndsAt' not in already_processed:5066 already_processed.append('validityEndsAt')5067 self.validityEndsAt = value5068 value = find_attr_value_('firstName', node)5069 if value is not None and 'firstName' not in already_processed:5070 already_processed.append('firstName')5071 self.firstName = value5072 value = find_attr_value_('chipNumber', node)5073 if value is not None and 'chipNumber' not in already_processed:5074 already_processed.append('chipNumber')5075 self.chipNumber = value5076 value = find_attr_value_('lastName', node)5077 if value is not None and 'lastName' not in already_processed:5078 already_processed.append('lastName')5079 self.lastName = value5080 value = find_attr_value_('nobleCondition', node)5081 if value is not None and 'nobleCondition' not in already_processed:5082 already_processed.append('nobleCondition')5083 self.nobleCondition = value5084 value = find_attr_value_('validityBeginsAt', node)5085 if value is not None and 'validityBeginsAt' not in already_processed:5086 already_processed.append('validityBeginsAt')5087 self.validityBeginsAt = value5088 value = find_attr_value_('dateOfBirth', node)5089 if value is not None and 'dateOfBirth' not in already_processed:5090 already_processed.append('dateOfBirth')5091 self.dateOfBirth = value5092 value = find_attr_value_('cardNumber', node)5093 if value is not None and 'cardNumber' not in already_processed:5094 already_processed.append('cardNumber')5095 self.cardNumber = value5096 value = find_attr_value_('firstName3', node)5097 if value is not None and 'firstName3' not in already_processed:5098 already_processed.append('firstName3')5099 self.firstName3 = value5100 value = find_attr_value_('gender', node)5101 if value is not None and 'gender' not in already_processed:5102 already_processed.append('gender')5103 self.gender = value5104 value = find_attr_value_('nationality', node)5105 if value is not None and 'nationality' not in already_processed:5106 already_processed.append('nationality')5107 self.nationality = value5108 value = find_attr_value_('createdAt', node)5109 if value is not None and 'createdAt' not in already_processed:5110 already_processed.append('createdAt')5111 self.createdAt = value5112 value = find_attr_value_('issuingMunicipality', node)5113 if value is not None and 'issuingMunicipality' not in already_processed:5114 already_processed.append('issuingMunicipality')5115 self.issuingMunicipality = value5116 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5117 pass5118# end class MyDigiPassEidProfile5119class MyDigiPassEidAddress(GeneratedsSuper):5120 subclass = None5121 superclass = None5122 def __init__(self, municipality=None, streetAndNumber=None, zipCode=None):5123 self.municipality = _cast(None, municipality)5124 self.streetAndNumber = _cast(None, streetAndNumber)5125 self.zipCode = _cast(None, zipCode)5126 pass5127 def factory(*args_, **kwargs_):5128 if MyDigiPassEidAddress.subclass:5129 return MyDigiPassEidAddress.subclass(*args_, **kwargs_)5130 else:5131 return MyDigiPassEidAddress(*args_, **kwargs_)5132 factory = staticmethod(factory)5133 def get_municipality(self): return self.municipality5134 def set_municipality(self, municipality): self.municipality = municipality5135 def get_streetAndNumber(self): return self.streetAndNumber5136 def set_streetAndNumber(self, streetAndNumber): self.streetAndNumber = streetAndNumber5137 def get_zipCode(self): return self.zipCode5138 def set_zipCode(self, zipCode): self.zipCode = zipCode5139 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassEidAddress', namespacedef_=''):5140 showIndent(outfile, level)5141 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))5142 already_processed = []5143 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassEidAddress')5144 if self.hasContent_():5145 outfile.write('>\n')5146 self.exportChildren(outfile, level + 1, namespace_, name_)5147 outfile.write('</%s%s>\n' % (namespace_, name_))5148 else:5149 outfile.write('/>\n')5150 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassEidAddress'):5151 if self.municipality is not None and 'municipality' not in already_processed:5152 already_processed.append('municipality')5153 outfile.write(' municipality=%s' % (self.gds_format_string(quote_attrib(self.municipality).encode(ExternalEncoding), input_name='municipality'),))5154 if self.streetAndNumber is not None and 'streetAndNumber' not in already_processed:5155 already_processed.append('streetAndNumber')5156 outfile.write(' streetAndNumber=%s' % (self.gds_format_string(quote_attrib(self.streetAndNumber).encode(ExternalEncoding), input_name='streetAndNumber'),))5157 if self.zipCode is not None and 'zipCode' not in already_processed:5158 already_processed.append('zipCode')5159 outfile.write(' zipCode=%s' % (self.gds_format_string(quote_attrib(self.zipCode).encode(ExternalEncoding), input_name='zipCode'),))5160 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassEidAddress', fromsubclass_=False):5161 pass5162 def hasContent_(self):5163 if (5164 ):5165 return True5166 else:5167 return False5168 def exportLiteral(self, outfile, level, name_='MyDigiPassEidAddress'):5169 level += 15170 self.exportLiteralAttributes(outfile, level, [], name_)5171 if self.hasContent_():5172 self.exportLiteralChildren(outfile, level, name_)5173 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5174 if self.municipality is not None and 'municipality' not in already_processed:5175 already_processed.append('municipality')5176 showIndent(outfile, level)5177 outfile.write('municipality = "%s",\n' % (self.municipality,))5178 if self.streetAndNumber is not None and 'streetAndNumber' not in already_processed:5179 already_processed.append('streetAndNumber')5180 showIndent(outfile, level)5181 outfile.write('streetAndNumber = "%s",\n' % (self.streetAndNumber,))5182 if self.zipCode is not None and 'zipCode' not in already_processed:5183 already_processed.append('zipCode')5184 showIndent(outfile, level)5185 outfile.write('zipCode = "%s",\n' % (self.zipCode,))5186 def exportLiteralChildren(self, outfile, level, name_):5187 pass5188 def build(self, node):5189 self.buildAttributes(node, node.attrib, [])5190 for child in node:5191 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5192 self.buildChildren(child, node, nodeName_)5193 def buildAttributes(self, node, attrs, already_processed):5194 value = find_attr_value_('municipality', node)5195 if value is not None and 'municipality' not in already_processed:5196 already_processed.append('municipality')5197 self.municipality = value5198 value = find_attr_value_('streetAndNumber', node)5199 if value is not None and 'streetAndNumber' not in already_processed:5200 already_processed.append('streetAndNumber')5201 self.streetAndNumber = value5202 value = find_attr_value_('zipCode', node)5203 if value is not None and 'zipCode' not in already_processed:5204 already_processed.append('zipCode')5205 self.zipCode = value5206 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5207 pass5208# end class MyDigiPassEidAddress5209class MyDigiPassProfile(GeneratedsSuper):5210 subclass = None5211 superclass = None5212 def __init__(self, uuid=None, firstName=None, lastName=None, preferredLocale=None, updatedAt=None, bornOn=None):5213 self.uuid = _cast(None, uuid)5214 self.firstName = _cast(None, firstName)5215 self.lastName = _cast(None, lastName)5216 self.preferredLocale = _cast(None, preferredLocale)5217 self.updatedAt = _cast(None, updatedAt)5218 self.bornOn = _cast(None, bornOn)5219 pass5220 def factory(*args_, **kwargs_):5221 if MyDigiPassProfile.subclass:5222 return MyDigiPassProfile.subclass(*args_, **kwargs_)5223 else:5224 return MyDigiPassProfile(*args_, **kwargs_)5225 factory = staticmethod(factory)5226 def get_uuid(self): return self.uuid5227 def set_uuid(self, uuid): self.uuid = uuid5228 def get_firstName(self): return self.firstName5229 def set_firstName(self, firstName): self.firstName = firstName5230 def get_lastName(self): return self.lastName5231 def set_lastName(self, lastName): self.lastName = lastName5232 def get_preferredLocale(self): return self.preferredLocale5233 def set_preferredLocale(self, preferredLocale): self.preferredLocale = preferredLocale5234 def get_updatedAt(self): return self.updatedAt5235 def set_updatedAt(self, updatedAt): self.updatedAt = updatedAt5236 def get_bornOn(self): return self.bornOn5237 def set_bornOn(self, bornOn): self.bornOn = bornOn5238 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassProfile', namespacedef_=''):5239 showIndent(outfile, level)5240 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))5241 already_processed = []5242 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassProfile')5243 if self.hasContent_():5244 outfile.write('>\n')5245 self.exportChildren(outfile, level + 1, namespace_, name_)5246 outfile.write('</%s%s>\n' % (namespace_, name_))5247 else:5248 outfile.write('/>\n')5249 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassProfile'):5250 if self.uuid is not None and 'uuid' not in already_processed:5251 already_processed.append('uuid')5252 outfile.write(' uuid=%s' % (self.gds_format_string(quote_attrib(self.uuid).encode(ExternalEncoding), input_name='uuid'),))5253 if self.firstName is not None and 'firstName' not in already_processed:5254 already_processed.append('firstName')5255 outfile.write(' firstName=%s' % (self.gds_format_string(quote_attrib(self.firstName).encode(ExternalEncoding), input_name='firstName'),))5256 if self.lastName is not None and 'lastName' not in already_processed:5257 already_processed.append('lastName')5258 outfile.write(' lastName=%s' % (self.gds_format_string(quote_attrib(self.lastName).encode(ExternalEncoding), input_name='lastName'),))5259 if self.preferredLocale is not None and 'preferredLocale' not in already_processed:5260 already_processed.append('preferredLocale')5261 outfile.write(' preferredLocale=%s' % (self.gds_format_string(quote_attrib(self.preferredLocale).encode(ExternalEncoding), input_name='preferredLocale'),))5262 if self.updatedAt is not None and 'updatedAt' not in already_processed:5263 already_processed.append('updatedAt')5264 outfile.write(' updatedAt=%s' % (self.gds_format_string(quote_attrib(self.updatedAt).encode(ExternalEncoding), input_name='updatedAt'),))5265 if self.bornOn is not None and 'bornOn' not in already_processed:5266 already_processed.append('bornOn')5267 outfile.write(' bornOn=%s' % (self.gds_format_string(quote_attrib(self.bornOn).encode(ExternalEncoding), input_name='bornOn'),))5268 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassProfile', fromsubclass_=False):5269 pass5270 def hasContent_(self):5271 if (5272 ):5273 return True5274 else:5275 return False5276 def exportLiteral(self, outfile, level, name_='MyDigiPassProfile'):5277 level += 15278 self.exportLiteralAttributes(outfile, level, [], name_)5279 if self.hasContent_():5280 self.exportLiteralChildren(outfile, level, name_)5281 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5282 if self.uuid is not None and 'uuid' not in already_processed:5283 already_processed.append('uuid')5284 showIndent(outfile, level)5285 outfile.write('uuid = "%s",\n' % (self.uuid,))5286 if self.firstName is not None and 'firstName' not in already_processed:5287 already_processed.append('firstName')5288 showIndent(outfile, level)5289 outfile.write('firstName = "%s",\n' % (self.firstName,))5290 if self.lastName is not None and 'lastName' not in already_processed:5291 already_processed.append('lastName')5292 showIndent(outfile, level)5293 outfile.write('lastName = "%s",\n' % (self.lastName,))5294 if self.preferredLocale is not None and 'preferredLocale' not in already_processed:5295 already_processed.append('preferredLocale')5296 showIndent(outfile, level)5297 outfile.write('preferredLocale = "%s",\n' % (self.preferredLocale,))5298 if self.updatedAt is not None and 'updatedAt' not in already_processed:5299 already_processed.append('updatedAt')5300 showIndent(outfile, level)5301 outfile.write('updatedAt = "%s",\n' % (self.updatedAt,))5302 if self.bornOn is not None and 'bornOn' not in already_processed:5303 already_processed.append('bornOn')5304 showIndent(outfile, level)5305 outfile.write('bornOn = "%s",\n' % (self.bornOn,))5306 def exportLiteralChildren(self, outfile, level, name_):5307 pass5308 def build(self, node):5309 self.buildAttributes(node, node.attrib, [])5310 for child in node:5311 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5312 self.buildChildren(child, node, nodeName_)5313 def buildAttributes(self, node, attrs, already_processed):5314 value = find_attr_value_('uuid', node)5315 if value is not None and 'uuid' not in already_processed:5316 already_processed.append('uuid')5317 self.uuid = value5318 value = find_attr_value_('firstName', node)5319 if value is not None and 'firstName' not in already_processed:5320 already_processed.append('firstName')5321 self.firstName = value5322 value = find_attr_value_('lastName', node)5323 if value is not None and 'lastName' not in already_processed:5324 already_processed.append('lastName')5325 self.lastName = value5326 value = find_attr_value_('preferredLocale', node)5327 if value is not None and 'preferredLocale' not in already_processed:5328 already_processed.append('preferredLocale')5329 self.preferredLocale = value5330 value = find_attr_value_('updatedAt', node)5331 if value is not None and 'updatedAt' not in already_processed:5332 already_processed.append('updatedAt')5333 self.updatedAt = value5334 value = find_attr_value_('bornOn', node)5335 if value is not None and 'bornOn' not in already_processed:5336 already_processed.append('bornOn')5337 self.bornOn = value5338 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5339 pass5340# end class MyDigiPassProfile5341class MyDigiPassAddress(GeneratedsSuper):5342 subclass = None5343 superclass = None5344 def __init__(self, city=None, zip=None, address1=None, address2=None, state=None, country=None):5345 self.city = _cast(None, city)5346 self.zip = _cast(None, zip)5347 self.address1 = _cast(None, address1)5348 self.address2 = _cast(None, address2)5349 self.state = _cast(None, state)5350 self.country = _cast(None, country)5351 pass5352 def factory(*args_, **kwargs_):5353 if MyDigiPassAddress.subclass:5354 return MyDigiPassAddress.subclass(*args_, **kwargs_)5355 else:5356 return MyDigiPassAddress(*args_, **kwargs_)5357 factory = staticmethod(factory)5358 def get_city(self): return self.city5359 def set_city(self, city): self.city = city5360 def get_zip(self): return self.zip5361 def set_zip(self, zip): self.zip = zip5362 def get_address1(self): return self.address15363 def set_address1(self, address1): self.address1 = address15364 def get_address2(self): return self.address25365 def set_address2(self, address2): self.address2 = address25366 def get_state(self): return self.state5367 def set_state(self, state): self.state = state5368 def get_country(self): return self.country5369 def set_country(self, country): self.country = country5370 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassAddress', namespacedef_=''):5371 showIndent(outfile, level)5372 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))5373 already_processed = []5374 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassAddress')5375 if self.hasContent_():5376 outfile.write('>\n')5377 self.exportChildren(outfile, level + 1, namespace_, name_)5378 outfile.write('</%s%s>\n' % (namespace_, name_))5379 else:5380 outfile.write('/>\n')5381 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassAddress'):5382 if self.city is not None and 'city' not in already_processed:5383 already_processed.append('city')5384 outfile.write(' city=%s' % (self.gds_format_string(quote_attrib(self.city).encode(ExternalEncoding), input_name='city'),))5385 if self.zip is not None and 'zip' not in already_processed:5386 already_processed.append('zip')5387 outfile.write(' zip=%s' % (self.gds_format_string(quote_attrib(self.zip).encode(ExternalEncoding), input_name='zip'),))5388 if self.address1 is not None and 'address1' not in already_processed:5389 already_processed.append('address1')5390 outfile.write(' address1=%s' % (self.gds_format_string(quote_attrib(self.address1).encode(ExternalEncoding), input_name='address1'),))5391 if self.address2 is not None and 'address2' not in already_processed:5392 already_processed.append('address2')5393 outfile.write(' address2=%s' % (self.gds_format_string(quote_attrib(self.address2).encode(ExternalEncoding), input_name='address2'),))5394 if self.state is not None and 'state' not in already_processed:5395 already_processed.append('state')5396 outfile.write(' state=%s' % (self.gds_format_string(quote_attrib(self.state).encode(ExternalEncoding), input_name='state'),))5397 if self.country is not None and 'country' not in already_processed:5398 already_processed.append('country')5399 outfile.write(' country=%s' % (self.gds_format_string(quote_attrib(self.country).encode(ExternalEncoding), input_name='country'),))5400 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassAddress', fromsubclass_=False):5401 pass5402 def hasContent_(self):5403 if (5404 ):5405 return True5406 else:5407 return False5408 def exportLiteral(self, outfile, level, name_='MyDigiPassAddress'):5409 level += 15410 self.exportLiteralAttributes(outfile, level, [], name_)5411 if self.hasContent_():5412 self.exportLiteralChildren(outfile, level, name_)5413 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5414 if self.city is not None and 'city' not in already_processed:5415 already_processed.append('city')5416 showIndent(outfile, level)5417 outfile.write('city = "%s",\n' % (self.city,))5418 if self.zip is not None and 'zip' not in already_processed:5419 already_processed.append('zip')5420 showIndent(outfile, level)5421 outfile.write('zip = "%s",\n' % (self.zip,))5422 if self.address1 is not None and 'address1' not in already_processed:5423 already_processed.append('address1')5424 showIndent(outfile, level)5425 outfile.write('address1 = "%s",\n' % (self.address1,))5426 if self.address2 is not None and 'address2' not in already_processed:5427 already_processed.append('address2')5428 showIndent(outfile, level)5429 outfile.write('address2 = "%s",\n' % (self.address2,))5430 if self.state is not None and 'state' not in already_processed:5431 already_processed.append('state')5432 showIndent(outfile, level)5433 outfile.write('state = "%s",\n' % (self.state,))5434 if self.country is not None and 'country' not in already_processed:5435 already_processed.append('country')5436 showIndent(outfile, level)5437 outfile.write('country = "%s",\n' % (self.country,))5438 def exportLiteralChildren(self, outfile, level, name_):5439 pass5440 def build(self, node):5441 self.buildAttributes(node, node.attrib, [])5442 for child in node:5443 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5444 self.buildChildren(child, node, nodeName_)5445 def buildAttributes(self, node, attrs, already_processed):5446 value = find_attr_value_('city', node)5447 if value is not None and 'city' not in already_processed:5448 already_processed.append('city')5449 self.city = value5450 value = find_attr_value_('zip', node)5451 if value is not None and 'zip' not in already_processed:5452 already_processed.append('zip')5453 self.zip = value5454 value = find_attr_value_('address1', node)5455 if value is not None and 'address1' not in already_processed:5456 already_processed.append('address1')5457 self.address1 = value5458 value = find_attr_value_('address2', node)5459 if value is not None and 'address2' not in already_processed:5460 already_processed.append('address2')5461 self.address2 = value5462 value = find_attr_value_('state', node)5463 if value is not None and 'state' not in already_processed:5464 already_processed.append('state')5465 self.state = value5466 value = find_attr_value_('country', node)5467 if value is not None and 'country' not in already_processed:5468 already_processed.append('country')5469 self.country = value5470 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5471 pass5472# end class MyDigiPassAddress5473class MyDigiPassWidgetStep(WidgetStep):5474 subclass = None5475 superclass = WidgetStep5476 def __init__(self, definition=None, previousStep=None, button=None, nextStep=None, message=None, creationTimestamp=None, id=None, receivedTimestamp=None, acknowledgedTimestamp=None, formButton=None, displayValue=None, phone=None, email=None, eidPhoto=None, eidProfile=None, eidAddress=None, profile=None, address=None):5477 super(MyDigiPassWidgetStep, self).__init__(definition, previousStep, button, nextStep, message, creationTimestamp, id, receivedTimestamp, acknowledgedTimestamp, formButton, displayValue,)5478 self.phone = _cast(None, phone)5479 self.email = _cast(None, email)5480 self.eidPhoto = _cast(None, eidPhoto)5481 self.eidProfile = eidProfile5482 self.eidAddress = eidAddress5483 self.profile = profile5484 self.address = address5485 def factory(*args_, **kwargs_):5486 if MyDigiPassWidgetStep.subclass:5487 return MyDigiPassWidgetStep.subclass(*args_, **kwargs_)5488 else:5489 return MyDigiPassWidgetStep(*args_, **kwargs_)5490 factory = staticmethod(factory)5491 def get_eidProfile(self): return self.eidProfile5492 def set_eidProfile(self, eidProfile): self.eidProfile = eidProfile5493 def get_eidAddress(self): return self.eidAddress5494 def set_eidAddress(self, eidAddress): self.eidAddress = eidAddress5495 def get_profile(self): return self.profile5496 def set_profile(self, profile): self.profile = profile5497 def get_address(self): return self.address5498 def set_address(self, address): self.address = address5499 def get_phone(self): return self.phone5500 def set_phone(self, phone): self.phone = phone5501 def get_email(self): return self.email5502 def set_email(self, email): self.email = email5503 def get_eidPhoto(self): return self.eidPhoto5504 def set_eidPhoto(self, eidPhoto): self.eidPhoto = eidPhoto5505 def export(self, outfile, level, namespace_='mstns:', name_='MyDigiPassWidgetStep', namespacedef_=''):5506 showIndent(outfile, level)5507 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))5508 already_processed = []5509 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassWidgetStep')5510 if self.hasContent_():5511 outfile.write('>\n')5512 self.exportChildren(outfile, level + 1, namespace_, name_)5513 showIndent(outfile, level)5514 outfile.write('</%s%s>\n' % (namespace_, name_))5515 else:5516 outfile.write('/>\n')5517 def exportAttributes(self, outfile, level, already_processed, namespace_='mstns:', name_='MyDigiPassWidgetStep'):5518 super(MyDigiPassWidgetStep, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MyDigiPassWidgetStep')5519 if self.phone is not None and 'phone' not in already_processed:5520 already_processed.append('phone')5521 outfile.write(' phone=%s' % (self.gds_format_string(quote_attrib(self.phone).encode(ExternalEncoding), input_name='phone'),))5522 if self.email is not None and 'email' not in already_processed:5523 already_processed.append('email')5524 outfile.write(' email=%s' % (self.gds_format_string(quote_attrib(self.email).encode(ExternalEncoding), input_name='email'),))5525 if self.eidPhoto is not None and 'eidPhoto' not in already_processed:5526 already_processed.append('eidPhoto')5527 outfile.write(' eidPhoto=%s' % (self.gds_format_string(quote_attrib(self.eidPhoto).encode(ExternalEncoding), input_name='eidPhoto'),))5528 def exportChildren(self, outfile, level, namespace_='mstns:', name_='MyDigiPassWidgetStep', fromsubclass_=False):5529 super(MyDigiPassWidgetStep, self).exportChildren(outfile, level, namespace_, name_, True)5530 if self.eidProfile is not None:5531 self.eidProfile.export(outfile, level, namespace_, name_='eidProfile')5532 if self.eidAddress is not None:5533 self.eidAddress.export(outfile, level, namespace_, name_='eidAddress')5534 if self.profile is not None:5535 self.profile.export(outfile, level, namespace_, name_='profile')5536 if self.address is not None:5537 self.address.export(outfile, level, namespace_, name_='address')5538 def hasContent_(self):5539 if (5540 self.eidProfile is not None or5541 self.eidAddress is not None or5542 self.profile is not None or5543 self.address is not None or5544 super(MyDigiPassWidgetStep, self).hasContent_()5545 ):5546 return True5547 else:5548 return False5549 def exportLiteral(self, outfile, level, name_='MyDigiPassWidgetStep'):5550 level += 15551 self.exportLiteralAttributes(outfile, level, [], name_)5552 if self.hasContent_():5553 self.exportLiteralChildren(outfile, level, name_)5554 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5555 if self.phone is not None and 'phone' not in already_processed:5556 already_processed.append('phone')5557 showIndent(outfile, level)5558 outfile.write('phone = "%s",\n' % (self.phone,))5559 if self.email is not None and 'email' not in already_processed:5560 already_processed.append('email')5561 showIndent(outfile, level)5562 outfile.write('email = "%s",\n' % (self.email,))5563 if self.eidPhoto is not None and 'eidPhoto' not in already_processed:5564 already_processed.append('eidPhoto')5565 showIndent(outfile, level)5566 outfile.write('eidPhoto = "%s",\n' % (self.eidPhoto,))5567 super(MyDigiPassWidgetStep, self).exportLiteralAttributes(outfile, level, already_processed, name_)5568 def exportLiteralChildren(self, outfile, level, name_):5569 super(MyDigiPassWidgetStep, self).exportLiteralChildren(outfile, level, name_)5570 if self.eidProfile is not None:5571 showIndent(outfile, level)5572 outfile.write('eidProfile=model_.MyDigiPassEidProfile(\n')5573 self.eidProfile.exportLiteral(outfile, level, name_='eidProfile')5574 showIndent(outfile, level)5575 outfile.write('),\n')5576 if self.eidAddress is not None:5577 showIndent(outfile, level)5578 outfile.write('eidAddress=model_.MyDigiPassEidAddress(\n')5579 self.eidAddress.exportLiteral(outfile, level, name_='eidAddress')5580 showIndent(outfile, level)5581 outfile.write('),\n')5582 if self.profile is not None:5583 showIndent(outfile, level)5584 outfile.write('profile=model_.MyDigiPassProfile(\n')5585 self.profile.exportLiteral(outfile, level, name_='profile')5586 showIndent(outfile, level)5587 outfile.write('),\n')5588 if self.address is not None:5589 showIndent(outfile, level)5590 outfile.write('address=model_.MyDigiPassAddress(\n')5591 self.address.exportLiteral(outfile, level, name_='address')5592 showIndent(outfile, level)5593 outfile.write('),\n')5594 def build(self, node):5595 self.buildAttributes(node, node.attrib, [])5596 for child in node:5597 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5598 self.buildChildren(child, node, nodeName_)5599 def buildAttributes(self, node, attrs, already_processed):5600 value = find_attr_value_('phone', node)5601 if value is not None and 'phone' not in already_processed:5602 already_processed.append('phone')5603 self.phone = value5604 value = find_attr_value_('email', node)5605 if value is not None and 'email' not in already_processed:5606 already_processed.append('email')5607 self.email = value5608 value = find_attr_value_('eidPhoto', node)5609 if value is not None and 'eidPhoto' not in already_processed:5610 already_processed.append('eidPhoto')5611 self.eidPhoto = value5612 super(MyDigiPassWidgetStep, self).buildAttributes(node, attrs, already_processed)5613 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5614 if nodeName_ == 'eidProfile':5615 obj_ = MyDigiPassEidProfile.factory()5616 obj_.build(child_)5617 self.set_eidProfile(obj_)5618 elif nodeName_ == 'eidAddress':5619 obj_ = MyDigiPassEidAddress.factory()