Best Python code snippet using autotest_python
compoundsuper.py
Source:compoundsuper.py
...154 attrs = node_.attributes155 self.buildAttributes(attrs)156 for child_ in node_.childNodes:157 nodeName_ = child_.nodeName.split(':')[-1]158 self.buildChildren(child_, nodeName_)159 def buildAttributes(self, attrs):160 if attrs.get('version'):161 self.version = attrs.get('version').value162 def buildChildren(self, child_, nodeName_):163 if child_.nodeType == Node.ELEMENT_NODE and \164 nodeName_ == 'compounddef':165 obj_ = compounddefType.factory()166 obj_.build(child_)167 self.set_compounddef(obj_)168# end class DoxygenType169class compounddefType(GeneratedsSuper):170 subclass = None171 superclass = None172 def __init__(self, kind=None, prot=None, id=None, compoundname=None, title=None, basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None, language=None):173 self.kind = kind174 self.prot = prot175 self.id = id176 self.language = language177 self.compoundname = compoundname178 self.title = title179 if basecompoundref is None:180 self.basecompoundref = []181 else:182 self.basecompoundref = basecompoundref183 if derivedcompoundref is None:184 self.derivedcompoundref = []185 else:186 self.derivedcompoundref = derivedcompoundref187 if includes is None:188 self.includes = []189 else:190 self.includes = includes191 if includedby is None:192 self.includedby = []193 else:194 self.includedby = includedby195 self.incdepgraph = incdepgraph196 self.invincdepgraph = invincdepgraph197 if innerdir is None:198 self.innerdir = []199 else:200 self.innerdir = innerdir201 if innerfile is None:202 self.innerfile = []203 else:204 self.innerfile = innerfile205 if innerclass is None:206 self.innerclass = []207 else:208 self.innerclass = innerclass209 if innernamespace is None:210 self.innernamespace = []211 else:212 self.innernamespace = innernamespace213 if innerpage is None:214 self.innerpage = []215 else:216 self.innerpage = innerpage217 if innergroup is None:218 self.innergroup = []219 else:220 self.innergroup = innergroup221 self.templateparamlist = templateparamlist222 if sectiondef is None:223 self.sectiondef = []224 else:225 self.sectiondef = sectiondef226 self.briefdescription = briefdescription227 self.detaileddescription = detaileddescription228 self.inheritancegraph = inheritancegraph229 self.collaborationgraph = collaborationgraph230 self.programlisting = programlisting231 self.location = location232 self.listofallmembers = listofallmembers233 self.namespaces = []234 def factory(*args_, **kwargs_):235 if compounddefType.subclass:236 return compounddefType.subclass(*args_, **kwargs_)237 else:238 return compounddefType(*args_, **kwargs_)239 factory = staticmethod(factory)240 def get_compoundname(self): return self.compoundname241 def set_compoundname(self, compoundname): self.compoundname = compoundname242 def get_title(self): return self.title243 def set_title(self, title): self.title = title244 def get_basecompoundref(self): return self.basecompoundref245 def set_basecompoundref(self, basecompoundref): self.basecompoundref = basecompoundref246 def add_basecompoundref(self, value): self.basecompoundref.append(value)247 def insert_basecompoundref(self, index, value): self.basecompoundref[index] = value248 def get_derivedcompoundref(self): return self.derivedcompoundref249 def set_derivedcompoundref(self, derivedcompoundref): self.derivedcompoundref = derivedcompoundref250 def add_derivedcompoundref(self, value): self.derivedcompoundref.append(value)251 def insert_derivedcompoundref(self, index, value): self.derivedcompoundref[index] = value252 def get_includes(self): return self.includes253 def set_includes(self, includes): self.includes = includes254 def add_includes(self, value): self.includes.append(value)255 def insert_includes(self, index, value): self.includes[index] = value256 def get_includedby(self): return self.includedby257 def set_includedby(self, includedby): self.includedby = includedby258 def add_includedby(self, value): self.includedby.append(value)259 def insert_includedby(self, index, value): self.includedby[index] = value260 def get_incdepgraph(self): return self.incdepgraph261 def set_incdepgraph(self, incdepgraph): self.incdepgraph = incdepgraph262 def get_invincdepgraph(self): return self.invincdepgraph263 def set_invincdepgraph(self, invincdepgraph): self.invincdepgraph = invincdepgraph264 def get_innerdir(self): return self.innerdir265 def set_innerdir(self, innerdir): self.innerdir = innerdir266 def add_innerdir(self, value): self.innerdir.append(value)267 def insert_innerdir(self, index, value): self.innerdir[index] = value268 def get_innerfile(self): return self.innerfile269 def set_innerfile(self, innerfile): self.innerfile = innerfile270 def add_innerfile(self, value): self.innerfile.append(value)271 def insert_innerfile(self, index, value): self.innerfile[index] = value272 def get_innerclass(self): return self.innerclass273 def set_innerclass(self, innerclass): self.innerclass = innerclass274 def add_innerclass(self, value): self.innerclass.append(value)275 def insert_innerclass(self, index, value): self.innerclass[index] = value276 def get_innernamespace(self): return self.innernamespace277 def set_innernamespace(self, innernamespace): self.innernamespace = innernamespace278 def add_innernamespace(self, value): self.innernamespace.append(value)279 def insert_innernamespace(self, index, value): self.innernamespace[index] = value280 def get_innerpage(self): return self.innerpage281 def set_innerpage(self, innerpage): self.innerpage = innerpage282 def add_innerpage(self, value): self.innerpage.append(value)283 def insert_innerpage(self, index, value): self.innerpage[index] = value284 def get_innergroup(self): return self.innergroup285 def set_innergroup(self, innergroup): self.innergroup = innergroup286 def add_innergroup(self, value): self.innergroup.append(value)287 def insert_innergroup(self, index, value): self.innergroup[index] = value288 def get_templateparamlist(self): return self.templateparamlist289 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist290 def get_sectiondef(self): return self.sectiondef291 def set_sectiondef(self, sectiondef): self.sectiondef = sectiondef292 def add_sectiondef(self, value): self.sectiondef.append(value)293 def insert_sectiondef(self, index, value): self.sectiondef[index] = value294 def get_briefdescription(self): return self.briefdescription295 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription296 def get_detaileddescription(self): return self.detaileddescription297 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription298 def get_inheritancegraph(self): return self.inheritancegraph299 def set_inheritancegraph(self, inheritancegraph): self.inheritancegraph = inheritancegraph300 def get_collaborationgraph(self): return self.collaborationgraph301 def set_collaborationgraph(self, collaborationgraph): self.collaborationgraph = collaborationgraph302 def get_programlisting(self): return self.programlisting303 def set_programlisting(self, programlisting): self.programlisting = programlisting304 def get_location(self): return self.location305 def set_location(self, location): self.location = location306 def get_listofallmembers(self): return self.listofallmembers307 def set_listofallmembers(self, listofallmembers): self.listofallmembers = listofallmembers308 def get_kind(self): return self.kind309 def set_kind(self, kind): self.kind = kind310 def get_prot(self): return self.prot311 def set_prot(self, prot): self.prot = prot312 def get_id(self): return self.id313 def set_id(self, id): self.id = id314 def hasContent_(self):315 if (316 self.compoundname is not None or317 self.title is not None or318 self.basecompoundref is not None or319 self.derivedcompoundref is not None or320 self.includes is not None or321 self.includedby is not None or322 self.incdepgraph is not None or323 self.invincdepgraph is not None or324 self.innerdir is not None or325 self.innerfile is not None or326 self.innerclass is not None or327 self.innernamespace is not None or328 self.innerpage is not None or329 self.innergroup is not None or330 self.templateparamlist is not None or331 self.sectiondef is not None or332 self.briefdescription is not None or333 self.detaileddescription is not None or334 self.inheritancegraph is not None or335 self.collaborationgraph is not None or336 self.programlisting is not None or337 self.location is not None or338 self.listofallmembers is not None339 ):340 return True341 else:342 return False343 def build(self, node_):344 attrs = node_.attributes345 self.buildAttributes(attrs)346 for child_ in node_.childNodes:347 nodeName_ = child_.nodeName.split(':')[-1]348 self.buildChildren(child_, nodeName_)349 def buildAttributes(self, attrs):350 if attrs.get('kind'):351 self.kind = attrs.get('kind').value352 if attrs.get('prot'):353 self.prot = attrs.get('prot').value354 if attrs.get('id'):355 self.id = attrs.get('id').value356 if attrs.get('language'):357 self.language = attrs.get('language').value.lower()358 def buildChildren(self, child_, nodeName_):359 if child_.nodeType == Node.ELEMENT_NODE and \360 nodeName_ == 'compoundname':361 compoundname_ = ''362 for text__content_ in child_.childNodes:363 compoundname_ += text__content_.nodeValue364 self.compoundname = compoundname_365 elif child_.nodeType == Node.ELEMENT_NODE and \366 nodeName_ == 'title':367 obj_ = docTitleType.factory()368 obj_.build(child_)369 self.set_title(obj_)370 elif child_.nodeType == Node.ELEMENT_NODE and \371 nodeName_ == 'basecompoundref':372 obj_ = compoundRefType.factory()373 obj_.build(child_)374 self.basecompoundref.append(obj_)375 elif child_.nodeType == Node.ELEMENT_NODE and \376 nodeName_ == 'derivedcompoundref':377 obj_ = compoundRefType.factory()378 obj_.build(child_)379 self.derivedcompoundref.append(obj_)380 elif child_.nodeType == Node.ELEMENT_NODE and \381 nodeName_ == 'includes':382 obj_ = incType.factory()383 obj_.build(child_)384 self.includes.append(obj_)385 elif child_.nodeType == Node.ELEMENT_NODE and \386 nodeName_ == 'includedby':387 obj_ = incType.factory()388 obj_.build(child_)389 self.includedby.append(obj_)390 elif child_.nodeType == Node.ELEMENT_NODE and \391 nodeName_ == 'incdepgraph':392 obj_ = graphType.factory(393 caption=f"Include dependency graph for {self.get_compoundname()}:"394 )395 obj_.build(child_)396 self.set_incdepgraph(obj_)397 elif child_.nodeType == Node.ELEMENT_NODE and \398 nodeName_ == 'invincdepgraph':399 obj_ = graphType.factory(400 direction="back",401 caption=f"This graph shows which files directly "402 f"or indirectly include {self.get_compoundname()}:"403 )404 obj_.build(child_)405 self.set_invincdepgraph(obj_)406 elif child_.nodeType == Node.ELEMENT_NODE and \407 nodeName_ == 'innerdir':408 obj_ = refType.factory(nodeName_)409 obj_.build(child_)410 self.innerdir.append(obj_)411 elif child_.nodeType == Node.ELEMENT_NODE and \412 nodeName_ == 'innerfile':413 obj_ = refType.factory(nodeName_)414 obj_.build(child_)415 self.innerfile.append(obj_)416 elif child_.nodeType == Node.ELEMENT_NODE and \417 nodeName_ == 'innerclass':418 obj_ = refType.factory(nodeName_)419 obj_.build(child_)420 self.innerclass.append(obj_)421 self.namespaces.append(obj_.content_[0].getValue())422 elif child_.nodeType == Node.ELEMENT_NODE and \423 nodeName_ == 'innernamespace':424 obj_ = refType.factory(nodeName_)425 obj_.build(child_)426 self.innernamespace.append(obj_)427 self.namespaces.append(obj_.content_[0].getValue())428 elif child_.nodeType == Node.ELEMENT_NODE and \429 nodeName_ == 'innerpage':430 obj_ = refType.factory(nodeName_)431 obj_.build(child_)432 self.innerpage.append(obj_)433 elif child_.nodeType == Node.ELEMENT_NODE and \434 nodeName_ == 'innergroup':435 obj_ = refType.factory(nodeName_)436 obj_.build(child_)437 self.innergroup.append(obj_)438 elif child_.nodeType == Node.ELEMENT_NODE and \439 nodeName_ == 'templateparamlist':440 obj_ = templateparamlistType.factory()441 obj_.build(child_)442 self.set_templateparamlist(obj_)443 elif child_.nodeType == Node.ELEMENT_NODE and \444 nodeName_ == 'sectiondef':445 obj_ = sectiondefType.factory()446 obj_.build(child_)447 self.sectiondef.append(obj_)448 elif child_.nodeType == Node.ELEMENT_NODE and \449 nodeName_ == 'briefdescription':450 obj_ = descriptionType.factory()451 obj_.build(child_)452 self.set_briefdescription(obj_)453 elif child_.nodeType == Node.ELEMENT_NODE and \454 nodeName_ == 'detaileddescription':455 obj_ = descriptionType.factory()456 obj_.build(child_)457 self.set_detaileddescription(obj_)458 elif child_.nodeType == Node.ELEMENT_NODE and \459 nodeName_ == 'inheritancegraph':460 obj_ = graphType.factory(461 caption=f"Inheritence diagram for {self.get_compoundname()}:"462 )463 obj_.build(child_)464 self.set_inheritancegraph(obj_)465 elif child_.nodeType == Node.ELEMENT_NODE and \466 nodeName_ == 'collaborationgraph':467 obj_ = graphType.factory(468 caption=f"Collaboration diagram for {self.get_compoundname()}:"469 )470 obj_.build(child_)471 self.set_collaborationgraph(obj_)472 elif child_.nodeType == Node.ELEMENT_NODE and \473 nodeName_ == 'programlisting':474 obj_ = listingType.factory(domain=self.language)475 obj_.build(child_)476 self.set_programlisting(obj_)477 elif child_.nodeType == Node.ELEMENT_NODE and \478 nodeName_ == 'location':479 obj_ = locationType.factory()480 obj_.build(child_)481 self.set_location(obj_)482 elif child_.nodeType == Node.ELEMENT_NODE and \483 nodeName_ == 'listofallmembers':484 obj_ = listofallmembersType.factory()485 obj_.build(child_)486 self.set_listofallmembers(obj_)487# end class compounddefType488class listofallmembersType(GeneratedsSuper):489 subclass = None490 superclass = None491 def __init__(self, member=None):492 if member is None:493 self.member = []494 else:495 self.member = member496 def factory(*args_, **kwargs_):497 if listofallmembersType.subclass:498 return listofallmembersType.subclass(*args_, **kwargs_)499 else:500 return listofallmembersType(*args_, **kwargs_)501 factory = staticmethod(factory)502 def get_member(self): return self.member503 def set_member(self, member): self.member = member504 def add_member(self, value): self.member.append(value)505 def insert_member(self, index, value): self.member[index] = value506 def hasContent_(self):507 if (508 self.member is not None509 ):510 return True511 else:512 return False513 def build(self, node_):514 attrs = node_.attributes515 self.buildAttributes(attrs)516 for child_ in node_.childNodes:517 nodeName_ = child_.nodeName.split(':')[-1]518 self.buildChildren(child_, nodeName_)519 def buildAttributes(self, attrs):520 pass521 def buildChildren(self, child_, nodeName_):522 if child_.nodeType == Node.ELEMENT_NODE and \523 nodeName_ == 'member':524 obj_ = memberRefType.factory()525 obj_.build(child_)526 self.member.append(obj_)527# end class listofallmembersType528class memberRefType(GeneratedsSuper):529 subclass = None530 superclass = None531 def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope=None, name=None):532 self.virt = virt533 self.prot = prot534 self.refid = refid535 self.ambiguityscope = ambiguityscope536 self.scope = scope537 self.name = name538 def factory(*args_, **kwargs_):539 if memberRefType.subclass:540 return memberRefType.subclass(*args_, **kwargs_)541 else:542 return memberRefType(*args_, **kwargs_)543 factory = staticmethod(factory)544 def get_scope(self): return self.scope545 def set_scope(self, scope): self.scope = scope546 def get_name(self): return self.name547 def set_name(self, name): self.name = name548 def get_virt(self): return self.virt549 def set_virt(self, virt): self.virt = virt550 def get_prot(self): return self.prot551 def set_prot(self, prot): self.prot = prot552 def get_refid(self): return self.refid553 def set_refid(self, refid): self.refid = refid554 def get_ambiguityscope(self): return self.ambiguityscope555 def set_ambiguityscope(self, ambiguityscope): self.ambiguityscope = ambiguityscope556 def hasContent_(self):557 if (558 self.scope is not None or559 self.name is not None560 ):561 return True562 else:563 return False564 def build(self, node_):565 attrs = node_.attributes566 self.buildAttributes(attrs)567 for child_ in node_.childNodes:568 nodeName_ = child_.nodeName.split(':')[-1]569 self.buildChildren(child_, nodeName_)570 def buildAttributes(self, attrs):571 if attrs.get('virt'):572 self.virt = attrs.get('virt').value573 if attrs.get('prot'):574 self.prot = attrs.get('prot').value575 if attrs.get('refid'):576 self.refid = attrs.get('refid').value577 if attrs.get('ambiguityscope'):578 self.ambiguityscope = attrs.get('ambiguityscope').value579 def buildChildren(self, child_, nodeName_):580 if child_.nodeType == Node.ELEMENT_NODE and \581 nodeName_ == 'scope':582 scope_ = ''583 for text__content_ in child_.childNodes:584 scope_ += text__content_.nodeValue585 self.scope = scope_586 elif child_.nodeType == Node.ELEMENT_NODE and \587 nodeName_ == 'name':588 name_ = ''589 for text__content_ in child_.childNodes:590 name_ += text__content_.nodeValue591 self.name = name_592# end class memberRefType593class scope(GeneratedsSuper):594 subclass = None595 superclass = None596 def __init__(self, valueOf_=''):597 self.valueOf_ = valueOf_598 def factory(*args_, **kwargs_):599 if scope.subclass:600 return scope.subclass(*args_, **kwargs_)601 else:602 return scope(*args_, **kwargs_)603 factory = staticmethod(factory)604 def getValueOf_(self): return self.valueOf_605 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_606 def hasContent_(self):607 if (608 self.valueOf_ is not None609 ):610 return True611 else:612 return False613 def build(self, node_):614 attrs = node_.attributes615 self.buildAttributes(attrs)616 self.valueOf_ = ''617 for child_ in node_.childNodes:618 nodeName_ = child_.nodeName.split(':')[-1]619 self.buildChildren(child_, nodeName_)620 def buildAttributes(self, attrs):621 pass622 def buildChildren(self, child_, nodeName_):623 if child_.nodeType == Node.TEXT_NODE:624 self.valueOf_ += child_.nodeValue625 elif child_.nodeType == Node.CDATA_SECTION_NODE:626 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'627# end class scope628class name(GeneratedsSuper):629 subclass = None630 superclass = None631 def __init__(self, valueOf_=''):632 self.valueOf_ = valueOf_633 def factory(*args_, **kwargs_):634 if name.subclass:635 return name.subclass(*args_, **kwargs_)636 else:637 return name(*args_, **kwargs_)638 factory = staticmethod(factory)639 def getValueOf_(self): return self.valueOf_640 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_641 def hasContent_(self):642 if (643 self.valueOf_ is not None644 ):645 return True646 else:647 return False648 def build(self, node_):649 attrs = node_.attributes650 self.buildAttributes(attrs)651 self.valueOf_ = ''652 for child_ in node_.childNodes:653 nodeName_ = child_.nodeName.split(':')[-1]654 self.buildChildren(child_, nodeName_)655 def buildAttributes(self, attrs):656 pass657 def buildChildren(self, child_, nodeName_):658 if child_.nodeType == Node.TEXT_NODE:659 self.valueOf_ += child_.nodeValue660 elif child_.nodeType == Node.CDATA_SECTION_NODE:661 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'662# end class name663class compoundRefType(GeneratedsSuper):664 subclass = None665 superclass = None666 def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):667 self.virt = virt668 self.prot = prot669 self.refid = refid670 if mixedclass_ is None:671 self.mixedclass_ = MixedContainer672 else:673 self.mixedclass_ = mixedclass_674 if content_ is None:675 self.content_ = []676 else:677 self.content_ = content_678 def factory(*args_, **kwargs_):679 if compoundRefType.subclass:680 return compoundRefType.subclass(*args_, **kwargs_)681 else:682 return compoundRefType(*args_, **kwargs_)683 factory = staticmethod(factory)684 def get_virt(self): return self.virt685 def set_virt(self, virt): self.virt = virt686 def get_prot(self): return self.prot687 def set_prot(self, prot): self.prot = prot688 def get_refid(self): return self.refid689 def set_refid(self, refid): self.refid = refid690 def getValueOf_(self): return self.valueOf_691 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_692 def hasContent_(self):693 if (694 self.valueOf_ is not None695 ):696 return True697 else:698 return False699 def build(self, node_):700 attrs = node_.attributes701 self.buildAttributes(attrs)702 self.valueOf_ = ''703 for child_ in node_.childNodes:704 nodeName_ = child_.nodeName.split(':')[-1]705 self.buildChildren(child_, nodeName_)706 def buildAttributes(self, attrs):707 if attrs.get('virt'):708 self.virt = attrs.get('virt').value709 if attrs.get('prot'):710 self.prot = attrs.get('prot').value711 if attrs.get('refid'):712 self.refid = attrs.get('refid').value713 def buildChildren(self, child_, nodeName_):714 if child_.nodeType == Node.TEXT_NODE:715 obj_ = self.mixedclass_(MixedContainer.CategoryText,716 MixedContainer.TypeNone, '', child_.nodeValue)717 self.content_.append(obj_)718 if child_.nodeType == Node.TEXT_NODE:719 self.valueOf_ += child_.nodeValue720 elif child_.nodeType == Node.CDATA_SECTION_NODE:721 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'722# end class compoundRefType723class reimplementType(GeneratedsSuper):724 subclass = None725 superclass = None726 def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):727 self.refid = refid728 if mixedclass_ is None:729 self.mixedclass_ = MixedContainer730 else:731 self.mixedclass_ = mixedclass_732 if content_ is None:733 self.content_ = []734 else:735 self.content_ = content_736 def factory(*args_, **kwargs_):737 if reimplementType.subclass:738 return reimplementType.subclass(*args_, **kwargs_)739 else:740 return reimplementType(*args_, **kwargs_)741 factory = staticmethod(factory)742 def get_refid(self): return self.refid743 def set_refid(self, refid): self.refid = refid744 def getValueOf_(self): return self.valueOf_745 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_746 def hasContent_(self):747 if (748 self.valueOf_ is not None749 ):750 return True751 else:752 return False753 def build(self, node_):754 attrs = node_.attributes755 self.buildAttributes(attrs)756 self.valueOf_ = ''757 for child_ in node_.childNodes:758 nodeName_ = child_.nodeName.split(':')[-1]759 self.buildChildren(child_, nodeName_)760 def buildAttributes(self, attrs):761 if attrs.get('refid'):762 self.refid = attrs.get('refid').value763 def buildChildren(self, child_, nodeName_):764 if child_.nodeType == Node.TEXT_NODE:765 obj_ = self.mixedclass_(MixedContainer.CategoryText,766 MixedContainer.TypeNone, '', child_.nodeValue)767 self.content_.append(obj_)768 if child_.nodeType == Node.TEXT_NODE:769 self.valueOf_ += child_.nodeValue770 elif child_.nodeType == Node.CDATA_SECTION_NODE:771 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'772# end class reimplementType773class incType(GeneratedsSuper):774 subclass = None775 superclass = None776 def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):777 self.local = local778 self.refid = refid779 if mixedclass_ is None:780 self.mixedclass_ = MixedContainer781 else:782 self.mixedclass_ = mixedclass_783 if content_ is None:784 self.content_ = []785 else:786 self.content_ = content_787 def factory(*args_, **kwargs_):788 if incType.subclass:789 return incType.subclass(*args_, **kwargs_)790 else:791 return incType(*args_, **kwargs_)792 factory = staticmethod(factory)793 def get_local(self): return self.local794 def set_local(self, local): self.local = local795 def get_refid(self): return self.refid796 def set_refid(self, refid): self.refid = refid797 def getValueOf_(self): return self.valueOf_798 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_799 def hasContent_(self):800 if (801 self.valueOf_ is not None802 ):803 return True804 else:805 return False806 def build(self, node_):807 attrs = node_.attributes808 self.buildAttributes(attrs)809 self.valueOf_ = ''810 for child_ in node_.childNodes:811 nodeName_ = child_.nodeName.split(':')[-1]812 self.buildChildren(child_, nodeName_)813 def buildAttributes(self, attrs):814 if attrs.get('local'):815 self.local = attrs.get('local').value816 if attrs.get('refid'):817 self.refid = attrs.get('refid').value818 def buildChildren(self, child_, nodeName_):819 if child_.nodeType == Node.TEXT_NODE:820 obj_ = self.mixedclass_(MixedContainer.CategoryText,821 MixedContainer.TypeNone, '', child_.nodeValue)822 self.content_.append(obj_)823 if child_.nodeType == Node.TEXT_NODE:824 self.valueOf_ += child_.nodeValue825 elif child_.nodeType == Node.CDATA_SECTION_NODE:826 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'827# end class incType828class refType(GeneratedsSuper):829 subclass = None830 superclass = None831 def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):832 self.prot = prot833 self.refid = refid834 if mixedclass_ is None:835 self.mixedclass_ = MixedContainer836 else:837 self.mixedclass_ = mixedclass_838 if content_ is None:839 self.content_ = []840 else:841 self.content_ = content_842 def factory(*args_, **kwargs_):843 if refType.subclass:844 return refType.subclass(*args_, **kwargs_)845 else:846 return refType(*args_, **kwargs_)847 factory = staticmethod(factory)848 def get_prot(self): return self.prot849 def set_prot(self, prot): self.prot = prot850 def get_refid(self): return self.refid851 def set_refid(self, refid): self.refid = refid852 def getValueOf_(self): return self.valueOf_853 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_854 def hasContent_(self):855 if (856 self.valueOf_ is not None857 ):858 return True859 else:860 return False861 def build(self, node_):862 attrs = node_.attributes863 self.buildAttributes(attrs)864 self.valueOf_ = ''865 for child_ in node_.childNodes:866 nodeName_ = child_.nodeName.split(':')[-1]867 self.buildChildren(child_, nodeName_)868 def buildAttributes(self, attrs):869 if attrs.get('prot'):870 self.prot = attrs.get('prot').value871 if attrs.get('refid'):872 self.refid = attrs.get('refid').value873 def buildChildren(self, child_, nodeName_):874 if child_.nodeType == Node.TEXT_NODE:875 obj_ = self.mixedclass_(MixedContainer.CategoryText,876 MixedContainer.TypeNone, '', child_.nodeValue)877 self.content_.append(obj_)878 if child_.nodeType == Node.TEXT_NODE:879 self.valueOf_ += child_.nodeValue880 elif child_.nodeType == Node.CDATA_SECTION_NODE:881 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'882# end class refType883class refTextType(GeneratedsSuper):884 subclass = None885 superclass = None886 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):887 self.refid = refid888 self.kindref = kindref889 self.external = external890 if mixedclass_ is None:891 self.mixedclass_ = MixedContainer892 else:893 self.mixedclass_ = mixedclass_894 if content_ is None:895 self.content_ = []896 else:897 self.content_ = content_898 def factory(*args_, **kwargs_):899 if refTextType.subclass:900 return refTextType.subclass(*args_, **kwargs_)901 else:902 return refTextType(*args_, **kwargs_)903 factory = staticmethod(factory)904 def get_refid(self): return self.refid905 def set_refid(self, refid): self.refid = refid906 def get_kindref(self): return self.kindref907 def set_kindref(self, kindref): self.kindref = kindref908 def get_external(self): return self.external909 def set_external(self, external): self.external = external910 def getValueOf_(self): return self.valueOf_911 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_912 def hasContent_(self):913 if (914 self.valueOf_ is not None915 ):916 return True917 else:918 return False919 def build(self, node_):920 attrs = node_.attributes921 self.buildAttributes(attrs)922 self.valueOf_ = ''923 for child_ in node_.childNodes:924 nodeName_ = child_.nodeName.split(':')[-1]925 self.buildChildren(child_, nodeName_)926 def buildAttributes(self, attrs):927 if attrs.get('refid'):928 self.refid = attrs.get('refid').value929 if attrs.get('kindref'):930 self.kindref = attrs.get('kindref').value931 if attrs.get('external'):932 self.external = attrs.get('external').value933 def buildChildren(self, child_, nodeName_):934 if child_.nodeType == Node.TEXT_NODE:935 obj_ = self.mixedclass_(MixedContainer.CategoryText,936 MixedContainer.TypeNone, '', child_.nodeValue)937 self.content_.append(obj_)938 if child_.nodeType == Node.TEXT_NODE:939 self.valueOf_ += child_.nodeValue940 elif child_.nodeType == Node.CDATA_SECTION_NODE:941 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'942# end class refTextType943class sectiondefType(GeneratedsSuper):944 subclass = None945 superclass = None946 def __init__(self, kind=None, header=None, description=None, memberdef=None):947 self.kind = kind948 self.header = header949 self.description = description950 if memberdef is None:951 self.memberdef = []952 else:953 self.memberdef = memberdef954 def factory(*args_, **kwargs_):955 if sectiondefType.subclass:956 return sectiondefType.subclass(*args_, **kwargs_)957 else:958 return sectiondefType(*args_, **kwargs_)959 factory = staticmethod(factory)960 def get_header(self): return self.header961 def set_header(self, header): self.header = header962 def get_description(self): return self.description963 def set_description(self, description): self.description = description964 def get_memberdef(self): return self.memberdef965 def set_memberdef(self, memberdef): self.memberdef = memberdef966 def add_memberdef(self, value): self.memberdef.append(value)967 def insert_memberdef(self, index, value): self.memberdef[index] = value968 def get_kind(self): return self.kind969 def set_kind(self, kind): self.kind = kind970 def hasContent_(self):971 if (972 self.header is not None or973 self.description is not None or974 self.memberdef is not None975 ):976 return True977 else:978 return False979 def build(self, node_):980 attrs = node_.attributes981 self.buildAttributes(attrs)982 for child_ in node_.childNodes:983 nodeName_ = child_.nodeName.split(':')[-1]984 self.buildChildren(child_, nodeName_)985 def buildAttributes(self, attrs):986 if attrs.get('kind'):987 self.kind = attrs.get('kind').value988 def buildChildren(self, child_, nodeName_):989 if child_.nodeType == Node.ELEMENT_NODE and \990 nodeName_ == 'header':991 header_ = ''992 for text__content_ in child_.childNodes:993 header_ += text__content_.nodeValue994 self.header = header_995 elif child_.nodeType == Node.ELEMENT_NODE and \996 nodeName_ == 'description':997 obj_ = descriptionType.factory()998 obj_.build(child_)999 self.set_description(obj_)1000 elif child_.nodeType == Node.ELEMENT_NODE and \1001 nodeName_ == 'memberdef':1002 obj_ = memberdefType.factory()1003 obj_.build(child_)1004 self.memberdef.append(obj_)1005# end class sectiondefType1006class memberdefType(GeneratedsSuper):1007 subclass = None1008 superclass = None1009 def __init__(self, initonly=None, kind=None, volatile=None, const=None, raisexx=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, strong=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, refqual=None):1010 self.initonly = initonly1011 self.kind = kind1012 self.volatile = volatile1013 self.const = const1014 self.raisexx = raisexx1015 self.virt = virt1016 self.readable = readable1017 self.prot = prot1018 self.explicit = explicit1019 self.new = new1020 self.final = final1021 self.writable = writable1022 self.add = add1023 self.static = static1024 self.strong = strong1025 self.remove = remove1026 self.sealed = sealed1027 self.mutable = mutable1028 self.gettable = gettable1029 self.inline = inline1030 self.settable = settable1031 self.id = id1032 self.templateparamlist = templateparamlist1033 self.type_ = type_1034 self.definition = definition1035 self.argsstring = argsstring1036 self.name = name1037 self.read = read1038 self.write = write1039 self.bitfield = bitfield1040 if reimplements is None:1041 self.reimplements = []1042 else:1043 self.reimplements = reimplements1044 if reimplementedby is None:1045 self.reimplementedby = []1046 else:1047 self.reimplementedby = reimplementedby1048 if param is None:1049 self.param = []1050 else:1051 self.param = param1052 if enumvalue is None:1053 self.enumvalue = []1054 else:1055 self.enumvalue = enumvalue1056 self.initializer = initializer1057 self.exceptions = exceptions1058 self.briefdescription = briefdescription1059 self.detaileddescription = detaileddescription1060 self.inbodydescription = inbodydescription1061 self.location = location1062 if references is None:1063 self.references = []1064 else:1065 self.references = references1066 if referencedby is None:1067 self.referencedby = []1068 else:1069 self.referencedby = referencedby1070 self.refqual = refqual1071 def factory(*args_, **kwargs_):1072 if memberdefType.subclass:1073 return memberdefType.subclass(*args_, **kwargs_)1074 else:1075 return memberdefType(*args_, **kwargs_)1076 factory = staticmethod(factory)1077 def get_templateparamlist(self): return self.templateparamlist1078 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist1079 def get_type(self): return self.type_1080 def set_type(self, type_): self.type_ = type_1081 def get_definition(self): return self.definition1082 def set_definition(self, definition): self.definition = definition1083 def get_argsstring(self): return self.argsstring1084 def set_argsstring(self, argsstring): self.argsstring = argsstring1085 def get_name(self): return self.name1086 def set_name(self, name): self.name = name1087 def get_read(self): return self.read1088 def set_read(self, read): self.read = read1089 def get_write(self): return self.write1090 def set_write(self, write): self.write = write1091 def get_bitfield(self): return self.bitfield1092 def set_bitfield(self, bitfield): self.bitfield = bitfield1093 def get_reimplements(self): return self.reimplements1094 def set_reimplements(self, reimplements): self.reimplements = reimplements1095 def add_reimplements(self, value): self.reimplements.append(value)1096 def insert_reimplements(self, index, value): self.reimplements[index] = value1097 def get_reimplementedby(self): return self.reimplementedby1098 def set_reimplementedby(self, reimplementedby): self.reimplementedby = reimplementedby1099 def add_reimplementedby(self, value): self.reimplementedby.append(value)1100 def insert_reimplementedby(self, index, value): self.reimplementedby[index] = value1101 def get_param(self): return self.param1102 def set_param(self, param): self.param = param1103 def add_param(self, value): self.param.append(value)1104 def insert_param(self, index, value): self.param[index] = value1105 def get_enumvalue(self): return self.enumvalue1106 def set_enumvalue(self, enumvalue): self.enumvalue = enumvalue1107 def add_enumvalue(self, value): self.enumvalue.append(value)1108 def insert_enumvalue(self, index, value): self.enumvalue[index] = value1109 def get_initializer(self): return self.initializer1110 def set_initializer(self, initializer): self.initializer = initializer1111 def get_exceptions(self): return self.exceptions1112 def set_exceptions(self, exceptions): self.exceptions = exceptions1113 def get_briefdescription(self): return self.briefdescription1114 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription1115 def get_detaileddescription(self): return self.detaileddescription1116 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription1117 def get_inbodydescription(self): return self.inbodydescription1118 def set_inbodydescription(self, inbodydescription): self.inbodydescription = inbodydescription1119 def get_location(self): return self.location1120 def set_location(self, location): self.location = location1121 def get_references(self): return self.references1122 def set_references(self, references): self.references = references1123 def add_references(self, value): self.references.append(value)1124 def insert_references(self, index, value): self.references[index] = value1125 def get_referencedby(self): return self.referencedby1126 def set_referencedby(self, referencedby): self.referencedby = referencedby1127 def add_referencedby(self, value): self.referencedby.append(value)1128 def insert_referencedby(self, index, value): self.referencedby[index] = value1129 def get_initonly(self): return self.initonly1130 def set_initonly(self, initonly): self.initonly = initonly1131 def get_kind(self): return self.kind1132 def set_kind(self, kind): self.kind = kind1133 def get_volatile(self): return self.volatile1134 def set_volatile(self, volatile): self.volatile = volatile1135 def get_const(self): return self.const1136 def set_const(self, const): self.const = const1137 def get_raise(self): return self.raisexx1138 def set_raise(self, raisexx): self.raisexx = raisexx1139 def get_virt(self): return self.virt1140 def set_virt(self, virt): self.virt = virt1141 def get_readable(self): return self.readable1142 def set_readable(self, readable): self.readable = readable1143 def get_prot(self): return self.prot1144 def set_prot(self, prot): self.prot = prot1145 def get_explicit(self): return self.explicit1146 def set_explicit(self, explicit): self.explicit = explicit1147 def get_new(self): return self.new1148 def set_new(self, new): self.new = new1149 def get_final(self): return self.final1150 def set_final(self, final): self.final = final1151 def get_writable(self): return self.writable1152 def set_writable(self, writable): self.writable = writable1153 def get_add(self): return self.add1154 def set_add(self, add): self.add = add1155 def get_static(self): return self.static1156 def set_static(self, static): self.static = static1157 def get_strong(self): return self.strong1158 def set_strong(self, strong): self.strong = strong1159 def get_remove(self): return self.remove1160 def set_remove(self, remove): self.remove = remove1161 def get_sealed(self): return self.sealed1162 def set_sealed(self, sealed): self.sealed = sealed1163 def get_mutable(self): return self.mutable1164 def set_mutable(self, mutable): self.mutable = mutable1165 def get_gettable(self): return self.gettable1166 def set_gettable(self, gettable): self.gettable = gettable1167 def get_inline(self): return self.inline1168 def set_inline(self, inline): self.inline = inline1169 def get_settable(self): return self.settable1170 def set_settable(self, settable): self.settable = settable1171 def get_id(self): return self.id1172 def set_id(self, id): self.id = id1173 def get_refqual(self): return self.refqual1174 def set_refqual(self, refqual): self.refqual = refqual1175 def hasContent_(self):1176 if (1177 self.templateparamlist is not None or1178 self.type_ is not None or1179 self.definition is not None or1180 self.argsstring is not None or1181 self.name is not None or1182 self.read is not None or1183 self.write is not None or1184 self.bitfield is not None or1185 self.reimplements is not None or1186 self.reimplementedby is not None or1187 self.param is not None or1188 self.enumvalue is not None or1189 self.initializer is not None or1190 self.exceptions is not None or1191 self.briefdescription is not None or1192 self.detaileddescription is not None or1193 self.inbodydescription is not None or1194 self.location is not None or1195 self.references is not None or1196 self.referencedby is not None1197 ):1198 return True1199 else:1200 return False1201 def build(self, node_):1202 attrs = node_.attributes1203 self.buildAttributes(attrs)1204 for child_ in node_.childNodes:1205 nodeName_ = child_.nodeName.split(':')[-1]1206 self.buildChildren(child_, nodeName_)1207 def buildAttributes(self, attrs):1208 if attrs.get('initonly'):1209 self.initonly = attrs.get('initonly').value1210 if attrs.get('kind'):1211 self.kind = attrs.get('kind').value1212 if attrs.get('volatile'):1213 self.volatile = attrs.get('volatile').value1214 if attrs.get('const'):1215 self.const = attrs.get('const').value1216 if attrs.get('raise'):1217 self.raisexx = attrs.get('raise').value1218 if attrs.get('virt'):1219 self.virt = attrs.get('virt').value1220 if attrs.get('readable'):1221 self.readable = attrs.get('readable').value1222 if attrs.get('prot'):1223 self.prot = attrs.get('prot').value1224 if attrs.get('explicit'):1225 self.explicit = attrs.get('explicit').value1226 if attrs.get('new'):1227 self.new = attrs.get('new').value1228 if attrs.get('final'):1229 self.final = attrs.get('final').value1230 if attrs.get('writable'):1231 self.writable = attrs.get('writable').value1232 if attrs.get('add'):1233 self.add = attrs.get('add').value1234 if attrs.get('static'):1235 self.static = attrs.get('static').value1236 if attrs.get('strong'):1237 self.strong = attrs.get('strong').value1238 if attrs.get('remove'):1239 self.remove = attrs.get('remove').value1240 if attrs.get('sealed'):1241 self.sealed = attrs.get('sealed').value1242 if attrs.get('mutable'):1243 self.mutable = attrs.get('mutable').value1244 if attrs.get('gettable'):1245 self.gettable = attrs.get('gettable').value1246 if attrs.get('inline'):1247 self.inline = attrs.get('inline').value1248 if attrs.get('settable'):1249 self.settable = attrs.get('settable').value1250 if attrs.get('id'):1251 self.id = attrs.get('id').value1252 if attrs.get('refqual'):1253 self.refqual = attrs.get('refqual').value1254 def buildChildren(self, child_, nodeName_):1255 if child_.nodeType == Node.ELEMENT_NODE and \1256 nodeName_ == 'templateparamlist':1257 obj_ = templateparamlistType.factory()1258 obj_.build(child_)1259 self.set_templateparamlist(obj_)1260 elif child_.nodeType == Node.ELEMENT_NODE and \1261 nodeName_ == 'type':1262 obj_ = linkedTextType.factory()1263 obj_.build(child_)1264 self.set_type(obj_)1265 elif child_.nodeType == Node.ELEMENT_NODE and \1266 nodeName_ == 'definition':1267 definition_ = ''1268 for text__content_ in child_.childNodes:1269 definition_ += text__content_.nodeValue1270 self.definition = definition_1271 elif child_.nodeType == Node.ELEMENT_NODE and \1272 nodeName_ == 'argsstring':1273 argsstring_ = ''1274 for text__content_ in child_.childNodes:1275 argsstring_ += text__content_.nodeValue1276 self.argsstring = argsstring_1277 elif child_.nodeType == Node.ELEMENT_NODE and \1278 nodeName_ == 'name':1279 name_ = ''1280 for text__content_ in child_.childNodes:1281 name_ += text__content_.nodeValue1282 self.name = name_1283 elif child_.nodeType == Node.ELEMENT_NODE and \1284 nodeName_ == 'read':1285 read_ = ''1286 for text__content_ in child_.childNodes:1287 read_ += text__content_.nodeValue1288 self.read = read_1289 elif child_.nodeType == Node.ELEMENT_NODE and \1290 nodeName_ == 'write':1291 write_ = ''1292 for text__content_ in child_.childNodes:1293 write_ += text__content_.nodeValue1294 self.write = write_1295 elif child_.nodeType == Node.ELEMENT_NODE and \1296 nodeName_ == 'bitfield':1297 bitfield_ = ''1298 for text__content_ in child_.childNodes:1299 bitfield_ += text__content_.nodeValue1300 self.bitfield = bitfield_1301 elif child_.nodeType == Node.ELEMENT_NODE and \1302 nodeName_ == 'reimplements':1303 obj_ = reimplementType.factory()1304 obj_.build(child_)1305 self.reimplements.append(obj_)1306 elif child_.nodeType == Node.ELEMENT_NODE and \1307 nodeName_ == 'reimplementedby':1308 obj_ = reimplementType.factory()1309 obj_.build(child_)1310 self.reimplementedby.append(obj_)1311 elif child_.nodeType == Node.ELEMENT_NODE and \1312 nodeName_ == 'param':1313 obj_ = paramType.factory()1314 obj_.build(child_)1315 self.param.append(obj_)1316 elif child_.nodeType == Node.ELEMENT_NODE and \1317 nodeName_ == 'enumvalue':1318 obj_ = enumvalueType.factory()1319 obj_.build(child_)1320 self.enumvalue.append(obj_)1321 elif child_.nodeType == Node.ELEMENT_NODE and \1322 nodeName_ == 'initializer':1323 obj_ = linkedTextType.factory()1324 obj_.build(child_)1325 self.set_initializer(obj_)1326 elif child_.nodeType == Node.ELEMENT_NODE and \1327 nodeName_ == 'exceptions':1328 obj_ = linkedTextType.factory()1329 obj_.build(child_)1330 self.set_exceptions(obj_)1331 elif child_.nodeType == Node.ELEMENT_NODE and \1332 nodeName_ == 'briefdescription':1333 obj_ = descriptionType.factory()1334 obj_.build(child_)1335 self.set_briefdescription(obj_)1336 elif child_.nodeType == Node.ELEMENT_NODE and \1337 nodeName_ == 'detaileddescription':1338 obj_ = descriptionType.factory()1339 obj_.build(child_)1340 self.set_detaileddescription(obj_)1341 elif child_.nodeType == Node.ELEMENT_NODE and \1342 nodeName_ == 'inbodydescription':1343 obj_ = descriptionType.factory()1344 obj_.build(child_)1345 self.set_inbodydescription(obj_)1346 elif child_.nodeType == Node.ELEMENT_NODE and \1347 nodeName_ == 'location':1348 obj_ = locationType.factory()1349 obj_.build(child_)1350 self.set_location(obj_)1351 elif child_.nodeType == Node.ELEMENT_NODE and \1352 nodeName_ == 'references':1353 obj_ = referenceType.factory()1354 obj_.build(child_)1355 self.references.append(obj_)1356 elif child_.nodeType == Node.ELEMENT_NODE and \1357 nodeName_ == 'referencedby':1358 obj_ = referenceType.factory()1359 obj_.build(child_)1360 self.referencedby.append(obj_)1361# end class memberdefType1362class definition(GeneratedsSuper):1363 subclass = None1364 superclass = None1365 def __init__(self, valueOf_=''):1366 self.valueOf_ = valueOf_1367 def factory(*args_, **kwargs_):1368 if definition.subclass:1369 return definition.subclass(*args_, **kwargs_)1370 else:1371 return definition(*args_, **kwargs_)1372 factory = staticmethod(factory)1373 def getValueOf_(self): return self.valueOf_1374 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1375 def hasContent_(self):1376 if (1377 self.valueOf_ is not None1378 ):1379 return True1380 else:1381 return False1382 def build(self, node_):1383 attrs = node_.attributes1384 self.buildAttributes(attrs)1385 self.valueOf_ = ''1386 for child_ in node_.childNodes:1387 nodeName_ = child_.nodeName.split(':')[-1]1388 self.buildChildren(child_, nodeName_)1389 def buildAttributes(self, attrs):1390 pass1391 def buildChildren(self, child_, nodeName_):1392 if child_.nodeType == Node.TEXT_NODE:1393 self.valueOf_ += child_.nodeValue1394 elif child_.nodeType == Node.CDATA_SECTION_NODE:1395 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1396# end class definition1397class argsstring(GeneratedsSuper):1398 subclass = None1399 superclass = None1400 def __init__(self, valueOf_=''):1401 self.valueOf_ = valueOf_1402 def factory(*args_, **kwargs_):1403 if argsstring.subclass:1404 return argsstring.subclass(*args_, **kwargs_)1405 else:1406 return argsstring(*args_, **kwargs_)1407 factory = staticmethod(factory)1408 def getValueOf_(self): return self.valueOf_1409 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1410 def export(self, outfile, level, namespace_='', name_='argsstring', namespacedef_=''):1411 showIndent(outfile, level)1412 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1413 self.exportAttributes(outfile, level, namespace_, name_='argsstring')1414 if self.hasContent_():1415 outfile.write('>\n')1416 self.exportChildren(outfile, level + 1, namespace_, name_)1417 showIndent(outfile, level)1418 outfile.write('</%s%s>\n' % (namespace_, name_))1419 else:1420 outfile.write(' />\n')1421 def hasContent_(self):1422 if (1423 self.valueOf_ is not None1424 ):1425 return True1426 else:1427 return False1428 def build(self, node_):1429 attrs = node_.attributes1430 self.buildAttributes(attrs)1431 self.valueOf_ = ''1432 for child_ in node_.childNodes:1433 nodeName_ = child_.nodeName.split(':')[-1]1434 self.buildChildren(child_, nodeName_)1435 def buildAttributes(self, attrs):1436 pass1437 def buildChildren(self, child_, nodeName_):1438 if child_.nodeType == Node.TEXT_NODE:1439 self.valueOf_ += child_.nodeValue1440 elif child_.nodeType == Node.CDATA_SECTION_NODE:1441 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1442# end class argsstring1443class read(GeneratedsSuper):1444 subclass = None1445 superclass = None1446 def __init__(self, valueOf_=''):1447 self.valueOf_ = valueOf_1448 def factory(*args_, **kwargs_):1449 if read.subclass:1450 return read.subclass(*args_, **kwargs_)1451 else:1452 return read(*args_, **kwargs_)1453 factory = staticmethod(factory)1454 def getValueOf_(self): return self.valueOf_1455 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1456 def hasContent_(self):1457 if (1458 self.valueOf_ is not None1459 ):1460 return True1461 else:1462 return False1463 def build(self, node_):1464 attrs = node_.attributes1465 self.buildAttributes(attrs)1466 self.valueOf_ = ''1467 for child_ in node_.childNodes:1468 nodeName_ = child_.nodeName.split(':')[-1]1469 self.buildChildren(child_, nodeName_)1470 def buildAttributes(self, attrs):1471 pass1472 def buildChildren(self, child_, nodeName_):1473 if child_.nodeType == Node.TEXT_NODE:1474 self.valueOf_ += child_.nodeValue1475 elif child_.nodeType == Node.CDATA_SECTION_NODE:1476 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1477# end class read1478class write(GeneratedsSuper):1479 subclass = None1480 superclass = None1481 def __init__(self, valueOf_=''):1482 self.valueOf_ = valueOf_1483 def factory(*args_, **kwargs_):1484 if write.subclass:1485 return write.subclass(*args_, **kwargs_)1486 else:1487 return write(*args_, **kwargs_)1488 factory = staticmethod(factory)1489 def getValueOf_(self): return self.valueOf_1490 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1491 def hasContent_(self):1492 if (1493 self.valueOf_ is not None1494 ):1495 return True1496 else:1497 return False1498 def build(self, node_):1499 attrs = node_.attributes1500 self.buildAttributes(attrs)1501 self.valueOf_ = ''1502 for child_ in node_.childNodes:1503 nodeName_ = child_.nodeName.split(':')[-1]1504 self.buildChildren(child_, nodeName_)1505 def buildAttributes(self, attrs):1506 pass1507 def buildChildren(self, child_, nodeName_):1508 if child_.nodeType == Node.TEXT_NODE:1509 self.valueOf_ += child_.nodeValue1510 elif child_.nodeType == Node.CDATA_SECTION_NODE:1511 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1512# end class write1513class bitfield(GeneratedsSuper):1514 subclass = None1515 superclass = None1516 def __init__(self, valueOf_=''):1517 self.valueOf_ = valueOf_1518 def factory(*args_, **kwargs_):1519 if bitfield.subclass:1520 return bitfield.subclass(*args_, **kwargs_)1521 else:1522 return bitfield(*args_, **kwargs_)1523 factory = staticmethod(factory)1524 def getValueOf_(self): return self.valueOf_1525 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1526 def hasContent_(self):1527 if (1528 self.valueOf_ is not None1529 ):1530 return True1531 else:1532 return False1533 def build(self, node_):1534 attrs = node_.attributes1535 self.buildAttributes(attrs)1536 self.valueOf_ = ''1537 for child_ in node_.childNodes:1538 nodeName_ = child_.nodeName.split(':')[-1]1539 self.buildChildren(child_, nodeName_)1540 def buildAttributes(self, attrs):1541 pass1542 def buildChildren(self, child_, nodeName_):1543 if child_.nodeType == Node.TEXT_NODE:1544 self.valueOf_ += child_.nodeValue1545 elif child_.nodeType == Node.CDATA_SECTION_NODE:1546 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1547# end class bitfield1548class descriptionType(GeneratedsSuper):1549 subclass = None1550 superclass = None1551 def __init__(self, title=None, para=None, sect1=None, internal=None, mixedclass_=None, content_=None):1552 if mixedclass_ is None:1553 self.mixedclass_ = MixedContainer1554 else:1555 self.mixedclass_ = mixedclass_1556 if content_ is None:1557 self.content_ = []1558 else:1559 self.content_ = content_1560 def factory(*args_, **kwargs_):1561 if descriptionType.subclass:1562 return descriptionType.subclass(*args_, **kwargs_)1563 else:1564 return descriptionType(*args_, **kwargs_)1565 factory = staticmethod(factory)1566 def get_title(self): return self.title1567 def set_title(self, title): self.title = title1568 def get_para(self): return self.para1569 def set_para(self, para): self.para = para1570 def add_para(self, value): self.para.append(value)1571 def insert_para(self, index, value): self.para[index] = value1572 def get_sect1(self): return self.sect11573 def set_sect1(self, sect1): self.sect1 = sect11574 def add_sect1(self, value): self.sect1.append(value)1575 def insert_sect1(self, index, value): self.sect1[index] = value1576 def get_internal(self): return self.internal1577 def set_internal(self, internal): self.internal = internal1578 def hasContent_(self):1579 if (1580 self.title is not None or1581 self.para is not None or1582 self.sect1 is not None or1583 self.internal is not None1584 ):1585 return True1586 else:1587 return False1588 def build(self, node_):1589 attrs = node_.attributes1590 self.buildAttributes(attrs)1591 for child_ in node_.childNodes:1592 nodeName_ = child_.nodeName.split(':')[-1]1593 self.buildChildren(child_, nodeName_)1594 def buildAttributes(self, attrs):1595 pass1596 def buildChildren(self, child_, nodeName_):1597 if child_.nodeType == Node.ELEMENT_NODE and \1598 nodeName_ == 'title':1599 childobj_ = docTitleType.factory()1600 childobj_.build(child_)1601 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1602 MixedContainer.TypeNone, 'title', childobj_)1603 self.content_.append(obj_)1604 elif child_.nodeType == Node.ELEMENT_NODE and \1605 nodeName_ == 'para':1606 childobj_ = docParaType.factory()1607 childobj_.build(child_)1608 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1609 MixedContainer.TypeNone, 'para', childobj_)1610 self.content_.append(obj_)1611 elif child_.nodeType == Node.ELEMENT_NODE and \1612 nodeName_ == 'sect1':1613 childobj_ = docSect1Type.factory()1614 childobj_.build(child_)1615 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1616 MixedContainer.TypeNone, 'sect1', childobj_)1617 self.content_.append(obj_)1618 elif child_.nodeType == Node.ELEMENT_NODE and \1619 nodeName_ == 'internal':1620 childobj_ = docInternalType.factory()1621 childobj_.build(child_)1622 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1623 MixedContainer.TypeNone, 'internal', childobj_)1624 self.content_.append(obj_)1625# end class descriptionType1626class enumvalueType(GeneratedsSuper):1627 subclass = None1628 superclass = None1629 def __init__(self, prot=None, id=None, name=None, initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):1630 self.prot = prot1631 self.id = id1632 if mixedclass_ is None:1633 self.mixedclass_ = MixedContainer1634 else:1635 self.mixedclass_ = mixedclass_1636 if content_ is None:1637 self.content_ = []1638 else:1639 self.content_ = content_1640 def factory(*args_, **kwargs_):1641 if enumvalueType.subclass:1642 return enumvalueType.subclass(*args_, **kwargs_)1643 else:1644 return enumvalueType(*args_, **kwargs_)1645 factory = staticmethod(factory)1646 def get_name(self): return self.name1647 def set_name(self, name): self.name = name1648 def get_initializer(self): return self.initializer1649 def set_initializer(self, initializer): self.initializer = initializer1650 def get_briefdescription(self): return self.briefdescription1651 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription1652 def get_detaileddescription(self): return self.detaileddescription1653 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription1654 def get_prot(self): return self.prot1655 def set_prot(self, prot): self.prot = prot1656 def get_id(self): return self.id1657 def set_id(self, id): self.id = id1658 def hasContent_(self):1659 if (1660 self.name is not None or1661 self.initializer is not None or1662 self.briefdescription is not None or1663 self.detaileddescription is not None1664 ):1665 return True1666 else:1667 return False1668 def build(self, node_):1669 attrs = node_.attributes1670 self.buildAttributes(attrs)1671 for child_ in node_.childNodes:1672 nodeName_ = child_.nodeName.split(':')[-1]1673 self.buildChildren(child_, nodeName_)1674 def buildAttributes(self, attrs):1675 if attrs.get('prot'):1676 self.prot = attrs.get('prot').value1677 if attrs.get('id'):1678 self.id = attrs.get('id').value1679 def buildChildren(self, child_, nodeName_):1680 if child_.nodeType == Node.ELEMENT_NODE and \1681 nodeName_ == 'name':1682 value_ = []1683 for text_ in child_.childNodes:1684 value_.append(text_.nodeValue)1685 valuestr_ = ''.join(value_)1686 obj_ = self.mixedclass_(MixedContainer.CategorySimple,1687 MixedContainer.TypeString, 'name', valuestr_)1688 self.content_.append(obj_)1689 elif child_.nodeType == Node.ELEMENT_NODE and \1690 nodeName_ == 'initializer':1691 childobj_ = linkedTextType.factory()1692 childobj_.build(child_)1693 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1694 MixedContainer.TypeNone, 'initializer', childobj_)1695 self.content_.append(obj_)1696 elif child_.nodeType == Node.ELEMENT_NODE and \1697 nodeName_ == 'briefdescription':1698 childobj_ = descriptionType.factory()1699 childobj_.build(child_)1700 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1701 MixedContainer.TypeNone, 'briefdescription', childobj_)1702 self.content_.append(obj_)1703 elif child_.nodeType == Node.ELEMENT_NODE and \1704 nodeName_ == 'detaileddescription':1705 childobj_ = descriptionType.factory()1706 childobj_.build(child_)1707 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1708 MixedContainer.TypeNone, 'detaileddescription', childobj_)1709 self.content_.append(obj_)1710 elif child_.nodeType == Node.TEXT_NODE:1711 obj_ = self.mixedclass_(MixedContainer.CategoryText,1712 MixedContainer.TypeNone, '', child_.nodeValue)1713 self.content_.append(obj_)1714# end class enumvalueType1715class templateparamlistType(GeneratedsSuper):1716 subclass = None1717 superclass = None1718 def __init__(self, param=None):1719 if param is None:1720 self.param = []1721 else:1722 self.param = param1723 def factory(*args_, **kwargs_):1724 if templateparamlistType.subclass:1725 return templateparamlistType.subclass(*args_, **kwargs_)1726 else:1727 return templateparamlistType(*args_, **kwargs_)1728 factory = staticmethod(factory)1729 def get_param(self): return self.param1730 def set_param(self, param): self.param = param1731 def add_param(self, value): self.param.append(value)1732 def insert_param(self, index, value): self.param[index] = value1733 def hasContent_(self):1734 if (1735 self.param is not None1736 ):1737 return True1738 else:1739 return False1740 def build(self, node_):1741 attrs = node_.attributes1742 self.buildAttributes(attrs)1743 for child_ in node_.childNodes:1744 nodeName_ = child_.nodeName.split(':')[-1]1745 self.buildChildren(child_, nodeName_)1746 def buildAttributes(self, attrs):1747 pass1748 def buildChildren(self, child_, nodeName_):1749 if child_.nodeType == Node.ELEMENT_NODE and \1750 nodeName_ == 'param':1751 obj_ = paramType.factory()1752 obj_.build(child_)1753 self.param.append(obj_)1754# end class templateparamlistType1755class paramType(GeneratedsSuper):1756 subclass = None1757 superclass = None1758 def __init__(self, type_=None, declname=None, defname=None, array=None, defval=None, briefdescription=None):1759 self.type_ = type_1760 self.declname = declname1761 self.defname = defname1762 self.array = array1763 self.defval = defval1764 self.briefdescription = briefdescription1765 def factory(*args_, **kwargs_):1766 if paramType.subclass:1767 return paramType.subclass(*args_, **kwargs_)1768 else:1769 return paramType(*args_, **kwargs_)1770 factory = staticmethod(factory)1771 def get_type(self): return self.type_1772 def set_type(self, type_): self.type_ = type_1773 def get_declname(self): return self.declname1774 def set_declname(self, declname): self.declname = declname1775 def get_defname(self): return self.defname1776 def set_defname(self, defname): self.defname = defname1777 def get_array(self): return self.array1778 def set_array(self, array): self.array = array1779 def get_defval(self): return self.defval1780 def set_defval(self, defval): self.defval = defval1781 def get_briefdescription(self): return self.briefdescription1782 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription1783 def hasContent_(self):1784 if (1785 self.type_ is not None or1786 self.declname is not None or1787 self.defname is not None or1788 self.array is not None or1789 self.defval is not None or1790 self.briefdescription is not None1791 ):1792 return True1793 else:1794 return False1795 def build(self, node_):1796 attrs = node_.attributes1797 self.buildAttributes(attrs)1798 for child_ in node_.childNodes:1799 nodeName_ = child_.nodeName.split(':')[-1]1800 self.buildChildren(child_, nodeName_)1801 def buildAttributes(self, attrs):1802 pass1803 def buildChildren(self, child_, nodeName_):1804 if child_.nodeType == Node.ELEMENT_NODE and \1805 nodeName_ == 'type':1806 obj_ = linkedTextType.factory()1807 obj_.build(child_)1808 self.set_type(obj_)1809 elif child_.nodeType == Node.ELEMENT_NODE and \1810 nodeName_ == 'declname':1811 declname_ = ''1812 for text__content_ in child_.childNodes:1813 declname_ += text__content_.nodeValue1814 self.declname = declname_1815 elif child_.nodeType == Node.ELEMENT_NODE and \1816 nodeName_ == 'defname':1817 defname_ = ''1818 for text__content_ in child_.childNodes:1819 defname_ += text__content_.nodeValue1820 self.defname = defname_1821 elif child_.nodeType == Node.ELEMENT_NODE and \1822 nodeName_ == 'array':1823 array_ = ''1824 for text__content_ in child_.childNodes:1825 array_ += text__content_.nodeValue1826 self.array = array_1827 elif child_.nodeType == Node.ELEMENT_NODE and \1828 nodeName_ == 'defval':1829 obj_ = linkedTextType.factory()1830 obj_.build(child_)1831 self.set_defval(obj_)1832 elif child_.nodeType == Node.ELEMENT_NODE and \1833 nodeName_ == 'briefdescription':1834 obj_ = descriptionType.factory()1835 obj_.build(child_)1836 self.set_briefdescription(obj_)1837# end class paramType1838class declname(GeneratedsSuper):1839 subclass = None1840 superclass = None1841 def __init__(self, valueOf_=''):1842 self.valueOf_ = valueOf_1843 def factory(*args_, **kwargs_):1844 if declname.subclass:1845 return declname.subclass(*args_, **kwargs_)1846 else:1847 return declname(*args_, **kwargs_)1848 factory = staticmethod(factory)1849 def getValueOf_(self): return self.valueOf_1850 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1851 def hasContent_(self):1852 if (1853 self.valueOf_ is not None1854 ):1855 return True1856 else:1857 return False1858 def build(self, node_):1859 attrs = node_.attributes1860 self.buildAttributes(attrs)1861 self.valueOf_ = ''1862 for child_ in node_.childNodes:1863 nodeName_ = child_.nodeName.split(':')[-1]1864 self.buildChildren(child_, nodeName_)1865 def buildAttributes(self, attrs):1866 pass1867 def buildChildren(self, child_, nodeName_):1868 if child_.nodeType == Node.TEXT_NODE:1869 self.valueOf_ += child_.nodeValue1870 elif child_.nodeType == Node.CDATA_SECTION_NODE:1871 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1872# end class declname1873class defname(GeneratedsSuper):1874 subclass = None1875 superclass = None1876 def __init__(self, valueOf_=''):1877 self.valueOf_ = valueOf_1878 def factory(*args_, **kwargs_):1879 if defname.subclass:1880 return defname.subclass(*args_, **kwargs_)1881 else:1882 return defname(*args_, **kwargs_)1883 factory = staticmethod(factory)1884 def getValueOf_(self): return self.valueOf_1885 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1886 def hasContent_(self):1887 if (1888 self.valueOf_ is not None1889 ):1890 return True1891 else:1892 return False1893 def build(self, node_):1894 attrs = node_.attributes1895 self.buildAttributes(attrs)1896 self.valueOf_ = ''1897 for child_ in node_.childNodes:1898 nodeName_ = child_.nodeName.split(':')[-1]1899 self.buildChildren(child_, nodeName_)1900 def buildAttributes(self, attrs):1901 pass1902 def buildChildren(self, child_, nodeName_):1903 if child_.nodeType == Node.TEXT_NODE:1904 self.valueOf_ += child_.nodeValue1905 elif child_.nodeType == Node.CDATA_SECTION_NODE:1906 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1907# end class defname1908class array(GeneratedsSuper):1909 subclass = None1910 superclass = None1911 def __init__(self, valueOf_=''):1912 self.valueOf_ = valueOf_1913 def factory(*args_, **kwargs_):1914 if array.subclass:1915 return array.subclass(*args_, **kwargs_)1916 else:1917 return array(*args_, **kwargs_)1918 factory = staticmethod(factory)1919 def getValueOf_(self): return self.valueOf_1920 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1921 def hasContent_(self):1922 if (1923 self.valueOf_ is not None1924 ):1925 return True1926 else:1927 return False1928 def build(self, node_):1929 attrs = node_.attributes1930 self.buildAttributes(attrs)1931 self.valueOf_ = ''1932 for child_ in node_.childNodes:1933 nodeName_ = child_.nodeName.split(':')[-1]1934 self.buildChildren(child_, nodeName_)1935 def buildAttributes(self, attrs):1936 pass1937 def buildChildren(self, child_, nodeName_):1938 if child_.nodeType == Node.TEXT_NODE:1939 self.valueOf_ += child_.nodeValue1940 elif child_.nodeType == Node.CDATA_SECTION_NODE:1941 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1942# end class array1943class linkedTextType(GeneratedsSuper):1944 subclass = None1945 superclass = None1946 def __init__(self, ref=None, mixedclass_=None, content_=None):1947 if mixedclass_ is None:1948 self.mixedclass_ = MixedContainer1949 else:1950 self.mixedclass_ = mixedclass_1951 if content_ is None:1952 self.content_ = []1953 else:1954 self.content_ = content_1955 def factory(*args_, **kwargs_):1956 if linkedTextType.subclass:1957 return linkedTextType.subclass(*args_, **kwargs_)1958 else:1959 return linkedTextType(*args_, **kwargs_)1960 factory = staticmethod(factory)1961 def get_ref(self): return self.ref1962 def set_ref(self, ref): self.ref = ref1963 def add_ref(self, value): self.ref.append(value)1964 def insert_ref(self, index, value): self.ref[index] = value1965 def hasContent_(self):1966 if (1967 self.ref is not None1968 ):1969 return True1970 else:1971 return False1972 def build(self, node_):1973 attrs = node_.attributes1974 self.buildAttributes(attrs)1975 for child_ in node_.childNodes:1976 nodeName_ = child_.nodeName.split(':')[-1]1977 self.buildChildren(child_, nodeName_)1978 def buildAttributes(self, attrs):1979 pass1980 def buildChildren(self, child_, nodeName_):1981 if child_.nodeType == Node.ELEMENT_NODE and \1982 nodeName_ == 'ref':1983 childobj_ = docRefTextType.factory()1984 childobj_.build(child_)1985 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,1986 MixedContainer.TypeNone, 'ref', childobj_)1987 self.content_.append(obj_)1988 elif child_.nodeType == Node.TEXT_NODE:1989 obj_ = self.mixedclass_(MixedContainer.CategoryText,1990 MixedContainer.TypeNone, '', child_.nodeValue)1991 self.content_.append(obj_)1992# end class linkedTextType1993class graphType(GeneratedsSuper):1994 subclass = None1995 superclass = None1996 def __init__(self, node=None, direction: str = "forward", caption:str = ""):1997 if node is None:1998 self.node = []1999 else:2000 self.node = node2001 self.direction = direction2002 self.caption = caption2003 def factory(*args_, **kwargs_):2004 if graphType.subclass:2005 return graphType.subclass(*args_, **kwargs_)2006 else:2007 return graphType(*args_, **kwargs_)2008 factory = staticmethod(factory)2009 def get_direction(self): return self.direction2010 def set_direction(self, direction): self.direction = direction2011 def get_caption(self): return self.caption2012 def set_caption(self, caption): self.caption = caption2013 def get_node(self): return self.node2014 def set_node(self, node): self.node = node2015 def add_node(self, value): self.node.append(value)2016 def insert_node(self, index, value): self.node[index] = value2017 def hasContent_(self):2018 if (2019 self.node is not None2020 ):2021 return True2022 else:2023 return False2024 def build(self, node_):2025 attrs = node_.attributes2026 self.buildAttributes(attrs)2027 for child_ in node_.childNodes:2028 nodeName_ = child_.nodeName.split(':')[-1]2029 self.buildChildren(child_, nodeName_)2030 def buildAttributes(self, attrs):2031 pass2032 def buildChildren(self, child_, nodeName_):2033 if child_.nodeType == Node.ELEMENT_NODE and \2034 nodeName_ == 'node':2035 obj_ = nodeType.factory()2036 obj_.build(child_)2037 self.node.append(obj_)2038# end class graphType2039class nodeType(GeneratedsSuper):2040 subclass = None2041 superclass = None2042 def __init__(self, id=None, label=None, link=None, childnode=None):2043 self.id = id2044 self.label = label2045 self.link = link2046 if childnode is None:2047 self.childnode = []2048 else:2049 self.childnode = childnode2050 def factory(*args_, **kwargs_):2051 if nodeType.subclass:2052 return nodeType.subclass(*args_, **kwargs_)2053 else:2054 return nodeType(*args_, **kwargs_)2055 factory = staticmethod(factory)2056 def get_label(self): return self.label2057 def set_label(self, label): self.label = label2058 def get_link(self): return self.link2059 def set_link(self, link): self.link = link2060 def get_childnode(self): return self.childnode2061 def set_childnode(self, childnode): self.childnode = childnode2062 def add_childnode(self, value): self.childnode.append(value)2063 def insert_childnode(self, index, value): self.childnode[index] = value2064 def get_id(self): return self.id2065 def set_id(self, id): self.id = id2066 def hasContent_(self):2067 if (2068 self.label is not None or2069 self.link is not None or2070 self.childnode is not None2071 ):2072 return True2073 else:2074 return False2075 def build(self, node_):2076 attrs = node_.attributes2077 self.buildAttributes(attrs)2078 for child_ in node_.childNodes:2079 nodeName_ = child_.nodeName.split(':')[-1]2080 self.buildChildren(child_, nodeName_)2081 def buildAttributes(self, attrs):2082 if attrs.get('id'):2083 self.id = attrs.get('id').value2084 def buildChildren(self, child_, nodeName_):2085 if child_.nodeType == Node.ELEMENT_NODE and \2086 nodeName_ == 'label':2087 label_ = ''2088 for text__content_ in child_.childNodes:2089 label_ += text__content_.nodeValue2090 self.label = label_2091 elif child_.nodeType == Node.ELEMENT_NODE and \2092 nodeName_ == 'link':2093 obj_ = linkType.factory()2094 obj_.build(child_)2095 self.set_link(obj_)2096 elif child_.nodeType == Node.ELEMENT_NODE and \2097 nodeName_ == 'childnode':2098 obj_ = childnodeType.factory()2099 obj_.build(child_)2100 self.childnode.append(obj_)2101# end class nodeType2102class label(GeneratedsSuper):2103 subclass = None2104 superclass = None2105 def __init__(self, valueOf_=''):2106 self.valueOf_ = valueOf_2107 def factory(*args_, **kwargs_):2108 if label.subclass:2109 return label.subclass(*args_, **kwargs_)2110 else:2111 return label(*args_, **kwargs_)2112 factory = staticmethod(factory)2113 def getValueOf_(self): return self.valueOf_2114 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2115 def hasContent_(self):2116 if (2117 self.valueOf_ is not None2118 ):2119 return True2120 else:2121 return False2122 def build(self, node_):2123 attrs = node_.attributes2124 self.buildAttributes(attrs)2125 self.valueOf_ = ''2126 for child_ in node_.childNodes:2127 nodeName_ = child_.nodeName.split(':')[-1]2128 self.buildChildren(child_, nodeName_)2129 def buildAttributes(self, attrs):2130 pass2131 def buildChildren(self, child_, nodeName_):2132 if child_.nodeType == Node.TEXT_NODE:2133 self.valueOf_ += child_.nodeValue2134 elif child_.nodeType == Node.CDATA_SECTION_NODE:2135 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2136# end class label2137class childnodeType(GeneratedsSuper):2138 subclass = None2139 superclass = None2140 def __init__(self, relation=None, refid=None, edgelabel=None):2141 self.relation = relation2142 self.refid = refid2143 if edgelabel is None:2144 self.edgelabel = []2145 else:2146 self.edgelabel = edgelabel2147 def factory(*args_, **kwargs_):2148 if childnodeType.subclass:2149 return childnodeType.subclass(*args_, **kwargs_)2150 else:2151 return childnodeType(*args_, **kwargs_)2152 factory = staticmethod(factory)2153 def get_edgelabel(self): return self.edgelabel2154 def set_edgelabel(self, edgelabel): self.edgelabel = edgelabel2155 def add_edgelabel(self, value): self.edgelabel.append(value)2156 def insert_edgelabel(self, index, value): self.edgelabel[index] = value2157 def get_relation(self): return self.relation2158 def set_relation(self, relation): self.relation = relation2159 def get_refid(self): return self.refid2160 def set_refid(self, refid): self.refid = refid2161 def export(self, outfile, level, namespace_='', name_='childnodeType', namespacedef_=''):2162 showIndent(outfile, level)2163 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2164 self.exportAttributes(outfile, level, namespace_, name_='childnodeType')2165 if self.hasContent_():2166 outfile.write('>\n')2167 self.exportChildren(outfile, level + 1, namespace_, name_)2168 showIndent(outfile, level)2169 outfile.write('</%s%s>\n' % (namespace_, name_))2170 else:2171 outfile.write(' />\n')2172 def exportAttributes(self, outfile, level, namespace_='', name_='childnodeType'):2173 if self.relation is not None:2174 outfile.write(' relation=%s' % (quote_attrib(self.relation), ))2175 if self.refid is not None:2176 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))2177 def exportChildren(self, outfile, level, namespace_='', name_='childnodeType'):2178 for edgelabel_ in self.edgelabel:2179 showIndent(outfile, level)2180 outfile.write('<%sedgelabel>%s</%sedgelabel>\n' % (namespace_, self.format_string(quote_xml(edgelabel_).encode(ExternalEncoding), input_name='edgelabel'), namespace_))2181 def hasContent_(self):2182 if (2183 self.edgelabel is not None2184 ):2185 return True2186 else:2187 return False2188 def build(self, node_):2189 attrs = node_.attributes2190 self.buildAttributes(attrs)2191 for child_ in node_.childNodes:2192 nodeName_ = child_.nodeName.split(':')[-1]2193 self.buildChildren(child_, nodeName_)2194 def buildAttributes(self, attrs):2195 if attrs.get('relation'):2196 self.relation = attrs.get('relation').value2197 if attrs.get('refid'):2198 self.refid = attrs.get('refid').value2199 def buildChildren(self, child_, nodeName_):2200 if child_.nodeType == Node.ELEMENT_NODE and \2201 nodeName_ == 'edgelabel':2202 edgelabel_ = ''2203 for text__content_ in child_.childNodes:2204 edgelabel_ += text__content_.nodeValue2205 self.edgelabel.append(edgelabel_)2206# end class childnodeType2207class edgelabel(GeneratedsSuper):2208 subclass = None2209 superclass = None2210 def __init__(self, valueOf_=''):2211 self.valueOf_ = valueOf_2212 def factory(*args_, **kwargs_):2213 if edgelabel.subclass:2214 return edgelabel.subclass(*args_, **kwargs_)2215 else:2216 return edgelabel(*args_, **kwargs_)2217 factory = staticmethod(factory)2218 def getValueOf_(self): return self.valueOf_2219 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2220 def export(self, outfile, level, namespace_='', name_='edgelabel', namespacedef_=''):2221 showIndent(outfile, level)2222 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2223 self.exportAttributes(outfile, level, namespace_, name_='edgelabel')2224 if self.hasContent_():2225 outfile.write('>\n')2226 self.exportChildren(outfile, level + 1, namespace_, name_)2227 showIndent(outfile, level)2228 outfile.write('</%s%s>\n' % (namespace_, name_))2229 else:2230 outfile.write(' />\n')2231 def exportAttributes(self, outfile, level, namespace_='', name_='edgelabel'):2232 pass2233 def exportChildren(self, outfile, level, namespace_='', name_='edgelabel'):2234 if self.valueOf_.find('![CDATA')>-1:2235 value=quote_xml('%s' % self.valueOf_)2236 value=value.replace('![CDATA','<![CDATA')2237 value=value.replace(']]',']]>')2238 outfile.write(value)2239 else:2240 outfile.write(quote_xml('%s' % self.valueOf_))2241 def hasContent_(self):2242 if (2243 self.valueOf_ is not None2244 ):2245 return True2246 else:2247 return False2248 def build(self, node_):2249 attrs = node_.attributes2250 self.buildAttributes(attrs)2251 self.valueOf_ = ''2252 for child_ in node_.childNodes:2253 nodeName_ = child_.nodeName.split(':')[-1]2254 self.buildChildren(child_, nodeName_)2255 def buildAttributes(self, attrs):2256 pass2257 def buildChildren(self, child_, nodeName_):2258 if child_.nodeType == Node.TEXT_NODE:2259 self.valueOf_ += child_.nodeValue2260 elif child_.nodeType == Node.CDATA_SECTION_NODE:2261 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2262# end class edgelabel2263class linkType(GeneratedsSuper):2264 subclass = None2265 superclass = None2266 def __init__(self, refid=None, external=None, valueOf_=''):2267 self.refid = refid2268 self.external = external2269 self.valueOf_ = valueOf_2270 def factory(*args_, **kwargs_):2271 if linkType.subclass:2272 return linkType.subclass(*args_, **kwargs_)2273 else:2274 return linkType(*args_, **kwargs_)2275 factory = staticmethod(factory)2276 def get_refid(self): return self.refid2277 def set_refid(self, refid): self.refid = refid2278 def get_external(self): return self.external2279 def set_external(self, external): self.external = external2280 def getValueOf_(self): return self.valueOf_2281 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2282 def export(self, outfile, level, namespace_='', name_='linkType', namespacedef_=''):2283 showIndent(outfile, level)2284 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2285 self.exportAttributes(outfile, level, namespace_, name_='linkType')2286 if self.hasContent_():2287 outfile.write('>\n')2288 self.exportChildren(outfile, level + 1, namespace_, name_)2289 showIndent(outfile, level)2290 outfile.write('</%s%s>\n' % (namespace_, name_))2291 else:2292 outfile.write(' />\n')2293 def exportAttributes(self, outfile, level, namespace_='', name_='linkType'):2294 if self.refid is not None:2295 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))2296 if self.external is not None:2297 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))2298 def exportChildren(self, outfile, level, namespace_='', name_='linkType'):2299 if self.valueOf_.find('![CDATA')>-1:2300 value=quote_xml('%s' % self.valueOf_)2301 value=value.replace('![CDATA','<![CDATA')2302 value=value.replace(']]',']]>')2303 outfile.write(value)2304 else:2305 outfile.write(quote_xml('%s' % self.valueOf_))2306 def hasContent_(self):2307 if (2308 self.valueOf_ is not None2309 ):2310 return True2311 else:2312 return False2313 def build(self, node_):2314 attrs = node_.attributes2315 self.buildAttributes(attrs)2316 self.valueOf_ = ''2317 for child_ in node_.childNodes:2318 nodeName_ = child_.nodeName.split(':')[-1]2319 self.buildChildren(child_, nodeName_)2320 def buildAttributes(self, attrs):2321 if attrs.get('refid'):2322 self.refid = attrs.get('refid').value2323 if attrs.get('external'):2324 self.external = attrs.get('external').value2325 def buildChildren(self, child_, nodeName_):2326 if child_.nodeType == Node.TEXT_NODE:2327 self.valueOf_ += child_.nodeValue2328 elif child_.nodeType == Node.CDATA_SECTION_NODE:2329 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2330# end class linkType2331class listingType(GeneratedsSuper):2332 subclass = None2333 superclass = None2334 def __init__(self, codeline=None, domain: str=None):2335 self.domain = domain2336 if codeline is None:2337 self.codeline = []2338 else:2339 self.codeline = codeline2340 def factory(*args_, **kwargs_):2341 if listingType.subclass:2342 return listingType.subclass(*args_, **kwargs_)2343 else:2344 return listingType(*args_, **kwargs_)2345 factory = staticmethod(factory)2346 def get_codeline(self): return self.codeline2347 def set_codeline(self, codeline): self.codeline = codeline2348 def add_codeline(self, value): self.codeline.append(value)2349 def insert_codeline(self, index, value): self.codeline[index] = value2350 def export(self, outfile, level, namespace_='', name_='listingType', namespacedef_=''):2351 showIndent(outfile, level)2352 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2353 self.exportAttributes(outfile, level, namespace_, name_='listingType')2354 if self.hasContent_():2355 outfile.write('>\n')2356 self.exportChildren(outfile, level + 1, namespace_, name_)2357 showIndent(outfile, level)2358 outfile.write('</%s%s>\n' % (namespace_, name_))2359 else:2360 outfile.write(' />\n')2361 def exportAttributes(self, outfile, level, namespace_='', name_='listingType'):2362 pass2363 def exportChildren(self, outfile, level, namespace_='', name_='listingType'):2364 for codeline_ in self.codeline:2365 codeline_.export(outfile, level, namespace_, name_='codeline')2366 def hasContent_(self):2367 if (2368 self.codeline is not None2369 ):2370 return True2371 else:2372 return False2373 def build(self, node_: minidom.Element):2374 attrs = node_.attributes2375 self.buildAttributes(attrs)2376 for child_ in node_.childNodes:2377 nodeName_ = child_.nodeName.split(':')[-1]2378 self.buildChildren(child_, nodeName_)2379 def buildAttributes(self, attrs: minidom.NamedNodeMap):2380 if "filename" in attrs:2381 # extract the domain for this programlisting tag.2382 filename = attrs["filename"].value2383 self.domain = filetypes.get_pygments_alias(filename) or filetypes.get_extension(filename)2384 def buildChildren(self, child_, nodeName_):2385 if child_.nodeType == Node.ELEMENT_NODE and \2386 nodeName_ == 'codeline':2387 obj_ = codelineType.factory()2388 obj_.build(child_)2389 self.codeline.append(obj_)2390# end class listingType2391class codelineType(GeneratedsSuper):2392 subclass = None2393 superclass = None2394 def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):2395 self.external = external2396 self.lineno = lineno2397 self.refkind = refkind2398 self.refid = refid2399 if highlight is None:2400 self.highlight = []2401 else:2402 self.highlight = highlight2403 def factory(*args_, **kwargs_):2404 if codelineType.subclass:2405 return codelineType.subclass(*args_, **kwargs_)2406 else:2407 return codelineType(*args_, **kwargs_)2408 factory = staticmethod(factory)2409 def get_highlight(self): return self.highlight2410 def set_highlight(self, highlight): self.highlight = highlight2411 def add_highlight(self, value): self.highlight.append(value)2412 def insert_highlight(self, index, value): self.highlight[index] = value2413 def get_external(self): return self.external2414 def set_external(self, external): self.external = external2415 def get_lineno(self): return self.lineno2416 def set_lineno(self, lineno): self.lineno = lineno2417 def get_refkind(self): return self.refkind2418 def set_refkind(self, refkind): self.refkind = refkind2419 def get_refid(self): return self.refid2420 def set_refid(self, refid): self.refid = refid2421 def export(self, outfile, level, namespace_='', name_='codelineType', namespacedef_=''):2422 showIndent(outfile, level)2423 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2424 self.exportAttributes(outfile, level, namespace_, name_='codelineType')2425 if self.hasContent_():2426 outfile.write('>\n')2427 self.exportChildren(outfile, level + 1, namespace_, name_)2428 showIndent(outfile, level)2429 outfile.write('</%s%s>\n' % (namespace_, name_))2430 else:2431 outfile.write(' />\n')2432 def exportAttributes(self, outfile, level, namespace_='', name_='codelineType'):2433 if self.external is not None:2434 outfile.write(' external=%s' % (quote_attrib(self.external), ))2435 if self.lineno is not None:2436 outfile.write(' lineno="%s"' % self.format_integer(self.lineno, input_name='lineno'))2437 if self.refkind is not None:2438 outfile.write(' refkind=%s' % (quote_attrib(self.refkind), ))2439 if self.refid is not None:2440 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))2441 def exportChildren(self, outfile, level, namespace_='', name_='codelineType'):2442 for highlight_ in self.highlight:2443 highlight_.export(outfile, level, namespace_, name_='highlight')2444 def hasContent_(self):2445 if (2446 self.highlight is not None2447 ):2448 return True2449 else:2450 return False2451 def build(self, node_):2452 attrs = node_.attributes2453 self.buildAttributes(attrs)2454 for child_ in node_.childNodes:2455 nodeName_ = child_.nodeName.split(':')[-1]2456 self.buildChildren(child_, nodeName_)2457 def buildAttributes(self, attrs):2458 if attrs.get('external'):2459 self.external = attrs.get('external').value2460 if attrs.get('lineno'):2461 try:2462 self.lineno = int(attrs.get('lineno').value)2463 except ValueError as exp:2464 raise ValueError('Bad integer attribute (lineno): %s' % exp)2465 if attrs.get('refkind'):2466 self.refkind = attrs.get('refkind').value2467 if attrs.get('refid'):2468 self.refid = attrs.get('refid').value2469 def buildChildren(self, child_, nodeName_):2470 if child_.nodeType == Node.ELEMENT_NODE and \2471 nodeName_ == 'highlight':2472 obj_ = highlightType.factory()2473 obj_.build(child_)2474 self.highlight.append(obj_)2475# end class codelineType2476class highlightType(GeneratedsSuper):2477 subclass = None2478 superclass = None2479 def __init__(self, classxx=None, sp=None, ref=None, mixedclass_=None, content_=None):2480 self.classxx = classxx2481 if mixedclass_ is None:2482 self.mixedclass_ = MixedContainer2483 else:2484 self.mixedclass_ = mixedclass_2485 if content_ is None:2486 self.content_ = []2487 else:2488 self.content_ = content_2489 def factory(*args_, **kwargs_):2490 if highlightType.subclass:2491 return highlightType.subclass(*args_, **kwargs_)2492 else:2493 return highlightType(*args_, **kwargs_)2494 factory = staticmethod(factory)2495 def get_sp(self): return self.sp2496 def set_sp(self, sp): self.sp = sp2497 def add_sp(self, value): self.sp.append(value)2498 def insert_sp(self, index, value): self.sp[index] = value2499 def get_ref(self): return self.ref2500 def set_ref(self, ref): self.ref = ref2501 def add_ref(self, value): self.ref.append(value)2502 def insert_ref(self, index, value): self.ref[index] = value2503 def get_class(self): return self.classxx2504 def set_class(self, classxx): self.classxx = classxx2505 def export(self, outfile, level, namespace_='', name_='highlightType', namespacedef_=''):2506 showIndent(outfile, level)2507 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2508 self.exportAttributes(outfile, level, namespace_, name_='highlightType')2509 outfile.write('>')2510 self.exportChildren(outfile, level + 1, namespace_, name_)2511 outfile.write('</%s%s>\n' % (namespace_, name_))2512 def exportAttributes(self, outfile, level, namespace_='', name_='highlightType'):2513 if self.classxx is not None:2514 outfile.write(' class=%s' % (quote_attrib(self.classxx), ))2515 def exportChildren(self, outfile, level, namespace_='', name_='highlightType'):2516 for item_ in self.content_:2517 item_.export(outfile, level, item_.name, namespace_)2518 def hasContent_(self):2519 if (2520 self.sp is not None or2521 self.ref is not None2522 ):2523 return True2524 else:2525 return False2526 def build(self, node_):2527 attrs = node_.attributes2528 self.buildAttributes(attrs)2529 for child_ in node_.childNodes:2530 nodeName_ = child_.nodeName.split(':')[-1]2531 self.buildChildren(child_, nodeName_)2532 def buildAttributes(self, attrs):2533 if attrs.get('class'):2534 self.classxx = attrs.get('class').value2535 def buildChildren(self, child_, nodeName_):2536 if child_.nodeType == Node.ELEMENT_NODE and \2537 nodeName_ == 'sp':2538 value_ = []2539 for text_ in child_.childNodes:2540 value_.append(text_.nodeValue)2541 # We make this unicode so that our unicode renderer catch-all picks it up2542 # otherwise it would go through as 'str' and we'd have to pick it up too2543 valuestr_ = u' '2544 obj_ = self.mixedclass_(MixedContainer.CategorySimple,2545 MixedContainer.TypeString, 'sp', valuestr_)2546 self.content_.append(obj_)2547 elif child_.nodeType == Node.ELEMENT_NODE and \2548 nodeName_ == 'ref':2549 childobj_ = docRefTextType.factory()2550 childobj_.build(child_)2551 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2552 MixedContainer.TypeNone, 'ref', childobj_)2553 self.content_.append(obj_)2554 elif child_.nodeType == Node.TEXT_NODE:2555 obj_ = self.mixedclass_(MixedContainer.CategoryText,2556 MixedContainer.TypeNone, '', child_.nodeValue)2557 self.content_.append(obj_)2558# end class highlightType2559class sp(GeneratedsSuper):2560 subclass = None2561 superclass = None2562 def __init__(self, valueOf_=''):2563 self.valueOf_ = valueOf_2564 def factory(*args_, **kwargs_):2565 if sp.subclass:2566 return sp.subclass(*args_, **kwargs_)2567 else:2568 return sp(*args_, **kwargs_)2569 factory = staticmethod(factory)2570 def getValueOf_(self): return self.valueOf_2571 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2572 def export(self, outfile, level, namespace_='', name_='sp', namespacedef_=''):2573 showIndent(outfile, level)2574 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2575 self.exportAttributes(outfile, level, namespace_, name_='sp')2576 if self.hasContent_():2577 outfile.write('>\n')2578 self.exportChildren(outfile, level + 1, namespace_, name_)2579 showIndent(outfile, level)2580 outfile.write('</%s%s>\n' % (namespace_, name_))2581 else:2582 outfile.write(' />\n')2583 def exportAttributes(self, outfile, level, namespace_='', name_='sp'):2584 pass2585 def exportChildren(self, outfile, level, namespace_='', name_='sp'):2586 if self.valueOf_.find('![CDATA')>-1:2587 value=quote_xml('%s' % self.valueOf_)2588 value=value.replace('![CDATA','<![CDATA')2589 value=value.replace(']]',']]>')2590 outfile.write(value)2591 else:2592 outfile.write(quote_xml('%s' % self.valueOf_))2593 def hasContent_(self):2594 if (2595 self.valueOf_ is not None2596 ):2597 return True2598 else:2599 return False2600 def build(self, node_):2601 attrs = node_.attributes2602 self.buildAttributes(attrs)2603 self.valueOf_ = ''2604 for child_ in node_.childNodes:2605 nodeName_ = child_.nodeName.split(':')[-1]2606 self.buildChildren(child_, nodeName_)2607 def buildAttributes(self, attrs):2608 pass2609 def buildChildren(self, child_, nodeName_):2610 if child_.nodeType == Node.TEXT_NODE:2611 self.valueOf_ += child_.nodeValue2612 elif child_.nodeType == Node.CDATA_SECTION_NODE:2613 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2614# end class sp2615class referenceType(GeneratedsSuper):2616 subclass = None2617 superclass = None2618 def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):2619 self.endline = endline2620 self.startline = startline2621 self.refid = refid2622 self.compoundref = compoundref2623 if mixedclass_ is None:2624 self.mixedclass_ = MixedContainer2625 else:2626 self.mixedclass_ = mixedclass_2627 if content_ is None:2628 self.content_ = []2629 else:2630 self.content_ = content_2631 def factory(*args_, **kwargs_):2632 if referenceType.subclass:2633 return referenceType.subclass(*args_, **kwargs_)2634 else:2635 return referenceType(*args_, **kwargs_)2636 factory = staticmethod(factory)2637 def get_endline(self): return self.endline2638 def set_endline(self, endline): self.endline = endline2639 def get_startline(self): return self.startline2640 def set_startline(self, startline): self.startline = startline2641 def get_refid(self): return self.refid2642 def set_refid(self, refid): self.refid = refid2643 def get_compoundref(self): return self.compoundref2644 def set_compoundref(self, compoundref): self.compoundref = compoundref2645 def getValueOf_(self): return self.valueOf_2646 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2647 def export(self, outfile, level, namespace_='', name_='referenceType', namespacedef_=''):2648 showIndent(outfile, level)2649 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2650 self.exportAttributes(outfile, level, namespace_, name_='referenceType')2651 outfile.write('>')2652 self.exportChildren(outfile, level + 1, namespace_, name_)2653 outfile.write('</%s%s>\n' % (namespace_, name_))2654 def exportAttributes(self, outfile, level, namespace_='', name_='referenceType'):2655 if self.endline is not None:2656 outfile.write(' endline="%s"' % self.format_integer(self.endline, input_name='endline'))2657 if self.startline is not None:2658 outfile.write(' startline="%s"' % self.format_integer(self.startline, input_name='startline'))2659 if self.refid is not None:2660 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))2661 if self.compoundref is not None:2662 outfile.write(' compoundref=%s' % (self.format_string(quote_attrib(self.compoundref).encode(ExternalEncoding), input_name='compoundref'), ))2663 def exportChildren(self, outfile, level, namespace_='', name_='referenceType'):2664 if self.valueOf_.find('![CDATA')>-1:2665 value=quote_xml('%s' % self.valueOf_)2666 value=value.replace('![CDATA','<![CDATA')2667 value=value.replace(']]',']]>')2668 outfile.write(value)2669 else:2670 outfile.write(quote_xml('%s' % self.valueOf_))2671 def hasContent_(self):2672 if (2673 self.valueOf_ is not None2674 ):2675 return True2676 else:2677 return False2678 def build(self, node_):2679 attrs = node_.attributes2680 self.buildAttributes(attrs)2681 self.valueOf_ = ''2682 for child_ in node_.childNodes:2683 nodeName_ = child_.nodeName.split(':')[-1]2684 self.buildChildren(child_, nodeName_)2685 def buildAttributes(self, attrs):2686 if attrs.get('endline'):2687 try:2688 self.endline = int(attrs.get('endline').value)2689 except ValueError as exp:2690 raise ValueError('Bad integer attribute (endline): %s' % exp)2691 if attrs.get('startline'):2692 try:2693 self.startline = int(attrs.get('startline').value)2694 except ValueError as exp:2695 raise ValueError('Bad integer attribute (startline): %s' % exp)2696 if attrs.get('refid'):2697 self.refid = attrs.get('refid').value2698 if attrs.get('compoundref'):2699 self.compoundref = attrs.get('compoundref').value2700 def buildChildren(self, child_, nodeName_):2701 if child_.nodeType == Node.TEXT_NODE:2702 obj_ = self.mixedclass_(MixedContainer.CategoryText,2703 MixedContainer.TypeNone, '', child_.nodeValue)2704 self.content_.append(obj_)2705 if child_.nodeType == Node.TEXT_NODE:2706 self.valueOf_ += child_.nodeValue2707 elif child_.nodeType == Node.CDATA_SECTION_NODE:2708 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2709# end class referenceType2710class locationType(GeneratedsSuper):2711 subclass = None2712 superclass = None2713 def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):2714 self.bodystart = bodystart2715 self.line = line2716 self.bodyend = bodyend2717 self.bodyfile = bodyfile2718 self.file = file2719 self.valueOf_ = valueOf_2720 def factory(*args_, **kwargs_):2721 if locationType.subclass:2722 return locationType.subclass(*args_, **kwargs_)2723 else:2724 return locationType(*args_, **kwargs_)2725 factory = staticmethod(factory)2726 def get_bodystart(self): return self.bodystart2727 def set_bodystart(self, bodystart): self.bodystart = bodystart2728 def get_line(self): return self.line2729 def set_line(self, line): self.line = line2730 def get_bodyend(self): return self.bodyend2731 def set_bodyend(self, bodyend): self.bodyend = bodyend2732 def get_bodyfile(self): return self.bodyfile2733 def set_bodyfile(self, bodyfile): self.bodyfile = bodyfile2734 def get_file(self): return self.file2735 def set_file(self, file): self.file = file2736 def getValueOf_(self): return self.valueOf_2737 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2738 def export(self, outfile, level, namespace_='', name_='locationType', namespacedef_=''):2739 showIndent(outfile, level)2740 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2741 self.exportAttributes(outfile, level, namespace_, name_='locationType')2742 if self.hasContent_():2743 outfile.write('>\n')2744 self.exportChildren(outfile, level + 1, namespace_, name_)2745 showIndent(outfile, level)2746 outfile.write('</%s%s>\n' % (namespace_, name_))2747 else:2748 outfile.write(' />\n')2749 def exportAttributes(self, outfile, level, namespace_='', name_='locationType'):2750 if self.bodystart is not None:2751 outfile.write(' bodystart="%s"' % self.format_integer(self.bodystart, input_name='bodystart'))2752 if self.line is not None:2753 outfile.write(' line="%s"' % self.format_integer(self.line, input_name='line'))2754 if self.bodyend is not None:2755 outfile.write(' bodyend="%s"' % self.format_integer(self.bodyend, input_name='bodyend'))2756 if self.bodyfile is not None:2757 outfile.write(' bodyfile=%s' % (self.format_string(quote_attrib(self.bodyfile).encode(ExternalEncoding), input_name='bodyfile'), ))2758 if self.file is not None:2759 outfile.write(' file=%s' % (self.format_string(quote_attrib(self.file).encode(ExternalEncoding), input_name='file'), ))2760 def exportChildren(self, outfile, level, namespace_='', name_='locationType'):2761 if self.valueOf_.find('![CDATA')>-1:2762 value=quote_xml('%s' % self.valueOf_)2763 value=value.replace('![CDATA','<![CDATA')2764 value=value.replace(']]',']]>')2765 outfile.write(value)2766 else:2767 outfile.write(quote_xml('%s' % self.valueOf_))2768 def hasContent_(self):2769 if (2770 self.valueOf_ is not None2771 ):2772 return True2773 else:2774 return False2775 def build(self, node_):2776 attrs = node_.attributes2777 self.buildAttributes(attrs)2778 self.valueOf_ = ''2779 for child_ in node_.childNodes:2780 nodeName_ = child_.nodeName.split(':')[-1]2781 self.buildChildren(child_, nodeName_)2782 def buildAttributes(self, attrs):2783 if attrs.get('bodystart'):2784 try:2785 self.bodystart = int(attrs.get('bodystart').value)2786 except ValueError as exp:2787 raise ValueError('Bad integer attribute (bodystart): %s' % exp)2788 if attrs.get('line'):2789 try:2790 self.line = int(attrs.get('line').value)2791 except ValueError as exp:2792 raise ValueError('Bad integer attribute (line): %s' % exp)2793 if attrs.get('bodyend'):2794 try:2795 self.bodyend = int(attrs.get('bodyend').value)2796 except ValueError as exp:2797 raise ValueError('Bad integer attribute (bodyend): %s' % exp)2798 if attrs.get('bodyfile'):2799 self.bodyfile = attrs.get('bodyfile').value2800 if attrs.get('file'):2801 self.file = attrs.get('file').value2802 def buildChildren(self, child_, nodeName_):2803 if child_.nodeType == Node.TEXT_NODE:2804 self.valueOf_ += child_.nodeValue2805 elif child_.nodeType == Node.CDATA_SECTION_NODE:2806 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2807# end class locationType2808class docSect1Type(GeneratedsSuper):2809 subclass = None2810 superclass = None2811 def __init__(self, id=None, title=None, para=None, sect2=None, internal=None, mixedclass_=None, content_=None):2812 self.id = id2813 if mixedclass_ is None:2814 self.mixedclass_ = MixedContainer2815 else:2816 self.mixedclass_ = mixedclass_2817 if content_ is None:2818 self.content_ = []2819 else:2820 self.content_ = content_2821 if title is None:2822 self.title = ""2823 else:2824 self.title = title2825 def factory(*args_, **kwargs_):2826 if docSect1Type.subclass:2827 return docSect1Type.subclass(*args_, **kwargs_)2828 else:2829 return docSect1Type(*args_, **kwargs_)2830 factory = staticmethod(factory)2831 def get_title(self): return self.title2832 def set_title(self, title): self.title = title2833 def get_para(self): return self.para2834 def set_para(self, para): self.para = para2835 def add_para(self, value): self.para.append(value)2836 def insert_para(self, index, value): self.para[index] = value2837 def get_sect2(self): return self.sect22838 def set_sect2(self, sect2): self.sect2 = sect22839 def add_sect2(self, value): self.sect2.append(value)2840 def insert_sect2(self, index, value): self.sect2[index] = value2841 def get_internal(self): return self.internal2842 def set_internal(self, internal): self.internal = internal2843 def get_id(self): return self.id2844 def set_id(self, id): self.id = id2845 def export(self, outfile, level, namespace_='', name_='docSect1Type', namespacedef_=''):2846 showIndent(outfile, level)2847 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2848 self.exportAttributes(outfile, level, namespace_, name_='docSect1Type')2849 outfile.write('>')2850 self.exportChildren(outfile, level + 1, namespace_, name_)2851 outfile.write('</%s%s>\n' % (namespace_, name_))2852 def exportAttributes(self, outfile, level, namespace_='', name_='docSect1Type'):2853 if self.id is not None:2854 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))2855 def exportChildren(self, outfile, level, namespace_='', name_='docSect1Type'):2856 for item_ in self.content_:2857 item_.export(outfile, level, item_.name, namespace_)2858 def hasContent_(self):2859 if (2860 self.title is not None or2861 self.para is not None or2862 self.sect2 is not None or2863 self.internal is not None2864 ):2865 return True2866 else:2867 return False2868 def build(self, node_):2869 attrs = node_.attributes2870 self.buildAttributes(attrs)2871 for child_ in node_.childNodes:2872 nodeName_ = child_.nodeName.split(':')[-1]2873 self.buildChildren(child_, nodeName_)2874 def buildAttributes(self, attrs):2875 if attrs.get('id'):2876 self.id = attrs.get('id').value2877 def buildChildren(self, child_, nodeName_):2878 if child_.nodeType == Node.ELEMENT_NODE and \2879 nodeName_ == 'title':2880 self.title = child_.childNodes[0].nodeValue2881 elif child_.nodeType == Node.ELEMENT_NODE and \2882 nodeName_ == 'para':2883 childobj_ = docParaType.factory()2884 childobj_.build(child_)2885 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2886 MixedContainer.TypeNone, 'para', childobj_)2887 self.content_.append(obj_)2888 elif child_.nodeType == Node.ELEMENT_NODE and \2889 nodeName_ == 'sect2':2890 childobj_ = docSect2Type.factory()2891 childobj_.build(child_)2892 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2893 MixedContainer.TypeNone, 'sect2', childobj_)2894 self.content_.append(obj_)2895 elif child_.nodeType == Node.ELEMENT_NODE and \2896 nodeName_ == 'internal':2897 childobj_ = docInternalS1Type.factory()2898 childobj_.build(child_)2899 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2900 MixedContainer.TypeNone, 'internal', childobj_)2901 self.content_.append(obj_)2902 elif child_.nodeType == Node.TEXT_NODE:2903 obj_ = self.mixedclass_(MixedContainer.CategoryText,2904 MixedContainer.TypeNone, '', child_.nodeValue)2905 self.content_.append(obj_)2906# end class docSect1Type2907class docSect2Type(GeneratedsSuper):2908 subclass = None2909 superclass = None2910 def __init__(self, id=None, title=None, para=None, sect3=None, internal=None, mixedclass_=None, content_=None):2911 self.id = id2912 if mixedclass_ is None:2913 self.mixedclass_ = MixedContainer2914 else:2915 self.mixedclass_ = mixedclass_2916 if content_ is None:2917 self.content_ = []2918 else:2919 self.content_ = content_2920 if title is None:2921 title = ""2922 else:2923 title = title2924 def factory(*args_, **kwargs_):2925 if docSect2Type.subclass:2926 return docSect2Type.subclass(*args_, **kwargs_)2927 else:2928 return docSect2Type(*args_, **kwargs_)2929 factory = staticmethod(factory)2930 def get_title(self): return self.title2931 def set_title(self, title): self.title = title2932 def get_para(self): return self.para2933 def set_para(self, para): self.para = para2934 def add_para(self, value): self.para.append(value)2935 def insert_para(self, index, value): self.para[index] = value2936 def get_sect3(self): return self.sect32937 def set_sect3(self, sect3): self.sect3 = sect32938 def add_sect3(self, value): self.sect3.append(value)2939 def insert_sect3(self, index, value): self.sect3[index] = value2940 def get_internal(self): return self.internal2941 def set_internal(self, internal): self.internal = internal2942 def get_id(self): return self.id2943 def set_id(self, id): self.id = id2944 def export(self, outfile, level, namespace_='', name_='docSect2Type', namespacedef_=''):2945 showIndent(outfile, level)2946 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2947 self.exportAttributes(outfile, level, namespace_, name_='docSect2Type')2948 outfile.write('>')2949 self.exportChildren(outfile, level + 1, namespace_, name_)2950 outfile.write('</%s%s>\n' % (namespace_, name_))2951 def exportAttributes(self, outfile, level, namespace_='', name_='docSect2Type'):2952 if self.id is not None:2953 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))2954 def exportChildren(self, outfile, level, namespace_='', name_='docSect2Type'):2955 for item_ in self.content_:2956 item_.export(outfile, level, item_.name, namespace_)2957 def hasContent_(self):2958 if (2959 self.title is not None or2960 self.para is not None or2961 self.sect3 is not None or2962 self.internal is not None2963 ):2964 return True2965 else:2966 return False2967 def build(self, node_):2968 attrs = node_.attributes2969 self.buildAttributes(attrs)2970 for child_ in node_.childNodes:2971 nodeName_ = child_.nodeName.split(':')[-1]2972 self.buildChildren(child_, nodeName_)2973 def buildAttributes(self, attrs):2974 if attrs.get('id'):2975 self.id = attrs.get('id').value2976 def buildChildren(self, child_, nodeName_):2977 if child_.nodeType == Node.ELEMENT_NODE and \2978 nodeName_ == 'title':2979 self.title = child_.childNodes[0].nodeValue2980 elif child_.nodeType == Node.ELEMENT_NODE and \2981 nodeName_ == 'para':2982 childobj_ = docParaType.factory()2983 childobj_.build(child_)2984 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2985 MixedContainer.TypeNone, 'para', childobj_)2986 self.content_.append(obj_)2987 elif child_.nodeType == Node.ELEMENT_NODE and \2988 nodeName_ == 'sect3':2989 childobj_ = docSect3Type.factory()2990 childobj_.build(child_)2991 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2992 MixedContainer.TypeNone, 'sect3', childobj_)2993 self.content_.append(obj_)2994 elif child_.nodeType == Node.ELEMENT_NODE and \2995 nodeName_ == 'internal':2996 childobj_ = docInternalS2Type.factory()2997 childobj_.build(child_)2998 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2999 MixedContainer.TypeNone, 'internal', childobj_)3000 self.content_.append(obj_)3001 elif child_.nodeType == Node.TEXT_NODE:3002 obj_ = self.mixedclass_(MixedContainer.CategoryText,3003 MixedContainer.TypeNone, '', child_.nodeValue)3004 self.content_.append(obj_)3005# end class docSect2Type3006class docSect3Type(GeneratedsSuper):3007 subclass = None3008 superclass = None3009 def __init__(self, id=None, title=None, para=None, sect4=None, internal=None, mixedclass_=None, content_=None):3010 self.id = id3011 if mixedclass_ is None:3012 self.mixedclass_ = MixedContainer3013 else:3014 self.mixedclass_ = mixedclass_3015 if content_ is None:3016 self.content_ = []3017 else:3018 self.content_ = content_3019 if title is None:3020 self.title = ""3021 else:3022 self.title = title3023 def factory(*args_, **kwargs_):3024 if docSect3Type.subclass:3025 return docSect3Type.subclass(*args_, **kwargs_)3026 else:3027 return docSect3Type(*args_, **kwargs_)3028 factory = staticmethod(factory)3029 def get_title(self): return self.title3030 def set_title(self, title): self.title = title3031 def get_para(self): return self.para3032 def set_para(self, para): self.para = para3033 def add_para(self, value): self.para.append(value)3034 def insert_para(self, index, value): self.para[index] = value3035 def get_sect4(self): return self.sect43036 def set_sect4(self, sect4): self.sect4 = sect43037 def add_sect4(self, value): self.sect4.append(value)3038 def insert_sect4(self, index, value): self.sect4[index] = value3039 def get_internal(self): return self.internal3040 def set_internal(self, internal): self.internal = internal3041 def get_id(self): return self.id3042 def set_id(self, id): self.id = id3043 def export(self, outfile, level, namespace_='', name_='docSect3Type', namespacedef_=''):3044 showIndent(outfile, level)3045 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3046 self.exportAttributes(outfile, level, namespace_, name_='docSect3Type')3047 outfile.write('>')3048 self.exportChildren(outfile, level + 1, namespace_, name_)3049 outfile.write('</%s%s>\n' % (namespace_, name_))3050 def exportAttributes(self, outfile, level, namespace_='', name_='docSect3Type'):3051 if self.id is not None:3052 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3053 def exportChildren(self, outfile, level, namespace_='', name_='docSect3Type'):3054 for item_ in self.content_:3055 item_.export(outfile, level, item_.name, namespace_)3056 def hasContent_(self):3057 if (3058 self.title is not None or3059 self.para is not None or3060 self.sect4 is not None or3061 self.internal is not None3062 ):3063 return True3064 else:3065 return False3066 def build(self, node_):3067 attrs = node_.attributes3068 self.buildAttributes(attrs)3069 for child_ in node_.childNodes:3070 nodeName_ = child_.nodeName.split(':')[-1]3071 self.buildChildren(child_, nodeName_)3072 def buildAttributes(self, attrs):3073 if attrs.get('id'):3074 self.id = attrs.get('id').value3075 def buildChildren(self, child_, nodeName_):3076 if child_.nodeType == Node.ELEMENT_NODE and \3077 nodeName_ == 'title':3078 self.title = child_.childNodes[0].nodeValue3079 elif child_.nodeType == Node.ELEMENT_NODE and \3080 nodeName_ == 'para':3081 childobj_ = docParaType.factory()3082 childobj_.build(child_)3083 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3084 MixedContainer.TypeNone, 'para', childobj_)3085 self.content_.append(obj_)3086 elif child_.nodeType == Node.ELEMENT_NODE and \3087 nodeName_ == 'sect4':3088 childobj_ = docSect4Type.factory()3089 childobj_.build(child_)3090 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3091 MixedContainer.TypeNone, 'sect4', childobj_)3092 self.content_.append(obj_)3093 elif child_.nodeType == Node.ELEMENT_NODE and \3094 nodeName_ == 'internal':3095 childobj_ = docInternalS3Type.factory()3096 childobj_.build(child_)3097 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3098 MixedContainer.TypeNone, 'internal', childobj_)3099 self.content_.append(obj_)3100 elif child_.nodeType == Node.TEXT_NODE:3101 obj_ = self.mixedclass_(MixedContainer.CategoryText,3102 MixedContainer.TypeNone, '', child_.nodeValue)3103 self.content_.append(obj_)3104# end class docSect3Type3105class docSect4Type(GeneratedsSuper):3106 subclass = None3107 superclass = None3108 def __init__(self, id=None, title=None, para=None, internal=None, mixedclass_=None, content_=None):3109 self.id = id3110 if mixedclass_ is None:3111 self.mixedclass_ = MixedContainer3112 else:3113 self.mixedclass_ = mixedclass_3114 if content_ is None:3115 self.content_ = []3116 else:3117 self.content_ = content_3118 def factory(*args_, **kwargs_):3119 if docSect4Type.subclass:3120 return docSect4Type.subclass(*args_, **kwargs_)3121 else:3122 return docSect4Type(*args_, **kwargs_)3123 factory = staticmethod(factory)3124 def get_title(self): return self.title3125 def set_title(self, title): self.title = title3126 def get_para(self): return self.para3127 def set_para(self, para): self.para = para3128 def add_para(self, value): self.para.append(value)3129 def insert_para(self, index, value): self.para[index] = value3130 def get_internal(self): return self.internal3131 def set_internal(self, internal): self.internal = internal3132 def get_id(self): return self.id3133 def set_id(self, id): self.id = id3134 def export(self, outfile, level, namespace_='', name_='docSect4Type', namespacedef_=''):3135 showIndent(outfile, level)3136 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3137 self.exportAttributes(outfile, level, namespace_, name_='docSect4Type')3138 outfile.write('>')3139 self.exportChildren(outfile, level + 1, namespace_, name_)3140 outfile.write('</%s%s>\n' % (namespace_, name_))3141 def exportAttributes(self, outfile, level, namespace_='', name_='docSect4Type'):3142 if self.id is not None:3143 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3144 def exportChildren(self, outfile, level, namespace_='', name_='docSect4Type'):3145 for item_ in self.content_:3146 item_.export(outfile, level, item_.name, namespace_)3147 def hasContent_(self):3148 if (3149 self.title is not None or3150 self.para is not None or3151 self.internal is not None3152 ):3153 return True3154 else:3155 return False3156 def build(self, node_):3157 attrs = node_.attributes3158 self.buildAttributes(attrs)3159 for child_ in node_.childNodes:3160 nodeName_ = child_.nodeName.split(':')[-1]3161 self.buildChildren(child_, nodeName_)3162 def buildAttributes(self, attrs):3163 if attrs.get('id'):3164 self.id = attrs.get('id').value3165 def buildChildren(self, child_, nodeName_):3166 if child_.nodeType == Node.ELEMENT_NODE and \3167 nodeName_ == 'title':3168 childobj_ = docTitleType.factory()3169 childobj_.build(child_)3170 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3171 MixedContainer.TypeNone, 'title', childobj_)3172 self.content_.append(obj_)3173 elif child_.nodeType == Node.ELEMENT_NODE and \3174 nodeName_ == 'para':3175 childobj_ = docParaType.factory()3176 childobj_.build(child_)3177 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3178 MixedContainer.TypeNone, 'para', childobj_)3179 self.content_.append(obj_)3180 elif child_.nodeType == Node.ELEMENT_NODE and \3181 nodeName_ == 'internal':3182 childobj_ = docInternalS4Type.factory()3183 childobj_.build(child_)3184 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3185 MixedContainer.TypeNone, 'internal', childobj_)3186 self.content_.append(obj_)3187 elif child_.nodeType == Node.TEXT_NODE:3188 obj_ = self.mixedclass_(MixedContainer.CategoryText,3189 MixedContainer.TypeNone, '', child_.nodeValue)3190 self.content_.append(obj_)3191# end class docSect4Type3192class docInternalType(GeneratedsSuper):3193 subclass = None3194 superclass = None3195 def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):3196 if mixedclass_ is None:3197 self.mixedclass_ = MixedContainer3198 else:3199 self.mixedclass_ = mixedclass_3200 if content_ is None:3201 self.content_ = []3202 else:3203 self.content_ = content_3204 def factory(*args_, **kwargs_):3205 if docInternalType.subclass:3206 return docInternalType.subclass(*args_, **kwargs_)3207 else:3208 return docInternalType(*args_, **kwargs_)3209 factory = staticmethod(factory)3210 def get_para(self): return self.para3211 def set_para(self, para): self.para = para3212 def add_para(self, value): self.para.append(value)3213 def insert_para(self, index, value): self.para[index] = value3214 def get_sect1(self): return self.sect13215 def set_sect1(self, sect1): self.sect1 = sect13216 def add_sect1(self, value): self.sect1.append(value)3217 def insert_sect1(self, index, value): self.sect1[index] = value3218 def export(self, outfile, level, namespace_='', name_='docInternalType', namespacedef_=''):3219 showIndent(outfile, level)3220 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3221 self.exportAttributes(outfile, level, namespace_, name_='docInternalType')3222 outfile.write('>')3223 self.exportChildren(outfile, level + 1, namespace_, name_)3224 outfile.write('</%s%s>\n' % (namespace_, name_))3225 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalType'):3226 pass3227 def exportChildren(self, outfile, level, namespace_='', name_='docInternalType'):3228 for item_ in self.content_:3229 item_.export(outfile, level, item_.name, namespace_)3230 def hasContent_(self):3231 if (3232 self.para is not None or3233 self.sect1 is not None3234 ):3235 return True3236 else:3237 return False3238 def build(self, node_):3239 attrs = node_.attributes3240 self.buildAttributes(attrs)3241 for child_ in node_.childNodes:3242 nodeName_ = child_.nodeName.split(':')[-1]3243 self.buildChildren(child_, nodeName_)3244 def buildAttributes(self, attrs):3245 pass3246 def buildChildren(self, child_, nodeName_):3247 if child_.nodeType == Node.ELEMENT_NODE and \3248 nodeName_ == 'para':3249 childobj_ = docParaType.factory()3250 childobj_.build(child_)3251 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3252 MixedContainer.TypeNone, 'para', childobj_)3253 self.content_.append(obj_)3254 elif child_.nodeType == Node.ELEMENT_NODE and \3255 nodeName_ == 'sect1':3256 childobj_ = docSect1Type.factory()3257 childobj_.build(child_)3258 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3259 MixedContainer.TypeNone, 'sect1', childobj_)3260 self.content_.append(obj_)3261 elif child_.nodeType == Node.TEXT_NODE:3262 obj_ = self.mixedclass_(MixedContainer.CategoryText,3263 MixedContainer.TypeNone, '', child_.nodeValue)3264 self.content_.append(obj_)3265# end class docInternalType3266class docInternalS1Type(GeneratedsSuper):3267 subclass = None3268 superclass = None3269 def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):3270 if mixedclass_ is None:3271 self.mixedclass_ = MixedContainer3272 else:3273 self.mixedclass_ = mixedclass_3274 if content_ is None:3275 self.content_ = []3276 else:3277 self.content_ = content_3278 def factory(*args_, **kwargs_):3279 if docInternalS1Type.subclass:3280 return docInternalS1Type.subclass(*args_, **kwargs_)3281 else:3282 return docInternalS1Type(*args_, **kwargs_)3283 factory = staticmethod(factory)3284 def get_para(self): return self.para3285 def set_para(self, para): self.para = para3286 def add_para(self, value): self.para.append(value)3287 def insert_para(self, index, value): self.para[index] = value3288 def get_sect2(self): return self.sect23289 def set_sect2(self, sect2): self.sect2 = sect23290 def add_sect2(self, value): self.sect2.append(value)3291 def insert_sect2(self, index, value): self.sect2[index] = value3292 def export(self, outfile, level, namespace_='', name_='docInternalS1Type', namespacedef_=''):3293 showIndent(outfile, level)3294 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3295 self.exportAttributes(outfile, level, namespace_, name_='docInternalS1Type')3296 outfile.write('>')3297 self.exportChildren(outfile, level + 1, namespace_, name_)3298 outfile.write('</%s%s>\n' % (namespace_, name_))3299 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS1Type'):3300 pass3301 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS1Type'):3302 for item_ in self.content_:3303 item_.export(outfile, level, item_.name, namespace_)3304 def hasContent_(self):3305 if (3306 self.para is not None or3307 self.sect2 is not None3308 ):3309 return True3310 else:3311 return False3312 def build(self, node_):3313 attrs = node_.attributes3314 self.buildAttributes(attrs)3315 for child_ in node_.childNodes:3316 nodeName_ = child_.nodeName.split(':')[-1]3317 self.buildChildren(child_, nodeName_)3318 def buildAttributes(self, attrs):3319 pass3320 def buildChildren(self, child_, nodeName_):3321 if child_.nodeType == Node.ELEMENT_NODE and \3322 nodeName_ == 'para':3323 childobj_ = docParaType.factory()3324 childobj_.build(child_)3325 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3326 MixedContainer.TypeNone, 'para', childobj_)3327 self.content_.append(obj_)3328 elif child_.nodeType == Node.ELEMENT_NODE and \3329 nodeName_ == 'sect2':3330 childobj_ = docSect2Type.factory()3331 childobj_.build(child_)3332 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3333 MixedContainer.TypeNone, 'sect2', childobj_)3334 self.content_.append(obj_)3335 elif child_.nodeType == Node.TEXT_NODE:3336 obj_ = self.mixedclass_(MixedContainer.CategoryText,3337 MixedContainer.TypeNone, '', child_.nodeValue)3338 self.content_.append(obj_)3339# end class docInternalS1Type3340class docInternalS2Type(GeneratedsSuper):3341 subclass = None3342 superclass = None3343 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):3344 if mixedclass_ is None:3345 self.mixedclass_ = MixedContainer3346 else:3347 self.mixedclass_ = mixedclass_3348 if content_ is None:3349 self.content_ = []3350 else:3351 self.content_ = content_3352 def factory(*args_, **kwargs_):3353 if docInternalS2Type.subclass:3354 return docInternalS2Type.subclass(*args_, **kwargs_)3355 else:3356 return docInternalS2Type(*args_, **kwargs_)3357 factory = staticmethod(factory)3358 def get_para(self): return self.para3359 def set_para(self, para): self.para = para3360 def add_para(self, value): self.para.append(value)3361 def insert_para(self, index, value): self.para[index] = value3362 def get_sect3(self): return self.sect33363 def set_sect3(self, sect3): self.sect3 = sect33364 def add_sect3(self, value): self.sect3.append(value)3365 def insert_sect3(self, index, value): self.sect3[index] = value3366 def export(self, outfile, level, namespace_='', name_='docInternalS2Type', namespacedef_=''):3367 showIndent(outfile, level)3368 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3369 self.exportAttributes(outfile, level, namespace_, name_='docInternalS2Type')3370 outfile.write('>')3371 self.exportChildren(outfile, level + 1, namespace_, name_)3372 outfile.write('</%s%s>\n' % (namespace_, name_))3373 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS2Type'):3374 pass3375 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS2Type'):3376 for item_ in self.content_:3377 item_.export(outfile, level, item_.name, namespace_)3378 def hasContent_(self):3379 if (3380 self.para is not None or3381 self.sect3 is not None3382 ):3383 return True3384 else:3385 return False3386 def build(self, node_):3387 attrs = node_.attributes3388 self.buildAttributes(attrs)3389 for child_ in node_.childNodes:3390 nodeName_ = child_.nodeName.split(':')[-1]3391 self.buildChildren(child_, nodeName_)3392 def buildAttributes(self, attrs):3393 pass3394 def buildChildren(self, child_, nodeName_):3395 if child_.nodeType == Node.ELEMENT_NODE and \3396 nodeName_ == 'para':3397 childobj_ = docParaType.factory()3398 childobj_.build(child_)3399 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3400 MixedContainer.TypeNone, 'para', childobj_)3401 self.content_.append(obj_)3402 elif child_.nodeType == Node.ELEMENT_NODE and \3403 nodeName_ == 'sect3':3404 childobj_ = docSect3Type.factory()3405 childobj_.build(child_)3406 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3407 MixedContainer.TypeNone, 'sect3', childobj_)3408 self.content_.append(obj_)3409 elif child_.nodeType == Node.TEXT_NODE:3410 obj_ = self.mixedclass_(MixedContainer.CategoryText,3411 MixedContainer.TypeNone, '', child_.nodeValue)3412 self.content_.append(obj_)3413# end class docInternalS2Type3414class docInternalS3Type(GeneratedsSuper):3415 subclass = None3416 superclass = None3417 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):3418 if mixedclass_ is None:3419 self.mixedclass_ = MixedContainer3420 else:3421 self.mixedclass_ = mixedclass_3422 if content_ is None:3423 self.content_ = []3424 else:3425 self.content_ = content_3426 def factory(*args_, **kwargs_):3427 if docInternalS3Type.subclass:3428 return docInternalS3Type.subclass(*args_, **kwargs_)3429 else:3430 return docInternalS3Type(*args_, **kwargs_)3431 factory = staticmethod(factory)3432 def get_para(self): return self.para3433 def set_para(self, para): self.para = para3434 def add_para(self, value): self.para.append(value)3435 def insert_para(self, index, value): self.para[index] = value3436 def get_sect3(self): return self.sect33437 def set_sect3(self, sect3): self.sect3 = sect33438 def add_sect3(self, value): self.sect3.append(value)3439 def insert_sect3(self, index, value): self.sect3[index] = value3440 def export(self, outfile, level, namespace_='', name_='docInternalS3Type', namespacedef_=''):3441 showIndent(outfile, level)3442 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3443 self.exportAttributes(outfile, level, namespace_, name_='docInternalS3Type')3444 outfile.write('>')3445 self.exportChildren(outfile, level + 1, namespace_, name_)3446 outfile.write('</%s%s>\n' % (namespace_, name_))3447 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS3Type'):3448 pass3449 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS3Type'):3450 for item_ in self.content_:3451 item_.export(outfile, level, item_.name, namespace_)3452 def hasContent_(self):3453 if (3454 self.para is not None or3455 self.sect3 is not None3456 ):3457 return True3458 else:3459 return False3460 def build(self, node_):3461 attrs = node_.attributes3462 self.buildAttributes(attrs)3463 for child_ in node_.childNodes:3464 nodeName_ = child_.nodeName.split(':')[-1]3465 self.buildChildren(child_, nodeName_)3466 def buildAttributes(self, attrs):3467 pass3468 def buildChildren(self, child_, nodeName_):3469 if child_.nodeType == Node.ELEMENT_NODE and \3470 nodeName_ == 'para':3471 childobj_ = docParaType.factory()3472 childobj_.build(child_)3473 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3474 MixedContainer.TypeNone, 'para', childobj_)3475 self.content_.append(obj_)3476 elif child_.nodeType == Node.ELEMENT_NODE and \3477 nodeName_ == 'sect3':3478 childobj_ = docSect4Type.factory()3479 childobj_.build(child_)3480 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3481 MixedContainer.TypeNone, 'sect3', childobj_)3482 self.content_.append(obj_)3483 elif child_.nodeType == Node.TEXT_NODE:3484 obj_ = self.mixedclass_(MixedContainer.CategoryText,3485 MixedContainer.TypeNone, '', child_.nodeValue)3486 self.content_.append(obj_)3487# end class docInternalS3Type3488class docInternalS4Type(GeneratedsSuper):3489 subclass = None3490 superclass = None3491 def __init__(self, para=None, mixedclass_=None, content_=None):3492 if mixedclass_ is None:3493 self.mixedclass_ = MixedContainer3494 else:3495 self.mixedclass_ = mixedclass_3496 if content_ is None:3497 self.content_ = []3498 else:3499 self.content_ = content_3500 def factory(*args_, **kwargs_):3501 if docInternalS4Type.subclass:3502 return docInternalS4Type.subclass(*args_, **kwargs_)3503 else:3504 return docInternalS4Type(*args_, **kwargs_)3505 factory = staticmethod(factory)3506 def get_para(self): return self.para3507 def set_para(self, para): self.para = para3508 def add_para(self, value): self.para.append(value)3509 def insert_para(self, index, value): self.para[index] = value3510 def export(self, outfile, level, namespace_='', name_='docInternalS4Type', namespacedef_=''):3511 showIndent(outfile, level)3512 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3513 self.exportAttributes(outfile, level, namespace_, name_='docInternalS4Type')3514 outfile.write('>')3515 self.exportChildren(outfile, level + 1, namespace_, name_)3516 outfile.write('</%s%s>\n' % (namespace_, name_))3517 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS4Type'):3518 pass3519 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS4Type'):3520 for item_ in self.content_:3521 item_.export(outfile, level, item_.name, namespace_)3522 def hasContent_(self):3523 if (3524 self.para is not None3525 ):3526 return True3527 else:3528 return False3529 def build(self, node_):3530 attrs = node_.attributes3531 self.buildAttributes(attrs)3532 for child_ in node_.childNodes:3533 nodeName_ = child_.nodeName.split(':')[-1]3534 self.buildChildren(child_, nodeName_)3535 def buildAttributes(self, attrs):3536 pass3537 def buildChildren(self, child_, nodeName_):3538 if child_.nodeType == Node.ELEMENT_NODE and \3539 nodeName_ == 'para':3540 childobj_ = docParaType.factory()3541 childobj_.build(child_)3542 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3543 MixedContainer.TypeNone, 'para', childobj_)3544 self.content_.append(obj_)3545 elif child_.nodeType == Node.TEXT_NODE:3546 obj_ = self.mixedclass_(MixedContainer.CategoryText,3547 MixedContainer.TypeNone, '', child_.nodeValue)3548 self.content_.append(obj_)3549# end class docInternalS4Type3550class docTitleType(GeneratedsSuper):3551 subclass = None3552 superclass = None3553 def __init__(self, valueOf_='', mixedclass_=None, content_=None):3554 if mixedclass_ is None:3555 self.mixedclass_ = MixedContainer3556 else:3557 self.mixedclass_ = mixedclass_3558 if content_ is None:3559 self.content_ = []3560 else:3561 self.content_ = content_3562 def factory(*args_, **kwargs_):3563 if docTitleType.subclass:3564 return docTitleType.subclass(*args_, **kwargs_)3565 else:3566 return docTitleType(*args_, **kwargs_)3567 factory = staticmethod(factory)3568 def getValueOf_(self): return self.valueOf_3569 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3570 def export(self, outfile, level, namespace_='', name_='docTitleType', namespacedef_=''):3571 showIndent(outfile, level)3572 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3573 self.exportAttributes(outfile, level, namespace_, name_='docTitleType')3574 outfile.write('>')3575 self.exportChildren(outfile, level + 1, namespace_, name_)3576 outfile.write('</%s%s>\n' % (namespace_, name_))3577 def exportAttributes(self, outfile, level, namespace_='', name_='docTitleType'):3578 pass3579 def exportChildren(self, outfile, level, namespace_='', name_='docTitleType'):3580 if self.valueOf_.find('![CDATA')>-1:3581 value=quote_xml('%s' % self.valueOf_)3582 value=value.replace('![CDATA','<![CDATA')3583 value=value.replace(']]',']]>')3584 outfile.write(value)3585 else:3586 outfile.write(quote_xml('%s' % self.valueOf_))3587 def hasContent_(self):3588 if (3589 self.valueOf_ is not None3590 ):3591 return True3592 else:3593 return False3594 def build(self, node_):3595 attrs = node_.attributes3596 self.buildAttributes(attrs)3597 self.valueOf_ = ''3598 for child_ in node_.childNodes:3599 nodeName_ = child_.nodeName.split(':')[-1]3600 self.buildChildren(child_, nodeName_)3601 def buildAttributes(self, attrs):3602 pass3603 def buildChildren(self, child_, nodeName_):3604 if child_.nodeType == Node.TEXT_NODE:3605 obj_ = self.mixedclass_(MixedContainer.CategoryText,3606 MixedContainer.TypeNone, '', child_.nodeValue)3607 self.content_.append(obj_)3608 if child_.nodeType == Node.TEXT_NODE:3609 self.valueOf_ += child_.nodeValue3610 elif child_.nodeType == Node.CDATA_SECTION_NODE:3611 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3612# end class docTitleType3613class docParaType(GeneratedsSuper):3614 subclass = None3615 superclass = None3616 def __init__(self, valueOf_='', mixedclass_=None, content_=None):3617 if mixedclass_ is None:3618 self.mixedclass_ = MixedContainer3619 else:3620 self.mixedclass_ = mixedclass_3621 if content_ is None:3622 self.content_ = []3623 else:3624 self.content_ = content_3625 def factory(*args_, **kwargs_):3626 if docParaType.subclass:3627 return docParaType.subclass(*args_, **kwargs_)3628 else:3629 return docParaType(*args_, **kwargs_)3630 factory = staticmethod(factory)3631 def getValueOf_(self): return self.valueOf_3632 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3633 def export(self, outfile, level, namespace_='', name_='docParaType', namespacedef_=''):3634 showIndent(outfile, level)3635 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3636 self.exportAttributes(outfile, level, namespace_, name_='docParaType')3637 outfile.write('>')3638 self.exportChildren(outfile, level + 1, namespace_, name_)3639 outfile.write('</%s%s>\n' % (namespace_, name_))3640 def exportAttributes(self, outfile, level, namespace_='', name_='docParaType'):3641 pass3642 def exportChildren(self, outfile, level, namespace_='', name_='docParaType'):3643 if self.valueOf_.find('![CDATA')>-1:3644 value=quote_xml('%s' % self.valueOf_)3645 value=value.replace('![CDATA','<![CDATA')3646 value=value.replace(']]',']]>')3647 outfile.write(value)3648 else:3649 outfile.write(quote_xml('%s' % self.valueOf_))3650 def hasContent_(self):3651 if (3652 self.valueOf_ is not None3653 ):3654 return True3655 else:3656 return False3657 def build(self, node_):3658 attrs = node_.attributes3659 self.buildAttributes(attrs)3660 self.valueOf_ = ''3661 for child_ in node_.childNodes:3662 nodeName_ = child_.nodeName.split(':')[-1]3663 self.buildChildren(child_, nodeName_)3664 def buildAttributes(self, attrs):3665 pass3666 def buildChildren(self, child_, nodeName_):3667 if child_.nodeType == Node.TEXT_NODE:3668 obj_ = self.mixedclass_(MixedContainer.CategoryText,3669 MixedContainer.TypeNone, '', child_.nodeValue)3670 self.content_.append(obj_)3671 if child_.nodeType == Node.TEXT_NODE:3672 self.valueOf_ += child_.nodeValue3673 elif child_.nodeType == Node.CDATA_SECTION_NODE:3674 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3675# end class docParaType3676class docMarkupType(GeneratedsSuper):3677 subclass = None3678 superclass = None3679 def __init__(self, valueOf_='', mixedclass_=None, content_=None):3680 if mixedclass_ is None:3681 self.mixedclass_ = MixedContainer3682 else:3683 self.mixedclass_ = mixedclass_3684 if content_ is None:3685 self.content_ = []3686 else:3687 self.content_ = content_3688 def factory(*args_, **kwargs_):3689 if docMarkupType.subclass:3690 return docMarkupType.subclass(*args_, **kwargs_)3691 else:3692 return docMarkupType(*args_, **kwargs_)3693 factory = staticmethod(factory)3694 def getValueOf_(self): return self.valueOf_3695 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3696 def export(self, outfile, level, namespace_='', name_='docMarkupType', namespacedef_=''):3697 showIndent(outfile, level)3698 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3699 self.exportAttributes(outfile, level, namespace_, name_='docMarkupType')3700 outfile.write('>')3701 self.exportChildren(outfile, level + 1, namespace_, name_)3702 outfile.write('</%s%s>\n' % (namespace_, name_))3703 def exportAttributes(self, outfile, level, namespace_='', name_='docMarkupType'):3704 pass3705 def exportChildren(self, outfile, level, namespace_='', name_='docMarkupType'):3706 if self.valueOf_.find('![CDATA')>-1:3707 value=quote_xml('%s' % self.valueOf_)3708 value=value.replace('![CDATA','<![CDATA')3709 value=value.replace(']]',']]>')3710 outfile.write(value)3711 else:3712 outfile.write(quote_xml('%s' % self.valueOf_))3713 def hasContent_(self):3714 if (3715 self.valueOf_ is not None3716 ):3717 return True3718 else:3719 return False3720 def build(self, node_):3721 attrs = node_.attributes3722 self.buildAttributes(attrs)3723 self.valueOf_ = ''3724 for child_ in node_.childNodes:3725 nodeName_ = child_.nodeName.split(':')[-1]3726 self.buildChildren(child_, nodeName_)3727 def buildAttributes(self, attrs):3728 pass3729 def buildChildren(self, child_, nodeName_):3730 if child_.nodeType == Node.TEXT_NODE:3731 obj_ = self.mixedclass_(MixedContainer.CategoryText,3732 MixedContainer.TypeNone, '', child_.nodeValue)3733 self.content_.append(obj_)3734 if child_.nodeType == Node.TEXT_NODE:3735 self.valueOf_ += child_.nodeValue3736 elif child_.nodeType == Node.CDATA_SECTION_NODE:3737 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3738# end class docMarkupType3739class docURLLink(GeneratedsSuper):3740 subclass = None3741 superclass = None3742 def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):3743 self.url = url3744 if mixedclass_ is None:3745 self.mixedclass_ = MixedContainer3746 else:3747 self.mixedclass_ = mixedclass_3748 if content_ is None:3749 self.content_ = []3750 else:3751 self.content_ = content_3752 def factory(*args_, **kwargs_):3753 if docURLLink.subclass:3754 return docURLLink.subclass(*args_, **kwargs_)3755 else:3756 return docURLLink(*args_, **kwargs_)3757 factory = staticmethod(factory)3758 def get_url(self): return self.url3759 def set_url(self, url): self.url = url3760 def getValueOf_(self): return self.valueOf_3761 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3762 def export(self, outfile, level, namespace_='', name_='docURLLink', namespacedef_=''):3763 showIndent(outfile, level)3764 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3765 self.exportAttributes(outfile, level, namespace_, name_='docURLLink')3766 outfile.write('>')3767 self.exportChildren(outfile, level + 1, namespace_, name_)3768 outfile.write('</%s%s>\n' % (namespace_, name_))3769 def exportAttributes(self, outfile, level, namespace_='', name_='docURLLink'):3770 if self.url is not None:3771 outfile.write(' url=%s' % (self.format_string(quote_attrib(self.url).encode(ExternalEncoding), input_name='url'), ))3772 def exportChildren(self, outfile, level, namespace_='', name_='docURLLink'):3773 if self.valueOf_.find('![CDATA')>-1:3774 value=quote_xml('%s' % self.valueOf_)3775 value=value.replace('![CDATA','<![CDATA')3776 value=value.replace(']]',']]>')3777 outfile.write(value)3778 else:3779 outfile.write(quote_xml('%s' % self.valueOf_))3780 def hasContent_(self):3781 if (3782 self.valueOf_ is not None3783 ):3784 return True3785 else:3786 return False3787 def build(self, node_):3788 attrs = node_.attributes3789 self.buildAttributes(attrs)3790 self.valueOf_ = ''3791 for child_ in node_.childNodes:3792 nodeName_ = child_.nodeName.split(':')[-1]3793 self.buildChildren(child_, nodeName_)3794 def buildAttributes(self, attrs):3795 if attrs.get('url'):3796 self.url = attrs.get('url').value3797 def buildChildren(self, child_, nodeName_):3798 if child_.nodeType == Node.TEXT_NODE:3799 obj_ = self.mixedclass_(MixedContainer.CategoryText,3800 MixedContainer.TypeNone, '', child_.nodeValue)3801 self.content_.append(obj_)3802 if child_.nodeType == Node.TEXT_NODE:3803 self.valueOf_ += child_.nodeValue3804 elif child_.nodeType == Node.CDATA_SECTION_NODE:3805 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3806# end class docURLLink3807class docAnchorType(GeneratedsSuper):3808 subclass = None3809 superclass = None3810 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):3811 self.id = id3812 if mixedclass_ is None:3813 self.mixedclass_ = MixedContainer3814 else:3815 self.mixedclass_ = mixedclass_3816 if content_ is None:3817 self.content_ = []3818 else:3819 self.content_ = content_3820 def factory(*args_, **kwargs_):3821 if docAnchorType.subclass:3822 return docAnchorType.subclass(*args_, **kwargs_)3823 else:3824 return docAnchorType(*args_, **kwargs_)3825 factory = staticmethod(factory)3826 def get_id(self): return self.id3827 def set_id(self, id): self.id = id3828 def getValueOf_(self): return self.valueOf_3829 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3830 def export(self, outfile, level, namespace_='', name_='docAnchorType', namespacedef_=''):3831 showIndent(outfile, level)3832 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3833 self.exportAttributes(outfile, level, namespace_, name_='docAnchorType')3834 outfile.write('>')3835 self.exportChildren(outfile, level + 1, namespace_, name_)3836 outfile.write('</%s%s>\n' % (namespace_, name_))3837 def exportAttributes(self, outfile, level, namespace_='', name_='docAnchorType'):3838 if self.id is not None:3839 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3840 def exportChildren(self, outfile, level, namespace_='', name_='docAnchorType'):3841 if self.valueOf_.find('![CDATA')>-1:3842 value=quote_xml('%s' % self.valueOf_)3843 value=value.replace('![CDATA','<![CDATA')3844 value=value.replace(']]',']]>')3845 outfile.write(value)3846 else:3847 outfile.write(quote_xml('%s' % self.valueOf_))3848 def hasContent_(self):3849 if (3850 self.valueOf_ is not None3851 ):3852 return True3853 else:3854 return False3855 def build(self, node_):3856 attrs = node_.attributes3857 self.buildAttributes(attrs)3858 self.valueOf_ = ''3859 for child_ in node_.childNodes:3860 nodeName_ = child_.nodeName.split(':')[-1]3861 self.buildChildren(child_, nodeName_)3862 def buildAttributes(self, attrs):3863 if attrs.get('id'):3864 self.id = attrs.get('id').value3865 def buildChildren(self, child_, nodeName_):3866 if child_.nodeType == Node.TEXT_NODE:3867 obj_ = self.mixedclass_(MixedContainer.CategoryText,3868 MixedContainer.TypeNone, '', child_.nodeValue)3869 self.content_.append(obj_)3870 if child_.nodeType == Node.TEXT_NODE:3871 self.valueOf_ += child_.nodeValue3872 elif child_.nodeType == Node.CDATA_SECTION_NODE:3873 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3874# end class docAnchorType3875class docFormulaType(GeneratedsSuper):3876 subclass = None3877 superclass = None3878 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):3879 self.id = id3880 if mixedclass_ is None:3881 self.mixedclass_ = MixedContainer3882 else:3883 self.mixedclass_ = mixedclass_3884 if content_ is None:3885 self.content_ = []3886 else:3887 self.content_ = content_3888 def factory(*args_, **kwargs_):3889 if docFormulaType.subclass:3890 return docFormulaType.subclass(*args_, **kwargs_)3891 else:3892 return docFormulaType(*args_, **kwargs_)3893 factory = staticmethod(factory)3894 def get_id(self): return self.id3895 def set_id(self, id): self.id = id3896 def getValueOf_(self): return self.valueOf_3897 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3898 def export(self, outfile, level, namespace_='', name_='docFormulaType', namespacedef_=''):3899 showIndent(outfile, level)3900 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3901 self.exportAttributes(outfile, level, namespace_, name_='docFormulaType')3902 outfile.write('>')3903 self.exportChildren(outfile, level + 1, namespace_, name_)3904 outfile.write('</%s%s>\n' % (namespace_, name_))3905 def exportAttributes(self, outfile, level, namespace_='', name_='docFormulaType'):3906 if self.id is not None:3907 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3908 def exportChildren(self, outfile, level, namespace_='', name_='docFormulaType'):3909 if self.valueOf_.find('![CDATA')>-1:3910 value=quote_xml('%s' % self.valueOf_)3911 value=value.replace('![CDATA','<![CDATA')3912 value=value.replace(']]',']]>')3913 outfile.write(value)3914 else:3915 outfile.write(quote_xml('%s' % self.valueOf_))3916 def hasContent_(self):3917 if (3918 self.valueOf_ is not None3919 ):3920 return True3921 else:3922 return False3923 def build(self, node_):3924 attrs = node_.attributes3925 self.buildAttributes(attrs)3926 self.valueOf_ = ''3927 for child_ in node_.childNodes:3928 nodeName_ = child_.nodeName.split(':')[-1]3929 self.buildChildren(child_, nodeName_)3930 def buildAttributes(self, attrs):3931 if attrs.get('id'):3932 self.id = attrs.get('id').value3933 def buildChildren(self, child_, nodeName_):3934 if child_.nodeType == Node.TEXT_NODE:3935 obj_ = self.mixedclass_(MixedContainer.CategoryText,3936 MixedContainer.TypeNone, '', child_.nodeValue)3937 self.content_.append(obj_)3938 if child_.nodeType == Node.TEXT_NODE:3939 self.valueOf_ += child_.nodeValue3940 elif child_.nodeType == Node.CDATA_SECTION_NODE:3941 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3942# end class docFormulaType3943class docIndexEntryType(GeneratedsSuper):3944 subclass = None3945 superclass = None3946 def __init__(self, primaryie=None, secondaryie=None):3947 self.primaryie = primaryie3948 self.secondaryie = secondaryie3949 def factory(*args_, **kwargs_):3950 if docIndexEntryType.subclass:3951 return docIndexEntryType.subclass(*args_, **kwargs_)3952 else:3953 return docIndexEntryType(*args_, **kwargs_)3954 factory = staticmethod(factory)3955 def get_primaryie(self): return self.primaryie3956 def set_primaryie(self, primaryie): self.primaryie = primaryie3957 def get_secondaryie(self): return self.secondaryie3958 def set_secondaryie(self, secondaryie): self.secondaryie = secondaryie3959 def export(self, outfile, level, namespace_='', name_='docIndexEntryType', namespacedef_=''):3960 showIndent(outfile, level)3961 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3962 self.exportAttributes(outfile, level, namespace_, name_='docIndexEntryType')3963 if self.hasContent_():3964 outfile.write('>\n')3965 self.exportChildren(outfile, level + 1, namespace_, name_)3966 showIndent(outfile, level)3967 outfile.write('</%s%s>\n' % (namespace_, name_))3968 else:3969 outfile.write(' />\n')3970 def exportAttributes(self, outfile, level, namespace_='', name_='docIndexEntryType'):3971 pass3972 def exportChildren(self, outfile, level, namespace_='', name_='docIndexEntryType'):3973 if self.primaryie is not None:3974 showIndent(outfile, level)3975 outfile.write('<%sprimaryie>%s</%sprimaryie>\n' % (namespace_, self.format_string(quote_xml(self.primaryie).encode(ExternalEncoding), input_name='primaryie'), namespace_))3976 if self.secondaryie is not None:3977 showIndent(outfile, level)3978 outfile.write('<%ssecondaryie>%s</%ssecondaryie>\n' % (namespace_, self.format_string(quote_xml(self.secondaryie).encode(ExternalEncoding), input_name='secondaryie'), namespace_))3979 def hasContent_(self):3980 if (3981 self.primaryie is not None or3982 self.secondaryie is not None3983 ):3984 return True3985 else:3986 return False3987 def build(self, node_):3988 attrs = node_.attributes3989 self.buildAttributes(attrs)3990 for child_ in node_.childNodes:3991 nodeName_ = child_.nodeName.split(':')[-1]3992 self.buildChildren(child_, nodeName_)3993 def buildAttributes(self, attrs):3994 pass3995 def buildChildren(self, child_, nodeName_):3996 if child_.nodeType == Node.ELEMENT_NODE and \3997 nodeName_ == 'primaryie':3998 primaryie_ = ''3999 for text__content_ in child_.childNodes:4000 primaryie_ += text__content_.nodeValue4001 self.primaryie = primaryie_4002 elif child_.nodeType == Node.ELEMENT_NODE and \4003 nodeName_ == 'secondaryie':4004 secondaryie_ = ''4005 for text__content_ in child_.childNodes:4006 secondaryie_ += text__content_.nodeValue4007 self.secondaryie = secondaryie_4008# end class docIndexEntryType4009class docListType(GeneratedsSuper):4010 subclass = None4011 superclass = None4012 def __init__(self, listitem=None):4013 if listitem is None:4014 self.listitem = []4015 else:4016 self.listitem = listitem4017 def factory(*args_, **kwargs_):4018 if docListType.subclass:4019 return docListType.subclass(*args_, **kwargs_)4020 else:4021 return docListType(*args_, **kwargs_)4022 factory = staticmethod(factory)4023 def get_listitem(self): return self.listitem4024 def set_listitem(self, listitem): self.listitem = listitem4025 def add_listitem(self, value): self.listitem.append(value)4026 def insert_listitem(self, index, value): self.listitem[index] = value4027 def export(self, outfile, level, namespace_='', name_='docListType', namespacedef_=''):4028 showIndent(outfile, level)4029 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4030 self.exportAttributes(outfile, level, namespace_, name_='docListType')4031 if self.hasContent_():4032 outfile.write('>\n')4033 self.exportChildren(outfile, level + 1, namespace_, name_)4034 showIndent(outfile, level)4035 outfile.write('</%s%s>\n' % (namespace_, name_))4036 else:4037 outfile.write(' />\n')4038 def exportAttributes(self, outfile, level, namespace_='', name_='docListType'):4039 pass4040 def exportChildren(self, outfile, level, namespace_='', name_='docListType'):4041 for listitem_ in self.listitem:4042 listitem_.export(outfile, level, namespace_, name_='listitem')4043 def hasContent_(self):4044 if (4045 self.listitem is not None4046 ):4047 return True4048 else:4049 return False4050 def build(self, node_):4051 attrs = node_.attributes4052 self.buildAttributes(attrs)4053 for child_ in node_.childNodes:4054 nodeName_ = child_.nodeName.split(':')[-1]4055 self.buildChildren(child_, nodeName_)4056 def buildAttributes(self, attrs):4057 pass4058 def buildChildren(self, child_, nodeName_):4059 if child_.nodeType == Node.ELEMENT_NODE and \4060 nodeName_ == 'listitem':4061 obj_ = docListItemType.factory()4062 obj_.build(child_)4063 self.listitem.append(obj_)4064# end class docListType4065class docListItemType(GeneratedsSuper):4066 subclass = None4067 superclass = None4068 def __init__(self, para=None):4069 if para is None:4070 self.para = []4071 else:4072 self.para = para4073 def factory(*args_, **kwargs_):4074 if docListItemType.subclass:4075 return docListItemType.subclass(*args_, **kwargs_)4076 else:4077 return docListItemType(*args_, **kwargs_)4078 factory = staticmethod(factory)4079 def get_para(self): return self.para4080 def set_para(self, para): self.para = para4081 def add_para(self, value): self.para.append(value)4082 def insert_para(self, index, value): self.para[index] = value4083 def export(self, outfile, level, namespace_='', name_='docListItemType', namespacedef_=''):4084 showIndent(outfile, level)4085 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4086 self.exportAttributes(outfile, level, namespace_, name_='docListItemType')4087 if self.hasContent_():4088 outfile.write('>\n')4089 self.exportChildren(outfile, level + 1, namespace_, name_)4090 showIndent(outfile, level)4091 outfile.write('</%s%s>\n' % (namespace_, name_))4092 else:4093 outfile.write(' />\n')4094 def exportAttributes(self, outfile, level, namespace_='', name_='docListItemType'):4095 pass4096 def exportChildren(self, outfile, level, namespace_='', name_='docListItemType'):4097 for para_ in self.para:4098 para_.export(outfile, level, namespace_, name_='para')4099 def hasContent_(self):4100 if (4101 self.para is not None4102 ):4103 return True4104 else:4105 return False4106 def build(self, node_):4107 attrs = node_.attributes4108 self.buildAttributes(attrs)4109 for child_ in node_.childNodes:4110 nodeName_ = child_.nodeName.split(':')[-1]4111 self.buildChildren(child_, nodeName_)4112 def buildAttributes(self, attrs):4113 pass4114 def buildChildren(self, child_, nodeName_):4115 if child_.nodeType == Node.ELEMENT_NODE and \4116 nodeName_ == 'para':4117 obj_ = docParaType.factory()4118 obj_.build(child_)4119 self.para.append(obj_)4120# end class docListItemType4121class docSimpleSectType(GeneratedsSuper):4122 subclass = None4123 superclass = None4124 def __init__(self, kind=None, title=None, para=None):4125 self.kind = kind4126 self.title = title4127 if para is None:4128 self.para = []4129 else:4130 self.para = para4131 def factory(*args_, **kwargs_):4132 if docSimpleSectType.subclass:4133 return docSimpleSectType.subclass(*args_, **kwargs_)4134 else:4135 return docSimpleSectType(*args_, **kwargs_)4136 factory = staticmethod(factory)4137 def get_title(self): return self.title4138 def set_title(self, title): self.title = title4139 def get_para(self): return self.para4140 def set_para(self, para): self.para = para4141 def add_para(self, value): self.para.append(value)4142 def insert_para(self, index, value): self.para[index] = value4143 def get_kind(self): return self.kind4144 def set_kind(self, kind): self.kind = kind4145 def export(self, outfile, level, namespace_='', name_='docSimpleSectType', namespacedef_=''):4146 showIndent(outfile, level)4147 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4148 self.exportAttributes(outfile, level, namespace_, name_='docSimpleSectType')4149 if self.hasContent_():4150 outfile.write('>\n')4151 self.exportChildren(outfile, level + 1, namespace_, name_)4152 showIndent(outfile, level)4153 outfile.write('</%s%s>\n' % (namespace_, name_))4154 else:4155 outfile.write(' />\n')4156 def exportAttributes(self, outfile, level, namespace_='', name_='docSimpleSectType'):4157 if self.kind is not None:4158 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))4159 def exportChildren(self, outfile, level, namespace_='', name_='docSimpleSectType'):4160 if self.title:4161 self.title.export(outfile, level, namespace_, name_='title')4162 for para_ in self.para:4163 para_.export(outfile, level, namespace_, name_='para')4164 def hasContent_(self):4165 if (4166 self.title is not None or4167 self.para is not None4168 ):4169 return True4170 else:4171 return False4172 def build(self, node_):4173 attrs = node_.attributes4174 self.buildAttributes(attrs)4175 for child_ in node_.childNodes:4176 nodeName_ = child_.nodeName.split(':')[-1]4177 self.buildChildren(child_, nodeName_)4178 def buildAttributes(self, attrs):4179 if attrs.get('kind'):4180 self.kind = attrs.get('kind').value4181 def buildChildren(self, child_, nodeName_):4182 if child_.nodeType == Node.ELEMENT_NODE and \4183 nodeName_ == 'title':4184 obj_ = docTitleType.factory()4185 obj_.build(child_)4186 self.set_title(obj_)4187 elif child_.nodeType == Node.ELEMENT_NODE and \4188 nodeName_ == 'para':4189 obj_ = docParaType.factory()4190 obj_.build(child_)4191 self.para.append(obj_)4192# end class docSimpleSectType4193class docVarListEntryType(GeneratedsSuper):4194 subclass = None4195 superclass = None4196 def __init__(self, term=None):4197 self.term = term4198 def factory(*args_, **kwargs_):4199 if docVarListEntryType.subclass:4200 return docVarListEntryType.subclass(*args_, **kwargs_)4201 else:4202 return docVarListEntryType(*args_, **kwargs_)4203 factory = staticmethod(factory)4204 def get_term(self): return self.term4205 def set_term(self, term): self.term = term4206 def export(self, outfile, level, namespace_='', name_='docVarListEntryType', namespacedef_=''):4207 showIndent(outfile, level)4208 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4209 self.exportAttributes(outfile, level, namespace_, name_='docVarListEntryType')4210 if self.hasContent_():4211 outfile.write('>\n')4212 self.exportChildren(outfile, level + 1, namespace_, name_)4213 showIndent(outfile, level)4214 outfile.write('</%s%s>\n' % (namespace_, name_))4215 else:4216 outfile.write(' />\n')4217 def exportAttributes(self, outfile, level, namespace_='', name_='docVarListEntryType'):4218 pass4219 def exportChildren(self, outfile, level, namespace_='', name_='docVarListEntryType'):4220 if self.term:4221 self.term.export(outfile, level, namespace_, name_='term', )4222 def hasContent_(self):4223 if (4224 self.term is not None4225 ):4226 return True4227 else:4228 return False4229 def build(self, node_):4230 attrs = node_.attributes4231 self.buildAttributes(attrs)4232 for child_ in node_.childNodes:4233 nodeName_ = child_.nodeName.split(':')[-1]4234 self.buildChildren(child_, nodeName_)4235 def buildAttributes(self, attrs):4236 pass4237 def buildChildren(self, child_, nodeName_):4238 if child_.nodeType == Node.ELEMENT_NODE and \4239 nodeName_ == 'term':4240 obj_ = docTitleType.factory()4241 obj_.build(child_)4242 self.set_term(obj_)4243# end class docVarListEntryType4244class docVariableListType(GeneratedsSuper):4245 subclass = None4246 superclass = None4247 def __init__(self, valueOf_=''):4248 self.valueOf_ = valueOf_4249 def factory(*args_, **kwargs_):4250 if docVariableListType.subclass:4251 return docVariableListType.subclass(*args_, **kwargs_)4252 else:4253 return docVariableListType(*args_, **kwargs_)4254 factory = staticmethod(factory)4255 def getValueOf_(self): return self.valueOf_4256 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4257 def export(self, outfile, level, namespace_='', name_='docVariableListType', namespacedef_=''):4258 showIndent(outfile, level)4259 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4260 self.exportAttributes(outfile, level, namespace_, name_='docVariableListType')4261 if self.hasContent_():4262 outfile.write('>\n')4263 self.exportChildren(outfile, level + 1, namespace_, name_)4264 showIndent(outfile, level)4265 outfile.write('</%s%s>\n' % (namespace_, name_))4266 else:4267 outfile.write(' />\n')4268 def exportAttributes(self, outfile, level, namespace_='', name_='docVariableListType'):4269 pass4270 def exportChildren(self, outfile, level, namespace_='', name_='docVariableListType'):4271 if self.valueOf_.find('![CDATA')>-1:4272 value=quote_xml('%s' % self.valueOf_)4273 value=value.replace('![CDATA','<![CDATA')4274 value=value.replace(']]',']]>')4275 outfile.write(value)4276 else:4277 outfile.write(quote_xml('%s' % self.valueOf_))4278 def hasContent_(self):4279 if (4280 self.valueOf_ is not None4281 ):4282 return True4283 else:4284 return False4285 def build(self, node_):4286 attrs = node_.attributes4287 self.buildAttributes(attrs)4288 self.valueOf_ = ''4289 for child_ in node_.childNodes:4290 nodeName_ = child_.nodeName.split(':')[-1]4291 self.buildChildren(child_, nodeName_)4292 def buildAttributes(self, attrs):4293 pass4294 def buildChildren(self, child_, nodeName_):4295 if child_.nodeType == Node.TEXT_NODE:4296 self.valueOf_ += child_.nodeValue4297 elif child_.nodeType == Node.CDATA_SECTION_NODE:4298 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4299# end class docVariableListType4300class docRefTextType(GeneratedsSuper):4301 subclass = None4302 superclass = None4303 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):4304 self.refid = refid4305 self.kindref = kindref4306 self.external = external4307 if mixedclass_ is None:4308 self.mixedclass_ = MixedContainer4309 else:4310 self.mixedclass_ = mixedclass_4311 if content_ is None:4312 self.content_ = []4313 else:4314 self.content_ = content_4315 def factory(*args_, **kwargs_):4316 if docRefTextType.subclass:4317 return docRefTextType.subclass(*args_, **kwargs_)4318 else:4319 return docRefTextType(*args_, **kwargs_)4320 factory = staticmethod(factory)4321 def get_refid(self): return self.refid4322 def set_refid(self, refid): self.refid = refid4323 def get_kindref(self): return self.kindref4324 def set_kindref(self, kindref): self.kindref = kindref4325 def get_external(self): return self.external4326 def set_external(self, external): self.external = external4327 def getValueOf_(self): return self.valueOf_4328 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4329 def export(self, outfile, level, namespace_='', name_='docRefTextType', namespacedef_=''):4330 showIndent(outfile, level)4331 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4332 self.exportAttributes(outfile, level, namespace_, name_='docRefTextType')4333 outfile.write('>')4334 self.exportChildren(outfile, level + 1, namespace_, name_)4335 outfile.write('</%s%s>\n' % (namespace_, name_))4336 def exportAttributes(self, outfile, level, namespace_='', name_='docRefTextType'):4337 if self.refid is not None:4338 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))4339 if self.kindref is not None:4340 outfile.write(' kindref=%s' % (quote_attrib(self.kindref), ))4341 if self.external is not None:4342 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))4343 def exportChildren(self, outfile, level, namespace_='', name_='docRefTextType'):4344 if self.valueOf_.find('![CDATA')>-1:4345 value=quote_xml('%s' % self.valueOf_)4346 value=value.replace('![CDATA','<![CDATA')4347 value=value.replace(']]',']]>')4348 outfile.write(value)4349 else:4350 outfile.write(quote_xml('%s' % self.valueOf_))4351 def hasContent_(self):4352 if (4353 self.valueOf_ is not None4354 ):4355 return True4356 else:4357 return False4358 def build(self, node_):4359 attrs = node_.attributes4360 self.buildAttributes(attrs)4361 self.valueOf_ = ''4362 for child_ in node_.childNodes:4363 nodeName_ = child_.nodeName.split(':')[-1]4364 self.buildChildren(child_, nodeName_)4365 def buildAttributes(self, attrs):4366 if attrs.get('refid'):4367 self.refid = attrs.get('refid').value4368 if attrs.get('kindref'):4369 self.kindref = attrs.get('kindref').value4370 if attrs.get('external'):4371 self.external = attrs.get('external').value4372 def buildChildren(self, child_, nodeName_):4373 if child_.nodeType == Node.TEXT_NODE:4374 obj_ = self.mixedclass_(MixedContainer.CategoryText,4375 MixedContainer.TypeNone, '', child_.nodeValue)4376 self.content_.append(obj_)4377 if child_.nodeType == Node.TEXT_NODE:4378 self.valueOf_ += child_.nodeValue4379 elif child_.nodeType == Node.CDATA_SECTION_NODE:4380 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4381# end class docRefTextType4382class docTableType(GeneratedsSuper):4383 subclass = None4384 superclass = None4385 def __init__(self, rows=None, cols=None, row=None, caption=None):4386 self.rows = rows4387 self.cols = cols4388 if row is None:4389 self.row = []4390 else:4391 self.row = row4392 self.caption = caption4393 def factory(*args_, **kwargs_):4394 if docTableType.subclass:4395 return docTableType.subclass(*args_, **kwargs_)4396 else:4397 return docTableType(*args_, **kwargs_)4398 factory = staticmethod(factory)4399 def get_row(self): return self.row4400 def set_row(self, row): self.row = row4401 def add_row(self, value): self.row.append(value)4402 def insert_row(self, index, value): self.row[index] = value4403 def get_caption(self): return self.caption4404 def set_caption(self, caption): self.caption = caption4405 def get_rows(self): return self.rows4406 def set_rows(self, rows): self.rows = rows4407 def get_cols(self): return self.cols4408 def set_cols(self, cols): self.cols = cols4409 def export(self, outfile, level, namespace_='', name_='docTableType', namespacedef_=''):4410 showIndent(outfile, level)4411 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4412 self.exportAttributes(outfile, level, namespace_, name_='docTableType')4413 if self.hasContent_():4414 outfile.write('>\n')4415 self.exportChildren(outfile, level + 1, namespace_, name_)4416 showIndent(outfile, level)4417 outfile.write('</%s%s>\n' % (namespace_, name_))4418 else:4419 outfile.write(' />\n')4420 def exportAttributes(self, outfile, level, namespace_='', name_='docTableType'):4421 if self.rows is not None:4422 outfile.write(' rows="%s"' % self.format_integer(self.rows, input_name='rows'))4423 if self.cols is not None:4424 outfile.write(' cols="%s"' % self.format_integer(self.cols, input_name='cols'))4425 def exportChildren(self, outfile, level, namespace_='', name_='docTableType'):4426 for row_ in self.row:4427 row_.export(outfile, level, namespace_, name_='row')4428 if self.caption:4429 self.caption.export(outfile, level, namespace_, name_='caption')4430 def hasContent_(self):4431 if (4432 self.row is not None or4433 self.caption is not None4434 ):4435 return True4436 else:4437 return False4438 def build(self, node_):4439 attrs = node_.attributes4440 self.buildAttributes(attrs)4441 for child_ in node_.childNodes:4442 nodeName_ = child_.nodeName.split(':')[-1]4443 self.buildChildren(child_, nodeName_)4444 def buildAttributes(self, attrs):4445 if attrs.get('rows'):4446 try:4447 self.rows = int(attrs.get('rows').value)4448 except ValueError as exp:4449 raise ValueError('Bad integer attribute (rows): %s' % exp)4450 if attrs.get('cols'):4451 try:4452 self.cols = int(attrs.get('cols').value)4453 except ValueError as exp:4454 raise ValueError('Bad integer attribute (cols): %s' % exp)4455 def buildChildren(self, child_, nodeName_):4456 if child_.nodeType == Node.ELEMENT_NODE and \4457 nodeName_ == 'row':4458 obj_ = docRowType.factory()4459 obj_.build(child_)4460 self.row.append(obj_)4461 elif child_.nodeType == Node.ELEMENT_NODE and \4462 nodeName_ == 'caption':4463 obj_ = docCaptionType.factory()4464 obj_.build(child_)4465 self.set_caption(obj_)4466# end class docTableType4467class docRowType(GeneratedsSuper):4468 subclass = None4469 superclass = None4470 def __init__(self, entry=None):4471 if entry is None:4472 self.entry = []4473 else:4474 self.entry = entry4475 def factory(*args_, **kwargs_):4476 if docRowType.subclass:4477 return docRowType.subclass(*args_, **kwargs_)4478 else:4479 return docRowType(*args_, **kwargs_)4480 factory = staticmethod(factory)4481 def get_entry(self): return self.entry4482 def set_entry(self, entry): self.entry = entry4483 def add_entry(self, value): self.entry.append(value)4484 def insert_entry(self, index, value): self.entry[index] = value4485 def export(self, outfile, level, namespace_='', name_='docRowType', namespacedef_=''):4486 showIndent(outfile, level)4487 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4488 self.exportAttributes(outfile, level, namespace_, name_='docRowType')4489 if self.hasContent_():4490 outfile.write('>\n')4491 self.exportChildren(outfile, level + 1, namespace_, name_)4492 showIndent(outfile, level)4493 outfile.write('</%s%s>\n' % (namespace_, name_))4494 else:4495 outfile.write(' />\n')4496 def exportAttributes(self, outfile, level, namespace_='', name_='docRowType'):4497 pass4498 def exportChildren(self, outfile, level, namespace_='', name_='docRowType'):4499 for entry_ in self.entry:4500 entry_.export(outfile, level, namespace_, name_='entry')4501 def hasContent_(self):4502 if (4503 self.entry is not None4504 ):4505 return True4506 else:4507 return False4508 def build(self, node_):4509 attrs = node_.attributes4510 self.buildAttributes(attrs)4511 for child_ in node_.childNodes:4512 nodeName_ = child_.nodeName.split(':')[-1]4513 self.buildChildren(child_, nodeName_)4514 def buildAttributes(self, attrs):4515 pass4516 def buildChildren(self, child_, nodeName_):4517 if child_.nodeType == Node.ELEMENT_NODE and \4518 nodeName_ == 'entry':4519 obj_ = docEntryType.factory()4520 obj_.build(child_)4521 self.entry.append(obj_)4522# end class docRowType4523class docEntryType(GeneratedsSuper):4524 subclass = None4525 superclass = None4526 def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None):4527 self.thead = thead4528 self.align = align4529 self.rowspan = rowspan4530 self.colspan = colspan4531 if para is None:4532 self.para = []4533 else:4534 self.para = para4535 def factory(*args_, **kwargs_):4536 if docEntryType.subclass:4537 return docEntryType.subclass(*args_, **kwargs_)4538 else:4539 return docEntryType(*args_, **kwargs_)4540 factory = staticmethod(factory)4541 def get_para(self): return self.para4542 def set_para(self, para): self.para = para4543 def add_para(self, value): self.para.append(value)4544 def insert_para(self, index, value): self.para[index] = value4545 def get_thead(self): return self.thead4546 def set_thead(self, thead): self.thead = thead4547 def get_align(self): return self.align4548 def set_align(self, align): self.align = align4549 def get_rowspan(self): return self.rowspan4550 def set_rowspan(self, rowspan): self.rowspan = rowspan4551 def get_colspan(self): return self.colspan4552 def set_colspan(self, colspan): self.colspan = colspan4553 def export(self, outfile, level, namespace_='', name_='docEntryType', namespacedef_=''):4554 showIndent(outfile, level)4555 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4556 self.exportAttributes(outfile, level, namespace_, name_='docEntryType')4557 if self.hasContent_():4558 outfile.write('>\n')4559 self.exportChildren(outfile, level + 1, namespace_, name_)4560 showIndent(outfile, level)4561 outfile.write('</%s%s>\n' % (namespace_, name_))4562 else:4563 outfile.write(' />\n')4564 def exportAttributes(self, outfile, level, namespace_='', name_='docEntryType'):4565 if self.thead is not None:4566 outfile.write(' thead=%s' % (quote_attrib(self.thead), ))4567 if self.align is not None:4568 outfile.write(' align=%s' % (quote_attrib(self.align), ))4569 if self.rowspan is not None:4570 outfile.write(' rowspan=%s' % (quote_attrib(self.rowspan), ))4571 if self.colspan is not None:4572 outfile.write(' colspan=%s' % (quote_attrib(self.colspan), ))4573 def exportChildren(self, outfile, level, namespace_='', name_='docEntryType'):4574 for para_ in self.para:4575 para_.export(outfile, level, namespace_, name_='para')4576 def hasContent_(self):4577 if (4578 self.para is not None4579 ):4580 return True4581 else:4582 return False4583 def build(self, node_):4584 attrs = node_.attributes4585 self.buildAttributes(attrs)4586 for child_ in node_.childNodes:4587 nodeName_ = child_.nodeName.split(':')[-1]4588 self.buildChildren(child_, nodeName_)4589 def buildAttributes(self, attrs):4590 if attrs.get('thead'):4591 self.thead = attrs.get('thead').value4592 if attrs.get('align'):4593 self.align = attrs.get('align').value4594 if attrs.get('rowspan'):4595 self.rowspan = attrs.get('rowspan').value4596 if attrs.get('colspan'):4597 self.colspan = attrs.get('colspan').value4598 def buildChildren(self, child_, nodeName_):4599 if child_.nodeType == Node.ELEMENT_NODE and \4600 nodeName_ == 'para':4601 obj_ = docParaType.factory()4602 obj_.build(child_)4603 self.para.append(obj_)4604# end class docEntryType4605class docCaptionType(GeneratedsSuper):4606 subclass = None4607 superclass = None4608 def __init__(self, valueOf_='', mixedclass_=None, content_=None):4609 if mixedclass_ is None:4610 self.mixedclass_ = MixedContainer4611 else:4612 self.mixedclass_ = mixedclass_4613 if content_ is None:4614 self.content_ = []4615 else:4616 self.content_ = content_4617 def factory(*args_, **kwargs_):4618 if docCaptionType.subclass:4619 return docCaptionType.subclass(*args_, **kwargs_)4620 else:4621 return docCaptionType(*args_, **kwargs_)4622 factory = staticmethod(factory)4623 def getValueOf_(self): return self.valueOf_4624 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4625 def export(self, outfile, level, namespace_='', name_='docCaptionType', namespacedef_=''):4626 showIndent(outfile, level)4627 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4628 self.exportAttributes(outfile, level, namespace_, name_='docCaptionType')4629 outfile.write('>')4630 self.exportChildren(outfile, level + 1, namespace_, name_)4631 outfile.write('</%s%s>\n' % (namespace_, name_))4632 def exportAttributes(self, outfile, level, namespace_='', name_='docCaptionType'):4633 pass4634 def exportChildren(self, outfile, level, namespace_='', name_='docCaptionType'):4635 if self.valueOf_.find('![CDATA')>-1:4636 value=quote_xml('%s' % self.valueOf_)4637 value=value.replace('![CDATA','<![CDATA')4638 value=value.replace(']]',']]>')4639 outfile.write(value)4640 else:4641 outfile.write(quote_xml('%s' % self.valueOf_))4642 def hasContent_(self):4643 if (4644 self.valueOf_ is not None4645 ):4646 return True4647 else:4648 return False4649 def build(self, node_):4650 attrs = node_.attributes4651 self.buildAttributes(attrs)4652 self.valueOf_ = ''4653 for child_ in node_.childNodes:4654 nodeName_ = child_.nodeName.split(':')[-1]4655 self.buildChildren(child_, nodeName_)4656 def buildAttributes(self, attrs):4657 pass4658 def buildChildren(self, child_, nodeName_):4659 if child_.nodeType == Node.TEXT_NODE:4660 obj_ = self.mixedclass_(MixedContainer.CategoryText,4661 MixedContainer.TypeNone, '', child_.nodeValue)4662 self.content_.append(obj_)4663 if child_.nodeType == Node.TEXT_NODE:4664 self.valueOf_ += child_.nodeValue4665 elif child_.nodeType == Node.CDATA_SECTION_NODE:4666 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4667# end class docCaptionType4668class docHeadingType(GeneratedsSuper):4669 subclass = None4670 superclass = None4671 def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None):4672 self.level = level4673 if mixedclass_ is None:4674 self.mixedclass_ = MixedContainer4675 else:4676 self.mixedclass_ = mixedclass_4677 if content_ is None:4678 self.content_ = []4679 else:4680 self.content_ = content_4681 def factory(*args_, **kwargs_):4682 if docHeadingType.subclass:4683 return docHeadingType.subclass(*args_, **kwargs_)4684 else:4685 return docHeadingType(*args_, **kwargs_)4686 factory = staticmethod(factory)4687 def get_level(self): return self.level4688 def set_level(self, level): self.level = level4689 def getValueOf_(self): return self.valueOf_4690 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4691 def export(self, outfile, level, namespace_='', name_='docHeadingType', namespacedef_=''):4692 showIndent(outfile, level)4693 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4694 self.exportAttributes(outfile, level, namespace_, name_='docHeadingType')4695 outfile.write('>')4696 self.exportChildren(outfile, level + 1, namespace_, name_)4697 outfile.write('</%s%s>\n' % (namespace_, name_))4698 def exportAttributes(self, outfile, level, namespace_='', name_='docHeadingType'):4699 if self.level is not None:4700 outfile.write(' level="%s"' % self.format_integer(self.level, input_name='level'))4701 def exportChildren(self, outfile, level, namespace_='', name_='docHeadingType'):4702 if self.valueOf_.find('![CDATA')>-1:4703 value=quote_xml('%s' % self.valueOf_)4704 value=value.replace('![CDATA','<![CDATA')4705 value=value.replace(']]',']]>')4706 outfile.write(value)4707 else:4708 outfile.write(quote_xml('%s' % self.valueOf_))4709 def hasContent_(self):4710 if (4711 self.valueOf_ is not None4712 ):4713 return True4714 else:4715 return False4716 def build(self, node_):4717 attrs = node_.attributes4718 self.buildAttributes(attrs)4719 self.valueOf_ = ''4720 for child_ in node_.childNodes:4721 nodeName_ = child_.nodeName.split(':')[-1]4722 self.buildChildren(child_, nodeName_)4723 def buildAttributes(self, attrs):4724 if attrs.get('level'):4725 try:4726 self.level = int(attrs.get('level').value)4727 except ValueError as exp:4728 raise ValueError('Bad integer attribute (level): %s' % exp)4729 def buildChildren(self, child_, nodeName_):4730 if child_.nodeType == Node.TEXT_NODE:4731 obj_ = self.mixedclass_(MixedContainer.CategoryText,4732 MixedContainer.TypeNone, '', child_.nodeValue)4733 self.content_.append(obj_)4734 if child_.nodeType == Node.TEXT_NODE:4735 self.valueOf_ += child_.nodeValue4736 elif child_.nodeType == Node.CDATA_SECTION_NODE:4737 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4738# end class docHeadingType4739class docImageType(GeneratedsSuper):4740 subclass = None4741 superclass = None4742 def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None):4743 self.width = width4744 self.type_ = type_4745 self.name = name4746 self.height = height4747 if mixedclass_ is None:4748 self.mixedclass_ = MixedContainer4749 else:4750 self.mixedclass_ = mixedclass_4751 if content_ is None:4752 self.content_ = []4753 else:4754 self.content_ = content_4755 def factory(*args_, **kwargs_):4756 if docImageType.subclass:4757 return docImageType.subclass(*args_, **kwargs_)4758 else:4759 return docImageType(*args_, **kwargs_)4760 factory = staticmethod(factory)4761 def get_width(self): return self.width4762 def set_width(self, width): self.width = width4763 def get_type(self): return self.type_4764 def set_type(self, type_): self.type_ = type_4765 def get_name(self): return self.name4766 def set_name(self, name): self.name = name4767 def get_height(self): return self.height4768 def set_height(self, height): self.height = height4769 def getValueOf_(self): return self.valueOf_4770 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4771 def export(self, outfile, level, namespace_='', name_='docImageType', namespacedef_=''):4772 showIndent(outfile, level)4773 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4774 self.exportAttributes(outfile, level, namespace_, name_='docImageType')4775 outfile.write('>')4776 self.exportChildren(outfile, level + 1, namespace_, name_)4777 outfile.write('</%s%s>\n' % (namespace_, name_))4778 def exportAttributes(self, outfile, level, namespace_='', name_='docImageType'):4779 if self.width is not None:4780 outfile.write(' width=%s' % (self.format_string(quote_attrib(self.width).encode(ExternalEncoding), input_name='width'), ))4781 if self.type_ is not None:4782 outfile.write(' type=%s' % (quote_attrib(self.type_), ))4783 if self.name is not None:4784 outfile.write(' name=%s' % (self.format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))4785 if self.height is not None:4786 outfile.write(' height=%s' % (self.format_string(quote_attrib(self.height).encode(ExternalEncoding), input_name='height'), ))4787 def exportChildren(self, outfile, level, namespace_='', name_='docImageType'):4788 if self.valueOf_.find('![CDATA')>-1:4789 value=quote_xml('%s' % self.valueOf_)4790 value=value.replace('![CDATA','<![CDATA')4791 value=value.replace(']]',']]>')4792 outfile.write(value)4793 else:4794 outfile.write(quote_xml('%s' % self.valueOf_))4795 def hasContent_(self):4796 if (4797 self.valueOf_ is not None4798 ):4799 return True4800 else:4801 return False4802 def build(self, node_):4803 attrs = node_.attributes4804 self.buildAttributes(attrs)4805 self.valueOf_ = ''4806 for child_ in node_.childNodes:4807 nodeName_ = child_.nodeName.split(':')[-1]4808 self.buildChildren(child_, nodeName_)4809 def buildAttributes(self, attrs):4810 if attrs.get('width'):4811 self.width = attrs.get('width').value4812 if attrs.get('type'):4813 self.type_ = attrs.get('type').value4814 if attrs.get('name'):4815 self.name = attrs.get('name').value4816 if attrs.get('height'):4817 self.height = attrs.get('height').value4818 def buildChildren(self, child_, nodeName_):4819 if child_.nodeType == Node.TEXT_NODE:4820 obj_ = self.mixedclass_(MixedContainer.CategoryText,4821 MixedContainer.TypeNone, '', child_.nodeValue)4822 self.content_.append(obj_)4823 if child_.nodeType == Node.TEXT_NODE:4824 self.valueOf_ += child_.nodeValue4825 elif child_.nodeType == Node.CDATA_SECTION_NODE:4826 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4827# end class docImageType4828class docDotFileType(GeneratedsSuper):4829 subclass = None4830 superclass = None4831 def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None):4832 self.name = name4833 if mixedclass_ is None:4834 self.mixedclass_ = MixedContainer4835 else:4836 self.mixedclass_ = mixedclass_4837 if content_ is None:4838 self.content_ = []4839 else:4840 self.content_ = content_4841 def factory(*args_, **kwargs_):4842 if docDotFileType.subclass:4843 return docDotFileType.subclass(*args_, **kwargs_)4844 else:4845 return docDotFileType(*args_, **kwargs_)4846 factory = staticmethod(factory)4847 def get_name(self): return self.name4848 def set_name(self, name): self.name = name4849 def getValueOf_(self): return self.valueOf_4850 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4851 def export(self, outfile, level, namespace_='', name_='docDotFileType', namespacedef_=''):4852 showIndent(outfile, level)4853 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4854 self.exportAttributes(outfile, level, namespace_, name_='docDotFileType')4855 outfile.write('>')4856 self.exportChildren(outfile, level + 1, namespace_, name_)4857 outfile.write('</%s%s>\n' % (namespace_, name_))4858 def exportAttributes(self, outfile, level, namespace_='', name_='docDotFileType'):4859 if self.name is not None:4860 outfile.write(' name=%s' % (self.format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))4861 def exportChildren(self, outfile, level, namespace_='', name_='docDotFileType'):4862 if self.valueOf_.find('![CDATA')>-1:4863 value=quote_xml('%s' % self.valueOf_)4864 value=value.replace('![CDATA','<![CDATA')4865 value=value.replace(']]',']]>')4866 outfile.write(value)4867 else:4868 outfile.write(quote_xml('%s' % self.valueOf_))4869 def hasContent_(self):4870 if (4871 self.valueOf_ is not None4872 ):4873 return True4874 else:4875 return False4876 def build(self, node_):4877 attrs = node_.attributes4878 self.buildAttributes(attrs)4879 self.valueOf_ = ''4880 for child_ in node_.childNodes:4881 nodeName_ = child_.nodeName.split(':')[-1]4882 self.buildChildren(child_, nodeName_)4883 def buildAttributes(self, attrs):4884 if attrs.get('name'):4885 self.name = attrs.get('name').value4886 def buildChildren(self, child_, nodeName_):4887 if child_.nodeType == Node.TEXT_NODE:4888 obj_ = self.mixedclass_(MixedContainer.CategoryText,4889 MixedContainer.TypeNone, '', child_.nodeValue)4890 self.content_.append(obj_)4891 if child_.nodeType == Node.TEXT_NODE:4892 self.valueOf_ += child_.nodeValue4893 elif child_.nodeType == Node.CDATA_SECTION_NODE:4894 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4895# end class docDotFileType4896class docDotType(GeneratedsSuper):4897 subclass = None4898 superclass = None4899 def __init__(self, caption=None, valueOf_='', mixedclass_=None, content_=None):4900 self.caption = caption4901 if mixedclass_ is None:4902 self.mixedclass_ = MixedContainer4903 else:4904 self.mixedclass_ = mixedclass_4905 if content_ is None:4906 self.content_ = []4907 else:4908 self.content_ = content_4909 def factory(*args_, **kwargs_):4910 if docDotType.subclass:4911 return docDotType.subclass(*args_, **kwargs_)4912 else:4913 return docDotType(*args_, **kwargs_)4914 factory = staticmethod(factory)4915 def get_name(self): return self.caption4916 def set_name(self, caption): self.caption = caption4917 def getValueOf_(self): return self.valueOf_4918 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4919 def export(self, outfile, level, namespace_='', name_='docDotType', namespacedef_=''):4920 showIndent(outfile, level)4921 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4922 self.exportAttributes(outfile, level, namespace_, name_='docDotType')4923 outfile.write('>')4924 self.exportChildren(outfile, level + 1, namespace_, name_)4925 outfile.write('</%s%s>\n' % (namespace_, name_))4926 def exportAttributes(self, outfile, level, namespace_='', name_='docDotType'):4927 if self.caption is not None:4928 outfile.write(' caption=%s' % (self.format_string(quote_attrib(self.caption).encode(ExternalEncoding), input_name='caption'), ))4929 def exportChildren(self, outfile, level, namespace_='', name_='docDotType'):4930 if self.valueOf_.find('![CDATA')>-1:4931 value=quote_xml('%s' % self.valueOf_)4932 value=value.replace('![CDATA','<![CDATA')4933 value=value.replace(']]',']]>')4934 outfile.write(value)4935 else:4936 outfile.write(quote_xml('%s' % self.valueOf_))4937 def hasContent_(self):4938 if (4939 self.valueOf_ is not None4940 ):4941 return True4942 else:4943 return False4944 def build(self, node_):4945 attrs = node_.attributes4946 self.buildAttributes(attrs)4947 self.valueOf_ = ''4948 for child_ in node_.childNodes:4949 nodeName_ = child_.nodeName.split(':')[-1]4950 self.buildChildren(child_, nodeName_)4951 def buildAttributes(self, attrs):4952 if attrs.get('caption'):4953 self.caption = attrs.get('caption').value4954 def buildChildren(self, child_, nodeName_):4955 if child_.nodeType == Node.TEXT_NODE:4956 obj_ = self.mixedclass_(MixedContainer.CategoryText,4957 MixedContainer.TypeNone, '', child_.nodeValue)4958 self.content_.append(obj_)4959 if child_.nodeType == Node.TEXT_NODE:4960 self.valueOf_ += child_.nodeValue4961 elif child_.nodeType == Node.CDATA_SECTION_NODE:4962 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4963# end class docDotType4964class docTocItemType(GeneratedsSuper):4965 subclass = None4966 superclass = None4967 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):4968 self.id = id4969 if mixedclass_ is None:4970 self.mixedclass_ = MixedContainer4971 else:4972 self.mixedclass_ = mixedclass_4973 if content_ is None:4974 self.content_ = []4975 else:4976 self.content_ = content_4977 def factory(*args_, **kwargs_):4978 if docTocItemType.subclass:4979 return docTocItemType.subclass(*args_, **kwargs_)4980 else:4981 return docTocItemType(*args_, **kwargs_)4982 factory = staticmethod(factory)4983 def get_id(self): return self.id4984 def set_id(self, id): self.id = id4985 def getValueOf_(self): return self.valueOf_4986 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4987 def export(self, outfile, level, namespace_='', name_='docTocItemType', namespacedef_=''):4988 showIndent(outfile, level)4989 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4990 self.exportAttributes(outfile, level, namespace_, name_='docTocItemType')4991 outfile.write('>')4992 self.exportChildren(outfile, level + 1, namespace_, name_)4993 outfile.write('</%s%s>\n' % (namespace_, name_))4994 def exportAttributes(self, outfile, level, namespace_='', name_='docTocItemType'):4995 if self.id is not None:4996 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4997 def exportChildren(self, outfile, level, namespace_='', name_='docTocItemType'):4998 if self.valueOf_.find('![CDATA')>-1:4999 value=quote_xml('%s' % self.valueOf_)5000 value=value.replace('![CDATA','<![CDATA')5001 value=value.replace(']]',']]>')5002 outfile.write(value)5003 else:5004 outfile.write(quote_xml('%s' % self.valueOf_))5005 def hasContent_(self):5006 if (5007 self.valueOf_ is not None5008 ):5009 return True5010 else:5011 return False5012 def build(self, node_):5013 attrs = node_.attributes5014 self.buildAttributes(attrs)5015 self.valueOf_ = ''5016 for child_ in node_.childNodes:5017 nodeName_ = child_.nodeName.split(':')[-1]5018 self.buildChildren(child_, nodeName_)5019 def buildAttributes(self, attrs):5020 if attrs.get('id'):5021 self.id = attrs.get('id').value5022 def buildChildren(self, child_, nodeName_):5023 if child_.nodeType == Node.TEXT_NODE:5024 obj_ = self.mixedclass_(MixedContainer.CategoryText,5025 MixedContainer.TypeNone, '', child_.nodeValue)5026 self.content_.append(obj_)5027 if child_.nodeType == Node.TEXT_NODE:5028 self.valueOf_ += child_.nodeValue5029 elif child_.nodeType == Node.CDATA_SECTION_NODE:5030 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5031# end class docTocItemType5032class docTocListType(GeneratedsSuper):5033 subclass = None5034 superclass = None5035 def __init__(self, tocitem=None):5036 if tocitem is None:5037 self.tocitem = []5038 else:5039 self.tocitem = tocitem5040 def factory(*args_, **kwargs_):5041 if docTocListType.subclass:5042 return docTocListType.subclass(*args_, **kwargs_)5043 else:5044 return docTocListType(*args_, **kwargs_)5045 factory = staticmethod(factory)5046 def get_tocitem(self): return self.tocitem5047 def set_tocitem(self, tocitem): self.tocitem = tocitem5048 def add_tocitem(self, value): self.tocitem.append(value)5049 def insert_tocitem(self, index, value): self.tocitem[index] = value5050 def export(self, outfile, level, namespace_='', name_='docTocListType', namespacedef_=''):5051 showIndent(outfile, level)5052 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5053 self.exportAttributes(outfile, level, namespace_, name_='docTocListType')5054 if self.hasContent_():5055 outfile.write('>\n')5056 self.exportChildren(outfile, level + 1, namespace_, name_)5057 showIndent(outfile, level)5058 outfile.write('</%s%s>\n' % (namespace_, name_))5059 else:5060 outfile.write(' />\n')5061 def exportAttributes(self, outfile, level, namespace_='', name_='docTocListType'):5062 pass5063 def exportChildren(self, outfile, level, namespace_='', name_='docTocListType'):5064 for tocitem_ in self.tocitem:5065 tocitem_.export(outfile, level, namespace_, name_='tocitem')5066 def hasContent_(self):5067 if (5068 self.tocitem is not None5069 ):5070 return True5071 else:5072 return False5073 def build(self, node_):5074 attrs = node_.attributes5075 self.buildAttributes(attrs)5076 for child_ in node_.childNodes:5077 nodeName_ = child_.nodeName.split(':')[-1]5078 self.buildChildren(child_, nodeName_)5079 def buildAttributes(self, attrs):5080 pass5081 def buildChildren(self, child_, nodeName_):5082 if child_.nodeType == Node.ELEMENT_NODE and \5083 nodeName_ == 'tocitem':5084 obj_ = docTocItemType.factory()5085 obj_.build(child_)5086 self.tocitem.append(obj_)5087# end class docTocListType5088class docLanguageType(GeneratedsSuper):5089 subclass = None5090 superclass = None5091 def __init__(self, langid=None, para=None):5092 self.langid = langid5093 if para is None:5094 self.para = []5095 else:5096 self.para = para5097 def factory(*args_, **kwargs_):5098 if docLanguageType.subclass:5099 return docLanguageType.subclass(*args_, **kwargs_)5100 else:5101 return docLanguageType(*args_, **kwargs_)5102 factory = staticmethod(factory)5103 def get_para(self): return self.para5104 def set_para(self, para): self.para = para5105 def add_para(self, value): self.para.append(value)5106 def insert_para(self, index, value): self.para[index] = value5107 def get_langid(self): return self.langid5108 def set_langid(self, langid): self.langid = langid5109 def export(self, outfile, level, namespace_='', name_='docLanguageType', namespacedef_=''):5110 showIndent(outfile, level)5111 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5112 self.exportAttributes(outfile, level, namespace_, name_='docLanguageType')5113 if self.hasContent_():5114 outfile.write('>\n')5115 self.exportChildren(outfile, level + 1, namespace_, name_)5116 showIndent(outfile, level)5117 outfile.write('</%s%s>\n' % (namespace_, name_))5118 else:5119 outfile.write(' />\n')5120 def exportAttributes(self, outfile, level, namespace_='', name_='docLanguageType'):5121 if self.langid is not None:5122 outfile.write(' langid=%s' % (self.format_string(quote_attrib(self.langid).encode(ExternalEncoding), input_name='langid'), ))5123 def exportChildren(self, outfile, level, namespace_='', name_='docLanguageType'):5124 for para_ in self.para:5125 para_.export(outfile, level, namespace_, name_='para')5126 def hasContent_(self):5127 if (5128 self.para is not None5129 ):5130 return True5131 else:5132 return False5133 def build(self, node_):5134 attrs = node_.attributes5135 self.buildAttributes(attrs)5136 for child_ in node_.childNodes:5137 nodeName_ = child_.nodeName.split(':')[-1]5138 self.buildChildren(child_, nodeName_)5139 def buildAttributes(self, attrs):5140 if attrs.get('langid'):5141 self.langid = attrs.get('langid').value5142 def buildChildren(self, child_, nodeName_):5143 if child_.nodeType == Node.ELEMENT_NODE and \5144 nodeName_ == 'para':5145 obj_ = docParaType.factory()5146 obj_.build(child_)5147 self.para.append(obj_)5148# end class docLanguageType5149class docParamListType(GeneratedsSuper):5150 subclass = None5151 superclass = None5152 def __init__(self, kind=None, parameteritem=None):5153 self.kind = kind5154 if parameteritem is None:5155 self.parameteritem = []5156 else:5157 self.parameteritem = parameteritem5158 def factory(*args_, **kwargs_):5159 if docParamListType.subclass:5160 return docParamListType.subclass(*args_, **kwargs_)5161 else:5162 return docParamListType(*args_, **kwargs_)5163 factory = staticmethod(factory)5164 def get_parameteritem(self): return self.parameteritem5165 def set_parameteritem(self, parameteritem): self.parameteritem = parameteritem5166 def add_parameteritem(self, value): self.parameteritem.append(value)5167 def insert_parameteritem(self, index, value): self.parameteritem[index] = value5168 def get_kind(self): return self.kind5169 def set_kind(self, kind): self.kind = kind5170 def export(self, outfile, level, namespace_='', name_='docParamListType', namespacedef_=''):5171 showIndent(outfile, level)5172 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5173 self.exportAttributes(outfile, level, namespace_, name_='docParamListType')5174 if self.hasContent_():5175 outfile.write('>\n')5176 self.exportChildren(outfile, level + 1, namespace_, name_)5177 showIndent(outfile, level)5178 outfile.write('</%s%s>\n' % (namespace_, name_))5179 else:5180 outfile.write(' />\n')5181 def exportAttributes(self, outfile, level, namespace_='', name_='docParamListType'):5182 if self.kind is not None:5183 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))5184 def exportChildren(self, outfile, level, namespace_='', name_='docParamListType'):5185 for parameteritem_ in self.parameteritem:5186 parameteritem_.export(outfile, level, namespace_, name_='parameteritem')5187 def hasContent_(self):5188 if (5189 self.parameteritem is not None5190 ):5191 return True5192 else:5193 return False5194 def build(self, node_):5195 attrs = node_.attributes5196 self.buildAttributes(attrs)5197 for child_ in node_.childNodes:5198 nodeName_ = child_.nodeName.split(':')[-1]5199 self.buildChildren(child_, nodeName_)5200 def buildAttributes(self, attrs):5201 if attrs.get('kind'):5202 self.kind = attrs.get('kind').value5203 def buildChildren(self, child_, nodeName_):5204 if child_.nodeType == Node.ELEMENT_NODE and \5205 nodeName_ == 'parameteritem':5206 obj_ = docParamListItem.factory()5207 obj_.build(child_)5208 self.parameteritem.append(obj_)5209# end class docParamListType5210class docParamListItem(GeneratedsSuper):5211 subclass = None5212 superclass = None5213 def __init__(self, parameternamelist=None, parameterdescription=None):5214 if parameternamelist is None:5215 self.parameternamelist = []5216 else:5217 self.parameternamelist = parameternamelist5218 self.parameterdescription = parameterdescription5219 def factory(*args_, **kwargs_):5220 if docParamListItem.subclass:5221 return docParamListItem.subclass(*args_, **kwargs_)5222 else:5223 return docParamListItem(*args_, **kwargs_)5224 factory = staticmethod(factory)5225 def get_parameternamelist(self): return self.parameternamelist5226 def set_parameternamelist(self, parameternamelist): self.parameternamelist = parameternamelist5227 def add_parameternamelist(self, value): self.parameternamelist.append(value)5228 def insert_parameternamelist(self, index, value): self.parameternamelist[index] = value5229 def get_parameterdescription(self): return self.parameterdescription5230 def set_parameterdescription(self, parameterdescription): self.parameterdescription = parameterdescription5231 def export(self, outfile, level, namespace_='', name_='docParamListItem', namespacedef_=''):5232 showIndent(outfile, level)5233 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5234 self.exportAttributes(outfile, level, namespace_, name_='docParamListItem')5235 if self.hasContent_():5236 outfile.write('>\n')5237 self.exportChildren(outfile, level + 1, namespace_, name_)5238 showIndent(outfile, level)5239 outfile.write('</%s%s>\n' % (namespace_, name_))5240 else:5241 outfile.write(' />\n')5242 def exportAttributes(self, outfile, level, namespace_='', name_='docParamListItem'):5243 pass5244 def exportChildren(self, outfile, level, namespace_='', name_='docParamListItem'):5245 for parameternamelist_ in self.parameternamelist:5246 parameternamelist_.export(outfile, level, namespace_, name_='parameternamelist')5247 if self.parameterdescription:5248 self.parameterdescription.export(outfile, level, namespace_, name_='parameterdescription', )5249 def hasContent_(self):5250 if (5251 self.parameternamelist is not None or5252 self.parameterdescription is not None5253 ):5254 return True5255 else:5256 return False5257 def build(self, node_):5258 attrs = node_.attributes5259 self.buildAttributes(attrs)5260 for child_ in node_.childNodes:5261 nodeName_ = child_.nodeName.split(':')[-1]5262 self.buildChildren(child_, nodeName_)5263 def buildAttributes(self, attrs):5264 pass5265 def buildChildren(self, child_, nodeName_):5266 if child_.nodeType == Node.ELEMENT_NODE and \5267 nodeName_ == 'parameternamelist':5268 obj_ = docParamNameList.factory()5269 obj_.build(child_)5270 self.parameternamelist.append(obj_)5271 elif child_.nodeType == Node.ELEMENT_NODE and \5272 nodeName_ == 'parameterdescription':5273 obj_ = descriptionType.factory()5274 obj_.build(child_)5275 self.set_parameterdescription(obj_)5276# end class docParamListItem5277class docParamNameList(GeneratedsSuper):5278 subclass = None5279 superclass = None5280 def __init__(self, parametername=None):5281 if parametername is None:5282 self.parametername = []5283 else:5284 self.parametername = parametername5285 def factory(*args_, **kwargs_):5286 if docParamNameList.subclass:5287 return docParamNameList.subclass(*args_, **kwargs_)5288 else:5289 return docParamNameList(*args_, **kwargs_)5290 factory = staticmethod(factory)5291 def get_parametername(self): return self.parametername5292 def set_parametername(self, parametername): self.parametername = parametername5293 def add_parametername(self, value): self.parametername.append(value)5294 def insert_parametername(self, index, value): self.parametername[index] = value5295 def export(self, outfile, level, namespace_='', name_='docParamNameList', namespacedef_=''):5296 showIndent(outfile, level)5297 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5298 self.exportAttributes(outfile, level, namespace_, name_='docParamNameList')5299 if self.hasContent_():5300 outfile.write('>\n')5301 self.exportChildren(outfile, level + 1, namespace_, name_)5302 showIndent(outfile, level)5303 outfile.write('</%s%s>\n' % (namespace_, name_))5304 else:5305 outfile.write(' />\n')5306 def exportAttributes(self, outfile, level, namespace_='', name_='docParamNameList'):5307 pass5308 def exportChildren(self, outfile, level, namespace_='', name_='docParamNameList'):5309 for parametername_ in self.parametername:5310 parametername_.export(outfile, level, namespace_, name_='parametername')5311 def hasContent_(self):5312 if (5313 self.parametername is not None5314 ):5315 return True5316 else:5317 return False5318 def build(self, node_):5319 attrs = node_.attributes5320 self.buildAttributes(attrs)5321 for child_ in node_.childNodes:5322 nodeName_ = child_.nodeName.split(':')[-1]5323 self.buildChildren(child_, nodeName_)5324 def buildAttributes(self, attrs):5325 pass5326 def buildChildren(self, child_, nodeName_):5327 if child_.nodeType == Node.ELEMENT_NODE and \5328 nodeName_ == 'parametername':5329 obj_ = docParamName.factory()5330 obj_.build(child_)5331 self.parametername.append(obj_)5332# end class docParamNameList5333class docParamName(GeneratedsSuper):5334 subclass = None5335 superclass = None5336 def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):5337 self.direction = direction5338 if mixedclass_ is None:5339 self.mixedclass_ = MixedContainer5340 else:5341 self.mixedclass_ = mixedclass_5342 if content_ is None:5343 self.content_ = []5344 else:5345 self.content_ = content_5346 def factory(*args_, **kwargs_):5347 if docParamName.subclass:5348 return docParamName.subclass(*args_, **kwargs_)5349 else:5350 return docParamName(*args_, **kwargs_)5351 factory = staticmethod(factory)5352 def get_ref(self): return self.ref5353 def set_ref(self, ref): self.ref = ref5354 def get_direction(self): return self.direction5355 def set_direction(self, direction): self.direction = direction5356 def export(self, outfile, level, namespace_='', name_='docParamName', namespacedef_=''):5357 showIndent(outfile, level)5358 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5359 self.exportAttributes(outfile, level, namespace_, name_='docParamName')5360 outfile.write('>')5361 self.exportChildren(outfile, level + 1, namespace_, name_)5362 outfile.write('</%s%s>\n' % (namespace_, name_))5363 def exportAttributes(self, outfile, level, namespace_='', name_='docParamName'):5364 if self.direction is not None:5365 outfile.write(' direction=%s' % (quote_attrib(self.direction), ))5366 def exportChildren(self, outfile, level, namespace_='', name_='docParamName'):5367 for item_ in self.content_:5368 item_.export(outfile, level, item_.name, namespace_)5369 def hasContent_(self):5370 if (5371 self.ref is not None5372 ):5373 return True5374 else:5375 return False5376 def build(self, node_):5377 attrs = node_.attributes5378 self.buildAttributes(attrs)5379 for child_ in node_.childNodes:5380 nodeName_ = child_.nodeName.split(':')[-1]5381 self.buildChildren(child_, nodeName_)5382 def buildAttributes(self, attrs):5383 if attrs.get('direction'):5384 self.direction = attrs.get('direction').value5385 def buildChildren(self, child_, nodeName_):5386 if child_.nodeType == Node.ELEMENT_NODE and \5387 nodeName_ == 'ref':5388 childobj_ = docRefTextType.factory()5389 childobj_.build(child_)5390 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5391 MixedContainer.TypeNone, 'ref', childobj_)5392 self.content_.append(obj_)5393 elif child_.nodeType == Node.TEXT_NODE:5394 obj_ = self.mixedclass_(MixedContainer.CategoryText,5395 MixedContainer.TypeNone, '', child_.nodeValue)5396 self.content_.append(obj_)5397 d = child_.parentNode.attributes.get('direction')5398 if d is not None:5399 self.content_.insert(0, self.mixedclass_(MixedContainer.CategoryText,5400 MixedContainer.TypeNone,5401 '', '[{}] '.format(d.value)))5402# end class docParamName5403class docXRefSectType(GeneratedsSuper):5404 subclass = None5405 superclass = None5406 def __init__(self, id=None, xreftitle=None, xrefdescription=None):5407 self.id = id5408 if xreftitle is None:5409 self.xreftitle = []5410 else:5411 self.xreftitle = xreftitle5412 self.xrefdescription = xrefdescription5413 def factory(*args_, **kwargs_):5414 if docXRefSectType.subclass:5415 return docXRefSectType.subclass(*args_, **kwargs_)5416 else:5417 return docXRefSectType(*args_, **kwargs_)5418 factory = staticmethod(factory)5419 def get_xreftitle(self): return self.xreftitle5420 def set_xreftitle(self, xreftitle): self.xreftitle = xreftitle5421 def add_xreftitle(self, value): self.xreftitle.append(value)5422 def insert_xreftitle(self, index, value): self.xreftitle[index] = value5423 def get_xrefdescription(self): return self.xrefdescription5424 def set_xrefdescription(self, xrefdescription): self.xrefdescription = xrefdescription5425 def get_id(self): return self.id5426 def set_id(self, id): self.id = id5427 def export(self, outfile, level, namespace_='', name_='docXRefSectType', namespacedef_=''):5428 showIndent(outfile, level)5429 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5430 self.exportAttributes(outfile, level, namespace_, name_='docXRefSectType')5431 if self.hasContent_():5432 outfile.write('>\n')5433 self.exportChildren(outfile, level + 1, namespace_, name_)5434 showIndent(outfile, level)5435 outfile.write('</%s%s>\n' % (namespace_, name_))5436 else:5437 outfile.write(' />\n')5438 def exportAttributes(self, outfile, level, namespace_='', name_='docXRefSectType'):5439 if self.id is not None:5440 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))5441 def exportChildren(self, outfile, level, namespace_='', name_='docXRefSectType'):5442 for xreftitle_ in self.xreftitle:5443 showIndent(outfile, level)5444 outfile.write('<%sxreftitle>%s</%sxreftitle>\n' % (namespace_, self.format_string(quote_xml(xreftitle_).encode(ExternalEncoding), input_name='xreftitle'), namespace_))5445 if self.xrefdescription:5446 self.xrefdescription.export(outfile, level, namespace_, name_='xrefdescription', )5447 def hasContent_(self):5448 if (5449 self.xreftitle is not None or5450 self.xrefdescription is not None5451 ):5452 return True5453 else:5454 return False5455 def build(self, node_):5456 attrs = node_.attributes5457 self.buildAttributes(attrs)5458 for child_ in node_.childNodes:5459 nodeName_ = child_.nodeName.split(':')[-1]5460 self.buildChildren(child_, nodeName_)5461 def buildAttributes(self, attrs):5462 if attrs.get('id'):5463 self.id = attrs.get('id').value5464 def buildChildren(self, child_, nodeName_):5465 if child_.nodeType == Node.ELEMENT_NODE and \5466 nodeName_ == 'xreftitle':5467 xreftitle_ = ''5468 for text__content_ in child_.childNodes:5469 xreftitle_ += text__content_.nodeValue5470 self.xreftitle.append(xreftitle_)5471 elif child_.nodeType == Node.ELEMENT_NODE and \5472 nodeName_ == 'xrefdescription':5473 obj_ = descriptionType.factory()5474 obj_.build(child_)5475 self.set_xrefdescription(obj_)5476# end class docXRefSectType5477class docCopyType(GeneratedsSuper):5478 subclass = None5479 superclass = None5480 def __init__(self, link=None, para=None, sect1=None, internal=None):5481 self.link = link5482 if para is None:5483 self.para = []5484 else:5485 self.para = para5486 if sect1 is None:5487 self.sect1 = []5488 else:5489 self.sect1 = sect15490 self.internal = internal5491 def factory(*args_, **kwargs_):5492 if docCopyType.subclass:5493 return docCopyType.subclass(*args_, **kwargs_)5494 else:5495 return docCopyType(*args_, **kwargs_)5496 factory = staticmethod(factory)5497 def get_para(self): return self.para5498 def set_para(self, para): self.para = para5499 def add_para(self, value): self.para.append(value)5500 def insert_para(self, index, value): self.para[index] = value5501 def get_sect1(self): return self.sect15502 def set_sect1(self, sect1): self.sect1 = sect15503 def add_sect1(self, value): self.sect1.append(value)5504 def insert_sect1(self, index, value): self.sect1[index] = value5505 def get_internal(self): return self.internal5506 def set_internal(self, internal): self.internal = internal5507 def get_link(self): return self.link5508 def set_link(self, link): self.link = link5509 def export(self, outfile, level, namespace_='', name_='docCopyType', namespacedef_=''):5510 showIndent(outfile, level)5511 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5512 self.exportAttributes(outfile, level, namespace_, name_='docCopyType')5513 if self.hasContent_():5514 outfile.write('>\n')5515 self.exportChildren(outfile, level + 1, namespace_, name_)5516 showIndent(outfile, level)5517 outfile.write('</%s%s>\n' % (namespace_, name_))5518 else:5519 outfile.write(' />\n')5520 def exportAttributes(self, outfile, level, namespace_='', name_='docCopyType'):5521 if self.link is not None:5522 outfile.write(' link=%s' % (self.format_string(quote_attrib(self.link).encode(ExternalEncoding), input_name='link'), ))5523 def exportChildren(self, outfile, level, namespace_='', name_='docCopyType'):5524 for para_ in self.para:5525 para_.export(outfile, level, namespace_, name_='para')5526 for sect1_ in self.sect1:5527 sect1_.export(outfile, level, namespace_, name_='sect1')5528 if self.internal:5529 self.internal.export(outfile, level, namespace_, name_='internal')5530 def hasContent_(self):5531 if (5532 self.para is not None or5533 self.sect1 is not None or5534 self.internal is not None5535 ):5536 return True5537 else:5538 return False5539 def build(self, node_):5540 attrs = node_.attributes5541 self.buildAttributes(attrs)5542 for child_ in node_.childNodes:5543 nodeName_ = child_.nodeName.split(':')[-1]5544 self.buildChildren(child_, nodeName_)5545 def buildAttributes(self, attrs):5546 if attrs.get('link'):5547 self.link = attrs.get('link').value5548 def buildChildren(self, child_, nodeName_):5549 if child_.nodeType == Node.ELEMENT_NODE and \5550 nodeName_ == 'para':5551 obj_ = docParaType.factory()5552 obj_.build(child_)5553 self.para.append(obj_)5554 elif child_.nodeType == Node.ELEMENT_NODE and \5555 nodeName_ == 'sect1':5556 obj_ = docSect1Type.factory()5557 obj_.build(child_)5558 self.sect1.append(obj_)5559 elif child_.nodeType == Node.ELEMENT_NODE and \5560 nodeName_ == 'internal':5561 obj_ = docInternalType.factory()5562 obj_.build(child_)5563 self.set_internal(obj_)5564# end class docCopyType5565class docCharType(GeneratedsSuper):5566 subclass = None5567 superclass = None5568 def __init__(self, char=None, valueOf_=''):5569 self.char = char5570 self.valueOf_ = valueOf_5571 def factory(*args_, **kwargs_):5572 if docCharType.subclass:5573 return docCharType.subclass(*args_, **kwargs_)5574 else:5575 return docCharType(*args_, **kwargs_)5576 factory = staticmethod(factory)5577 def get_char(self): return self.char5578 def set_char(self, char): self.char = char5579 def getValueOf_(self): return self.valueOf_5580 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5581 def export(self, outfile, level, namespace_='', name_='docCharType', namespacedef_=''):5582 showIndent(outfile, level)5583 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5584 self.exportAttributes(outfile, level, namespace_, name_='docCharType')5585 if self.hasContent_():5586 outfile.write('>\n')5587 self.exportChildren(outfile, level + 1, namespace_, name_)5588 showIndent(outfile, level)5589 outfile.write('</%s%s>\n' % (namespace_, name_))5590 else:5591 outfile.write(' />\n')5592 def exportAttributes(self, outfile, level, namespace_='', name_='docCharType'):5593 if self.char is not None:5594 outfile.write(' char=%s' % (quote_attrib(self.char), ))5595 def exportChildren(self, outfile, level, namespace_='', name_='docCharType'):5596 if self.valueOf_.find('![CDATA')>-1:5597 value=quote_xml('%s' % self.valueOf_)5598 value=value.replace('![CDATA','<![CDATA')5599 value=value.replace(']]',']]>')5600 outfile.write(value)5601 else:5602 outfile.write(quote_xml('%s' % self.valueOf_))5603 def hasContent_(self):5604 if (5605 self.valueOf_ is not None5606 ):5607 return True5608 else:5609 return False5610 def build(self, node_):5611 attrs = node_.attributes5612 self.buildAttributes(attrs)5613 self.valueOf_ = ''5614 for child_ in node_.childNodes:5615 nodeName_ = child_.nodeName.split(':')[-1]5616 self.buildChildren(child_, nodeName_)5617 def buildAttributes(self, attrs):5618 if attrs.get('char'):5619 self.char = attrs.get('char').value5620 def buildChildren(self, child_, nodeName_):5621 if child_.nodeType == Node.TEXT_NODE:5622 self.valueOf_ += child_.nodeValue5623 elif child_.nodeType == Node.CDATA_SECTION_NODE:5624 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5625# end class docCharType5626class docBlockQuoteType(GeneratedsSuper):5627 subclass = None5628 superclass = None5629 def __init__(self, mixedclass_=None, para=None):5630 if mixedclass_ is None:5631 self.mixedclass_ = MixedContainer5632 else:5633 self.mixedclass_ = mixedclass_5634 if para is None:5635 self.para = []5636 else:5637 self.para = para5638 def factory(*args_, **kwargs_):5639 if docBlockQuoteType.subclass:5640 return docBlockQuoteType.subclass(*args_, **kwargs_)5641 else:5642 return docBlockQuoteType(*args_, **kwargs_)5643 factory = staticmethod(factory)5644 def get_para(self): return self.para5645 def set_para(self, para): self.para = para5646 def add_para(self, value): self.para.append(value)5647 def insert_para(self, index, value): self.para[index] = value5648 def export(self, outfile, level, namespace_='', name_='docBlockQuoteType', namespacedef_=''):5649 showIndent(outfile, level)5650 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5651 self.exportAttributes(outfile, level, namespace_, name_='docBlockQuoteType')5652 if self.hasContent_():5653 outfile.write('>\n')5654 self.exportChildren(outfile, level + 1, namespace_, name_)5655 showIndent(outfile, level)5656 outfile.write('</%s%s>\n' % (namespace_, name_))5657 else:5658 outfile.write('/>\n')5659 def exportAttributes(self, outfile, level, namespace_='', name_='docBlockQuoteType'):5660 pass5661 def exportChildren(self, outfile, level, namespace_='', name_='docBlockQuoteType'):5662 for para_ in self.para:5663 para_.export(outfile, level, namespace_, name_='para')5664 def hasContent_(self):5665 if (5666 self.para5667 ):5668 return True5669 else:5670 return False5671 def build(self, node_):5672 attrs = node_.attributes5673 self.buildAttributes(attrs)5674 self.valueOf_ = ''5675 for child_ in node_.childNodes:5676 nodeName_ = child_.nodeName.split(':')[-1]5677 self.buildChildren(child_, nodeName_)5678 def buildAttributes(self, attrs):5679 pass5680 def buildChildren(self, child_, nodeName_):5681 if child_.nodeType == Node.ELEMENT_NODE and \5682 nodeName_ == 'para':5683 obj_ = docParaType.factory()5684 obj_.build(child_)5685 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5686 MixedContainer.TypeNone, 'para', obj_)5687 self.para.append(obj_)5688# end class docBlockQuoteType5689class docParBlockType(GeneratedsSuper):5690 subclass = None5691 superclass = None5692 def __init__(self, mixedclass_=None, para=None):5693 if mixedclass_ is None:5694 self.mixedclass_ = MixedContainer5695 else:5696 self.mixedclass_ = mixedclass_5697 if para is None:5698 self.para = []5699 else:5700 self.para = para5701 def factory(*args_, **kwargs_):5702 if docParBlockType.subclass:5703 return docParBlockType.subclass(*args_, **kwargs_)5704 else:5705 return docParBlockType(*args_, **kwargs_)5706 factory = staticmethod(factory)5707 def get_para(self): return self.para5708 def set_para(self, para): self.para = para5709 def add_para(self, value): self.para.append(value)5710 def insert_para(self, index, value): self.para[index] = value5711 def export(self, outfile, level, namespace_='', name_='docParBlockType', namespacedef_=''):5712 showIndent(outfile, level)5713 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5714 self.exportAttributes(outfile, level, namespace_, name_='docParBlockType')5715 if self.hasContent_():5716 outfile.write('>\n')5717 self.exportChildren(outfile, level + 1, namespace_, name_)5718 showIndent(outfile, level)5719 outfile.write('</%s%s>\n' % (namespace_, name_))5720 else:5721 outfile.write('/>\n')5722 def exportAttributes(self, outfile, level, namespace_='', name_='docParBlockType'):5723 pass5724 def exportChildren(self, outfile, level, namespace_='', name_='docParBlockType'):5725 for para_ in self.para:5726 para_.export(outfile, level, namespace_, name_='para')5727 def hasContent_(self):5728 if (5729 self.para5730 ):5731 return True5732 else:5733 return False5734 def build(self, node_):5735 attrs = node_.attributes5736 self.buildAttributes(attrs)5737 self.valueOf_ = ''5738 for child_ in node_.childNodes:5739 nodeName_ = child_.nodeName.split(':')[-1]5740 self.buildChildren(child_, nodeName_)5741 def buildAttributes(self, attrs):5742 pass5743 def buildChildren(self, child_, nodeName_):5744 if child_.nodeType == Node.ELEMENT_NODE and \5745 nodeName_ == 'para':5746 obj_ = docParaType.factory()5747 obj_.build(child_)5748 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5749 MixedContainer.TypeNone, 'para', obj_)5750 self.para.append(obj_)5751# end class docParBlockType5752class docEmptyType(GeneratedsSuper):5753 subclass = None5754 superclass = None5755 def __init__(self, valueOf_=''):5756 self.valueOf_ = valueOf_5757 def factory(*args_, **kwargs_):5758 if docEmptyType.subclass:5759 return docEmptyType.subclass(*args_, **kwargs_)5760 else:5761 return docEmptyType(*args_, **kwargs_)5762 factory = staticmethod(factory)5763 def getValueOf_(self): return self.valueOf_5764 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5765 def export(self, outfile, level, namespace_='', name_='docEmptyType', namespacedef_=''):5766 showIndent(outfile, level)5767 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5768 self.exportAttributes(outfile, level, namespace_, name_='docEmptyType')5769 if self.hasContent_():5770 outfile.write('>\n')5771 self.exportChildren(outfile, level + 1, namespace_, name_)5772 showIndent(outfile, level)5773 outfile.write('</%s%s>\n' % (namespace_, name_))5774 else:5775 outfile.write(' />\n')5776 def exportAttributes(self, outfile, level, namespace_='', name_='docEmptyType'):5777 pass5778 def exportChildren(self, outfile, level, namespace_='', name_='docEmptyType'):5779 if self.valueOf_.find('![CDATA')>-1:5780 value=quote_xml('%s' % self.valueOf_)5781 value=value.replace('![CDATA','<![CDATA')5782 value=value.replace(']]',']]>')5783 outfile.write(value)5784 else:5785 outfile.write(quote_xml('%s' % self.valueOf_))5786 def hasContent_(self):5787 if (5788 self.valueOf_ is not None5789 ):5790 return True5791 else:5792 return False5793 def build(self, node_):5794 attrs = node_.attributes5795 self.buildAttributes(attrs)5796 self.valueOf_ = ''5797 for child_ in node_.childNodes:5798 nodeName_ = child_.nodeName.split(':')[-1]5799 self.buildChildren(child_, nodeName_)5800 def buildAttributes(self, attrs):5801 pass5802 def buildChildren(self, child_, nodeName_):5803 if child_.nodeType == Node.TEXT_NODE:5804 self.valueOf_ += child_.nodeValue5805 elif child_.nodeType == Node.CDATA_SECTION_NODE:5806 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5807# end class docEmptyType5808USAGE_TEXT = """5809Usage: python <Parser>.py [ -s ] <in_xml_file>5810Options:5811 -s Use the SAX parser, not the minidom parser.5812"""5813def usage():5814 print(USAGE_TEXT)5815 sys.exit(1)5816def parse(inFileName):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!