1""" 2Generated Mon Feb 9 19:08:05 2009 by generateDS.py. 3This file contains manual modifications. 4""" 5 6from xml.dom import minidom 7from xml.dom import Node 8from xml.parsers.expat import ExpatError 9 10from . import compoundsuper as supermod 11from .compoundsuper import MixedContainer 12 13 14class DoxygenTypeSub(supermod.DoxygenType): 15 16 node_type = "doxygendef" 17 18 def __init__(self, version=None, compounddef=None): 19 supermod.DoxygenType.__init__(self, version, compounddef) 20 21 22supermod.DoxygenType.subclass = DoxygenTypeSub 23# end class DoxygenTypeSub 24 25 26class compounddefTypeSub(supermod.compounddefType): 27 28 node_type = "compounddef" 29 30 def __init__(self, kind=None, prot=None, id=None, compoundname='', title='', 31 basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, 32 incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, 33 innerclass=None, innernamespace=None, innerpage=None, innergroup=None, 34 templateparamlist=None, sectiondef=None, briefdescription=None, 35 detaileddescription=None, inheritancegraph=None, collaborationgraph=None, 36 programlisting=None, location=None, listofallmembers=None): 37 38 supermod.compounddefType.__init__(self, kind, prot, id, compoundname, title, 39 basecompoundref, derivedcompoundref, includes, includedby, 40 incdepgraph, invincdepgraph, innerdir, innerfile, 41 innerclass, innernamespace, innerpage, innergroup, 42 templateparamlist, sectiondef, briefdescription, 43 detaileddescription, inheritancegraph, collaborationgraph, 44 programlisting, location, listofallmembers) 45 46 47supermod.compounddefType.subclass = compounddefTypeSub 48# end class compounddefTypeSub 49 50 51class listofallmembersTypeSub(supermod.listofallmembersType): 52 53 node_type = "listofallmembers" 54 55 def __init__(self, member=None): 56 supermod.listofallmembersType.__init__(self, member) 57 58 59supermod.listofallmembersType.subclass = listofallmembersTypeSub 60# end class listofallmembersTypeSub 61 62 63class memberRefTypeSub(supermod.memberRefType): 64 65 node_type = "memberref" 66 67 def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope='', name=''): 68 supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name) 69 70 71supermod.memberRefType.subclass = memberRefTypeSub 72# end class memberRefTypeSub 73 74 75class compoundRefTypeSub(supermod.compoundRefType): 76 77 node_type = "compoundref" 78 79 def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, 80 content_=None): 81 supermod.compoundRefType.__init__(self, mixedclass_, content_) 82 83 84supermod.compoundRefType.subclass = compoundRefTypeSub 85# end class compoundRefTypeSub 86 87 88class reimplementTypeSub(supermod.reimplementType): 89 90 node_type = "reimplement" 91 92 def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None): 93 supermod.reimplementType.__init__(self, mixedclass_, content_) 94 95 96supermod.reimplementType.subclass = reimplementTypeSub 97# end class reimplementTypeSub 98 99 100class incTypeSub(supermod.incType): 101 102 node_type = "inc" 103 104 def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None): 105 supermod.incType.__init__(self, mixedclass_, content_) 106 107 108supermod.incType.subclass = incTypeSub 109# end class incTypeSub 110 111 112class refTypeSub(supermod.refType): 113 114 node_type = "ref" 115 116 def __init__(self, node_name, prot=None, refid=None, valueOf_='', mixedclass_=None, 117 content_=None): 118 supermod.refType.__init__(self, mixedclass_, content_) 119 120 self.node_name = node_name 121 122 123supermod.refType.subclass = refTypeSub 124 125 126class refTextTypeSub(supermod.refTextType): 127 128 node_type = "reftex" 129 130 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, 131 content_=None): 132 supermod.refTextType.__init__(self, mixedclass_, content_) 133 134 135supermod.refTextType.subclass = refTextTypeSub 136# end class refTextTypeSub 137 138 139class sectiondefTypeSub(supermod.sectiondefType): 140 141 node_type = "sectiondef" 142 143 def __init__(self, kind=None, header='', description=None, memberdef=None): 144 supermod.sectiondefType.__init__(self, kind, header, description, memberdef) 145 146 147supermod.sectiondefType.subclass = sectiondefTypeSub 148# end class sectiondefTypeSub 149 150 151class memberdefTypeSub(supermod.memberdefType): 152 153 node_type = "memberdef" 154 155 def __init__(self, initonly=None, kind=None, volatile=None, const=None, raise_=None, virt=None, 156 readable=None, prot=None, explicit=None, new=None, final=None, writable=None, 157 add=None, static=None, remove=None, sealed=None, mutable=None, gettable=None, 158 inline=None, settable=None, id=None, templateparamlist=None, type_=None, 159 definition='', argsstring='', name='', read='', write='', bitfield='', 160 reimplements=None, reimplementedby=None, param=None, enumvalue=None, 161 initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, 162 inbodydescription=None, location=None, references=None, referencedby=None, 163 refqual=None): 164 165 supermod.memberdefType.__init__(self, initonly, kind, volatile, const, raise_, virt, 166 readable, prot, explicit, new, final, writable, add, static, 167 remove, sealed, mutable, gettable, inline, settable, id, 168 templateparamlist, type_, definition, argsstring, name, 169 read, write, bitfield, reimplements, reimplementedby, param, 170 enumvalue, initializer, exceptions, briefdescription, 171 detaileddescription, inbodydescription, location, 172 references, referencedby, refqual) 173 174 self.parameterlist = supermod.docParamListType.factory() 175 self.parameterlist.kind = "param" 176 177 def buildChildren(self, child_, nodeName_): 178 supermod.memberdefType.buildChildren(self, child_, nodeName_) 179 180 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'param': 181 182 # Get latest param 183 param = self.param[-1] 184 185 # If it doesn't have a description we're done 186 if not param.briefdescription: 187 return 188 189 # Construct our own param list from the descriptions stored inline 190 # with the parameters 191 paramdescription = param.briefdescription 192 paramname = supermod.docParamName.factory() 193 194 # Add parameter name 195 obj_ = paramname.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', 196 param.declname) 197 paramname.content_.append(obj_) 198 199 paramnamelist = supermod.docParamNameList.factory() 200 paramnamelist.parametername.append(paramname) 201 202 paramlistitem = supermod.docParamListItem.factory() 203 paramlistitem.parameternamelist.append(paramnamelist) 204 205 # Add parameter description 206 paramlistitem.parameterdescription = paramdescription 207 208 self.parameterlist.parameteritem.append(paramlistitem) 209 210 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'detaileddescription': 211 212 if not self.parameterlist.parameteritem: 213 # No items in our list 214 return 215 216 # Assume supermod.memberdefType.buildChildren has already built the 217 # description object, we just want to slot our parameterlist in at 218 # a reasonable point 219 220 if not self.detaileddescription: 221 # Create one if it doesn't exist 222 self.detaileddescription = supermod.descriptionType.factory() 223 224 detaileddescription = self.detaileddescription 225 226 para = supermod.docParaType.factory() 227 para.parameterlist.append(self.parameterlist) 228 229 obj_ = detaileddescription.mixedclass_(MixedContainer.CategoryComplex, 230 MixedContainer.TypeNone, 'para', para) 231 232 index = 0 233 detaileddescription.content_.insert(index, obj_) 234 235 236supermod.memberdefType.subclass = memberdefTypeSub 237# end class memberdefTypeSub 238 239 240class descriptionTypeSub(supermod.descriptionType): 241 242 node_type = "description" 243 244 def __init__(self, title='', para=None, sect1=None, internal=None, mixedclass_=None, 245 content_=None): 246 supermod.descriptionType.__init__(self, mixedclass_, content_) 247 248 249supermod.descriptionType.subclass = descriptionTypeSub 250# end class descriptionTypeSub 251 252 253class enumvalueTypeSub(supermod.enumvalueType): 254 255 node_type = "enumvalue" 256 257 def __init__(self, prot=None, id=None, name='', initializer=None, briefdescription=None, 258 detaileddescription=None, mixedclass_=None, content_=None): 259 supermod.enumvalueType.__init__(self, mixedclass_, content_) 260 261 self.initializer = None 262 263 def buildChildren(self, child_, nodeName_): 264 # Get text from <name> child and put it in self.name 265 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'name': 266 value_ = [] 267 for text_ in child_.childNodes: 268 value_.append(text_.nodeValue) 269 valuestr_ = ''.join(value_) 270 self.name = valuestr_ 271 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'briefdescription': 272 obj_ = supermod.descriptionType.factory() 273 obj_.build(child_) 274 self.set_briefdescription(obj_) 275 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'detaileddescription': 276 obj_ = supermod.descriptionType.factory() 277 obj_.build(child_) 278 self.set_detaileddescription(obj_) 279 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'initializer': 280 childobj_ = supermod.linkedTextType.factory() 281 childobj_.build(child_) 282 obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 283 'initializer', childobj_) 284 self.set_initializer(obj_) 285 self.content_.append(obj_) 286 287 288supermod.enumvalueType.subclass = enumvalueTypeSub 289# end class enumvalueTypeSub 290 291 292class templateparamlistTypeSub(supermod.templateparamlistType): 293 294 node_type = "templateparamlist" 295 296 def __init__(self, param=None): 297 supermod.templateparamlistType.__init__(self, param) 298 299 300supermod.templateparamlistType.subclass = templateparamlistTypeSub 301# end class templateparamlistTypeSub 302 303 304class paramTypeSub(supermod.paramType): 305 306 node_type = "param" 307 308 def __init__(self, type_=None, declname='', defname='', array='', defval=None, 309 briefdescription=None): 310 supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription) 311 312 313supermod.paramType.subclass = paramTypeSub 314# end class paramTypeSub 315 316 317class linkedTextTypeSub(supermod.linkedTextType): 318 319 node_type = "linkedtext" 320 321 def __init__(self, ref=None, mixedclass_=None, content_=None): 322 supermod.linkedTextType.__init__(self, mixedclass_, content_) 323 324 325supermod.linkedTextType.subclass = linkedTextTypeSub 326# end class linkedTextTypeSub 327 328 329class graphTypeSub(supermod.graphType): 330 331 node_type = "graph" 332 333 def __init__(self, node=None): 334 supermod.graphType.__init__(self, node) 335 336 337supermod.graphType.subclass = graphTypeSub 338# end class graphTypeSub 339 340 341class nodeTypeSub(supermod.nodeType): 342 343 node_type = "node" 344 345 def __init__(self, id=None, label='', link=None, childnode=None): 346 supermod.nodeType.__init__(self, id, label, link, childnode) 347 348 349supermod.nodeType.subclass = nodeTypeSub 350# end class nodeTypeSub 351 352 353class childnodeTypeSub(supermod.childnodeType): 354 355 node_type = "childnode" 356 357 def __init__(self, relation=None, refid=None, edgelabel=None): 358 supermod.childnodeType.__init__(self, relation, refid, edgelabel) 359 360 361supermod.childnodeType.subclass = childnodeTypeSub 362# end class childnodeTypeSub 363 364 365class linkTypeSub(supermod.linkType): 366 367 node_type = "link" 368 369 def __init__(self, refid=None, external=None, valueOf_=''): 370 supermod.linkType.__init__(self, refid, external) 371 372 373supermod.linkType.subclass = linkTypeSub 374# end class linkTypeSub 375 376 377class listingTypeSub(supermod.listingType): 378 379 node_type = "listing" 380 381 def __init__(self, codeline=None): 382 supermod.listingType.__init__(self, codeline) 383 384 385supermod.listingType.subclass = listingTypeSub 386# end class listingTypeSub 387 388 389class codelineTypeSub(supermod.codelineType): 390 391 node_type = "codeline" 392 393 def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None): 394 supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight) 395 396 397supermod.codelineType.subclass = codelineTypeSub 398# end class codelineTypeSub 399 400 401class highlightTypeSub(supermod.highlightType): 402 403 node_type = "highlight" 404 405 def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None): 406 supermod.highlightType.__init__(self, mixedclass_, content_) 407 408 409supermod.highlightType.subclass = highlightTypeSub 410# end class highlightTypeSub 411 412 413class referenceTypeSub(supermod.referenceType): 414 415 node_type = "reference" 416 417 def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', 418 mixedclass_=None, content_=None): 419 supermod.referenceType.__init__(self, mixedclass_, content_) 420 421 422supermod.referenceType.subclass = referenceTypeSub 423# end class referenceTypeSub 424 425 426class locationTypeSub(supermod.locationType): 427 428 node_type = "location" 429 430 def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, 431 valueOf_=''): 432 supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file) 433 434 435supermod.locationType.subclass = locationTypeSub 436# end class locationTypeSub 437 438 439class docSect1TypeSub(supermod.docSect1Type): 440 441 node_type = "docsect1" 442 443 def __init__(self, id=None, title='', para=None, sect2=None, internal=None, mixedclass_=None, 444 content_=None): 445 supermod.docSect1Type.__init__(self, mixedclass_, content_) 446 447 448supermod.docSect1Type.subclass = docSect1TypeSub 449# end class docSect1TypeSub 450 451 452class docSect2TypeSub(supermod.docSect2Type): 453 454 node_type = "docsect2" 455 456 def __init__(self, id=None, title='', para=None, sect3=None, internal=None, mixedclass_=None, 457 content_=None): 458 supermod.docSect2Type.__init__(self, mixedclass_, content_) 459 460 461supermod.docSect2Type.subclass = docSect2TypeSub 462# end class docSect2TypeSub 463 464 465class docSect3TypeSub(supermod.docSect3Type): 466 467 node_type = "docsect3" 468 469 def __init__(self, id=None, title='', para=None, sect4=None, internal=None, mixedclass_=None, 470 content_=None): 471 supermod.docSect3Type.__init__(self, mixedclass_, content_) 472 473 474supermod.docSect3Type.subclass = docSect3TypeSub 475# end class docSect3TypeSub 476 477 478class docSect4TypeSub(supermod.docSect4Type): 479 480 node_type = "docsect4" 481 482 def __init__(self, id=None, title='', para=None, internal=None, mixedclass_=None, 483 content_=None): 484 supermod.docSect4Type.__init__(self, mixedclass_, content_) 485 486 487supermod.docSect4Type.subclass = docSect4TypeSub 488# end class docSect4TypeSub 489 490 491class docInternalTypeSub(supermod.docInternalType): 492 493 node_type = "docinternal" 494 495 def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None): 496 supermod.docInternalType.__init__(self, mixedclass_, content_) 497 498 499supermod.docInternalType.subclass = docInternalTypeSub 500# end class docInternalTypeSub 501 502 503class docInternalS1TypeSub(supermod.docInternalS1Type): 504 505 node_type = "docinternals1" 506 507 def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None): 508 supermod.docInternalS1Type.__init__(self, mixedclass_, content_) 509 510 511supermod.docInternalS1Type.subclass = docInternalS1TypeSub 512# end class docInternalS1TypeSub 513 514 515class docInternalS2TypeSub(supermod.docInternalS2Type): 516 517 node_type = "docinternals2" 518 519 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): 520 supermod.docInternalS2Type.__init__(self, mixedclass_, content_) 521 522 523supermod.docInternalS2Type.subclass = docInternalS2TypeSub 524# end class docInternalS2TypeSub 525 526 527class docInternalS3TypeSub(supermod.docInternalS3Type): 528 529 node_type = "docinternals3" 530 531 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): 532 supermod.docInternalS3Type.__init__(self, mixedclass_, content_) 533 534 535supermod.docInternalS3Type.subclass = docInternalS3TypeSub 536# end class docInternalS3TypeSub 537 538 539class docInternalS4TypeSub(supermod.docInternalS4Type): 540 541 node_type = "docinternals4" 542 543 def __init__(self, para=None, mixedclass_=None, content_=None): 544 supermod.docInternalS4Type.__init__(self, mixedclass_, content_) 545 546 547supermod.docInternalS4Type.subclass = docInternalS4TypeSub 548# end class docInternalS4TypeSub 549 550 551class docURLLinkSub(supermod.docURLLink): 552 553 node_type = "docurllink" 554 555 def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None): 556 supermod.docURLLink.__init__(self, mixedclass_, content_) 557 558 559supermod.docURLLink.subclass = docURLLinkSub 560# end class docURLLinkSub 561 562 563class docAnchorTypeSub(supermod.docAnchorType): 564 565 node_type = "docanchor" 566 567 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 568 supermod.docAnchorType.__init__(self, mixedclass_, content_) 569 570 571supermod.docAnchorType.subclass = docAnchorTypeSub 572# end class docAnchorTypeSub 573 574 575class docFormulaTypeSub(supermod.docFormulaType): 576 577 node_type = "docformula" 578 579 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 580 supermod.docFormulaType.__init__(self, mixedclass_, content_) 581 582 583supermod.docFormulaType.subclass = docFormulaTypeSub 584# end class docFormulaTypeSub 585 586 587class docIndexEntryTypeSub(supermod.docIndexEntryType): 588 589 node_type = "docindexentry" 590 591 def __init__(self, primaryie='', secondaryie=''): 592 supermod.docIndexEntryType.__init__(self, primaryie, secondaryie) 593 594 595supermod.docIndexEntryType.subclass = docIndexEntryTypeSub 596# end class docIndexEntryTypeSub 597 598 599class docListTypeSub(supermod.docListType): 600 601 node_type = "doclist" 602 603 def __init__(self, listitem=None, subtype=""): 604 self.node_subtype = "itemized" 605 if subtype != "": 606 self.node_subtype = subtype 607 supermod.docListType.__init__(self, listitem) 608 609 610supermod.docListType.subclass = docListTypeSub 611# end class docListTypeSub 612 613 614class docListItemTypeSub(supermod.docListItemType): 615 616 node_type = "doclistitem" 617 618 def __init__(self, para=None): 619 supermod.docListItemType.__init__(self, para) 620 621 622supermod.docListItemType.subclass = docListItemTypeSub 623# end class docListItemTypeSub 624 625 626class docSimpleSectTypeSub(supermod.docSimpleSectType): 627 628 node_type = "docsimplesect" 629 630 def __init__(self, kind=None, title=None, para=None): 631 supermod.docSimpleSectType.__init__(self, kind, title, para) 632 633 634supermod.docSimpleSectType.subclass = docSimpleSectTypeSub 635# end class docSimpleSectTypeSub 636 637 638class docVarListEntryTypeSub(supermod.docVarListEntryType): 639 640 node_type = "docvarlistentry" 641 642 def __init__(self, term=None): 643 supermod.docVarListEntryType.__init__(self, term) 644 645 def buildChildren(self, child_, nodeName_): 646 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'term': 647 obj_ = supermod.docTitleType.factory() 648 obj_.build(child_) 649 self.set_term(obj_) 650 651 652supermod.docVarListEntryType.subclass = docVarListEntryTypeSub 653# end class docVarListEntryTypeSub 654 655 656class docRefTextTypeSub(supermod.docRefTextType): 657 658 node_type = "docreftext" 659 660 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, 661 content_=None): 662 supermod.docRefTextType.__init__(self, mixedclass_, content_) 663 664 self.para = [] 665 666 def buildChildren(self, child_, nodeName_): 667 supermod.docRefTextType.buildChildren(self, child_, nodeName_) 668 669 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'para': 670 obj_ = supermod.docParaType.factory() 671 obj_.build(child_) 672 self.para.append(obj_) 673 674 675supermod.docRefTextType.subclass = docRefTextTypeSub 676# end class docRefTextTypeSub 677 678 679class docTableTypeSub(supermod.docTableType): 680 681 node_type = "doctable" 682 683 def __init__(self, rows=None, cols=None, row=None, caption=None): 684 supermod.docTableType.__init__(self, rows, cols, row, caption) 685 686 687supermod.docTableType.subclass = docTableTypeSub 688# end class docTableTypeSub 689 690 691class docRowTypeSub(supermod.docRowType): 692 693 node_type = "docrow" 694 695 def __init__(self, entry=None): 696 supermod.docRowType.__init__(self, entry) 697 698 699supermod.docRowType.subclass = docRowTypeSub 700# end class docRowTypeSub 701 702 703class docEntryTypeSub(supermod.docEntryType): 704 705 node_type = "docentry" 706 707 def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None): 708 supermod.docEntryType.__init__(self, thead, align, rowspan, colspan, para) 709 710 711supermod.docEntryType.subclass = docEntryTypeSub 712# end class docEntryTypeSub 713 714 715class docHeadingTypeSub(supermod.docHeadingType): 716 717 node_type = "docheading" 718 719 def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None): 720 supermod.docHeadingType.__init__(self, mixedclass_, content_) 721 722 def buildChildren(self, child_, nodeName_): 723 supermod.docHeadingType.buildChildren(self, child_, nodeName_) 724 725 # Account for styled content in the heading. This might need to be expanded to include other 726 # nodes as it seems from the xsd that headings can have a lot of different children but we 727 # really don't expect most of them to come up. 728 if child_.nodeType == Node.ELEMENT_NODE and ( 729 nodeName_ == 'bold' or 730 nodeName_ == 'emphasis' or 731 nodeName_ == 'computeroutput' or 732 nodeName_ == 'subscript' or 733 nodeName_ == 'superscript' or 734 nodeName_ == 'center' or 735 nodeName_ == 'small'): 736 obj_ = supermod.docMarkupType.factory() 737 obj_.build(child_) 738 obj_.type_ = nodeName_ 739 self.content_.append(obj_) 740 741 742supermod.docHeadingType.subclass = docHeadingTypeSub 743# end class docHeadingTypeSub 744 745 746class docImageTypeSub(supermod.docImageType): 747 748 node_type = "docimage" 749 750 def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', 751 mixedclass_=None, content_=None): 752 supermod.docImageType.__init__(self, mixedclass_, content_) 753 754 755supermod.docImageType.subclass = docImageTypeSub 756# end class docImageTypeSub 757 758 759class docDotFileTypeSub(supermod.docDotFileType): 760 761 node_type = "docdocfile" 762 763 def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None): 764 supermod.docDotFileType.__init__(self, mixedclass_, content_) 765 766 767supermod.docDotFileType.subclass = docDotFileTypeSub 768# end class docDotFileTypeSub 769 770 771class docTocItemTypeSub(supermod.docTocItemType): 772 773 node_type = "doctocitem" 774 775 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 776 supermod.docTocItemType.__init__(self, mixedclass_, content_) 777 778 779supermod.docTocItemType.subclass = docTocItemTypeSub 780# end class docTocItemTypeSub 781 782 783class docTocListTypeSub(supermod.docTocListType): 784 785 node_type = "doctoclist" 786 787 def __init__(self, tocitem=None): 788 supermod.docTocListType.__init__(self, tocitem) 789 790 791supermod.docTocListType.subclass = docTocListTypeSub 792# end class docTocListTypeSub 793 794 795class docLanguageTypeSub(supermod.docLanguageType): 796 797 node_type = "doclanguage" 798 799 def __init__(self, langid=None, para=None): 800 supermod.docLanguageType.__init__(self, langid, para) 801 802 803supermod.docLanguageType.subclass = docLanguageTypeSub 804# end class docLanguageTypeSub 805 806 807class docParamListTypeSub(supermod.docParamListType): 808 809 node_type = "docparamlist" 810 811 def __init__(self, kind=None, parameteritem=None): 812 supermod.docParamListType.__init__(self, kind, parameteritem) 813 814 815supermod.docParamListType.subclass = docParamListTypeSub 816# end class docParamListTypeSub 817 818 819class docParamListItemSub(supermod.docParamListItem): 820 821 node_type = "docparamlistitem" 822 823 def __init__(self, parameternamelist=None, parameterdescription=None): 824 supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription) 825 826 827supermod.docParamListItem.subclass = docParamListItemSub 828# end class docParamListItemSub 829 830 831class docParamNameListSub(supermod.docParamNameList): 832 833 node_type = "docparamnamelist" 834 835 def __init__(self, parametername=None): 836 supermod.docParamNameList.__init__(self, parametername) 837 838 839supermod.docParamNameList.subclass = docParamNameListSub 840# end class docParamNameListSub 841 842 843class docParamNameSub(supermod.docParamName): 844 845 node_type = "docparamname" 846 847 def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None): 848 supermod.docParamName.__init__(self, mixedclass_, content_) 849 850 851supermod.docParamName.subclass = docParamNameSub 852# end class docParamNameSub 853 854 855class docXRefSectTypeSub(supermod.docXRefSectType): 856 857 node_type = "docxrefsect" 858 859 def __init__(self, id=None, xreftitle=None, xrefdescription=None): 860 supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription) 861 862 863supermod.docXRefSectType.subclass = docXRefSectTypeSub 864# end class docXRefSectTypeSub 865 866 867class docVariableListTypeSub(supermod.docVariableListType): 868 869 node_type = "docvariablelist" 870 871 def __init__(self, valueOf_=''): 872 supermod.docVariableListType.__init__(self, valueOf_) 873 874 self.varlistentries = [] 875 self.listitems = [] 876 877 def buildChildren(self, child_, nodeName_): 878 supermod.docVariableListType.buildChildren(self, child_, nodeName_) 879 880 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "varlistentry": 881 obj_ = supermod.docVarListEntryType.factory() 882 obj_.build(child_) 883 self.varlistentries.append(obj_) 884 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listitem": 885 obj_ = supermod.docListItemType.factory() 886 obj_.build(child_) 887 self.listitems.append(obj_) 888 889 890supermod.docVariableListType.subclass = docVariableListTypeSub 891# end class docVariableListTypeSub 892 893 894class docCopyTypeSub(supermod.docCopyType): 895 896 node_type = "doccopy" 897 898 def __init__(self, link=None, para=None, sect1=None, internal=None): 899 supermod.docCopyType.__init__(self, link, para, sect1, internal) 900 901 902supermod.docCopyType.subclass = docCopyTypeSub 903# end class docCopyTypeSub 904 905 906class docCharTypeSub(supermod.docCharType): 907 908 node_type = "docchar" 909 910 def __init__(self, char=None, valueOf_=''): 911 supermod.docCharType.__init__(self, char) 912 913 914supermod.docCharType.subclass = docCharTypeSub 915# end class docCharTypeSub 916 917 918class verbatimTypeSub(object): 919 """ 920 New node type. Structure is largely pillaged from other nodes in order to 921 match the set. 922 """ 923 924 node_type = "verbatim" 925 926 def __init__(self, valueOf_='', mixedclass_=None, content_=None): 927 if mixedclass_ is None: 928 self.mixedclass_ = MixedContainer 929 else: 930 self.mixedclass_ = mixedclass_ 931 if content_ is None: 932 self.content_ = [] 933 else: 934 self.content_ = content_ 935 self.text = "" 936 937 def factory(*args, **kwargs): 938 return verbatimTypeSub(*args, **kwargs) 939 940 factory = staticmethod(factory) 941 942 def buildAttributes(self, attrs): 943 pass 944 945 def build(self, node_): 946 attrs = node_.attributes 947 self.buildAttributes(attrs) 948 self.valueOf_ = '' 949 for child_ in node_.childNodes: 950 nodeName_ = child_.nodeName.split(':')[-1] 951 self.buildChildren(child_, nodeName_) 952 953 def buildChildren(self, child_, nodeName_): 954 if child_.nodeType == Node.TEXT_NODE: 955 self.text += child_.nodeValue 956 957 958class docParaTypeSub(supermod.docParaType): 959 960 node_type = "docpara" 961 962 def __init__(self, char=None, valueOf_=''): 963 supermod.docParaType.__init__(self, char) 964 965 self.parameterlist = [] 966 self.simplesects = [] 967 self.content = [] 968 self.programlisting = [] 969 self.images = [] 970 971 self.ordered_children = [] 972 973 def buildChildren(self, child_, nodeName_): 974 supermod.docParaType.buildChildren(self, child_, nodeName_) 975 976 if child_.nodeType == Node.TEXT_NODE: 977 obj_ = self.mixedclass_(MixedContainer.CategoryText, 978 MixedContainer.TypeNone, '', child_.nodeValue) 979 self.content.append(obj_) 980 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": 981 obj_ = supermod.docRefTextType.factory() 982 obj_.build(child_) 983 self.content.append(obj_) 984 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'parameterlist': 985 obj_ = supermod.docParamListType.factory() 986 obj_.build(child_) 987 self.parameterlist.append(obj_) 988 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'simplesect': 989 obj_ = supermod.docSimpleSectType.factory() 990 obj_.build(child_) 991 self.simplesects.append(obj_) 992 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'programlisting': 993 obj_ = supermod.listingType.factory() 994 obj_.build(child_) 995 # Add programlisting nodes to self.content rather than self.programlisting, 996 # because programlisting and content nodes can interleave as shown in 997 # https://www.stack.nl/~dimitri/doxygen/manual/examples/include/html/example.html. 998 self.content.append(obj_) 999 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'image': 1000 obj_ = supermod.docImageType.factory() 1001 obj_.build(child_) 1002 self.images.append(obj_) 1003 elif child_.nodeType == Node.ELEMENT_NODE and ( 1004 nodeName_ == 'bold' or 1005 nodeName_ == 'emphasis' or 1006 nodeName_ == 'computeroutput' or 1007 nodeName_ == 'subscript' or 1008 nodeName_ == 'superscript' or 1009 nodeName_ == 'center' or 1010 nodeName_ == 'small'): 1011 obj_ = supermod.docMarkupType.factory() 1012 obj_.build(child_) 1013 obj_.type_ = nodeName_ 1014 self.content.append(obj_) 1015 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'verbatim': 1016 childobj_ = verbatimTypeSub.factory() 1017 childobj_.build(child_) 1018 obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 1019 'verbatim', childobj_) 1020 self.content.append(obj_) 1021 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'formula': 1022 childobj_ = docFormulaTypeSub.factory() 1023 childobj_.build(child_) 1024 obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 1025 'formula', childobj_) 1026 self.content.append(obj_) 1027 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "itemizedlist": 1028 obj_ = supermod.docListType.factory(subtype="itemized") 1029 obj_.build(child_) 1030 self.content.append(obj_) 1031 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "orderedlist": 1032 obj_ = supermod.docListType.factory(subtype="ordered") 1033 obj_.build(child_) 1034 self.content.append(obj_) 1035 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'heading': 1036 obj_ = supermod.docHeadingType.factory() 1037 obj_.build(child_) 1038 self.content.append(obj_) 1039 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'ulink': 1040 obj_ = supermod.docURLLink.factory() 1041 obj_.build(child_) 1042 self.content.append(obj_) 1043 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xrefsect": 1044 obj_ = supermod.docXRefSectType.factory() 1045 obj_.build(child_) 1046 self.content.append(obj_) 1047 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "variablelist": 1048 obj_ = supermod.docVariableListType.factory() 1049 obj_.build(child_) 1050 self.content.append(obj_) 1051 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor": 1052 obj_ = supermod.docAnchorType.factory() 1053 obj_.build(child_) 1054 self.content.append(obj_) 1055 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parblock": 1056 obj_ = supermod.docParBlockType.factory() 1057 obj_.build(child_) 1058 self.content.append(obj_) 1059 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "table": 1060 obj_ = supermod.docTableType.factory() 1061 obj_.build(child_) 1062 self.content.append(obj_) 1063 else: 1064 obj_ = None 1065 1066 if obj_: 1067 self.ordered_children.append(obj_) 1068 1069 1070supermod.docParaType.subclass = docParaTypeSub 1071# end class docParaTypeSub 1072 1073 1074class docParBlockTypeSub(supermod.docParBlockType): 1075 1076 node_type = "docparblock" 1077 1078 def __init__(self, para=None): 1079 supermod.docParBlockType.__init__(self, para) 1080 1081 def buildChildren(self, child_, nodeName_): 1082 supermod.docParBlockType.buildChildren(self, child_, nodeName_) 1083 1084 1085supermod.docParBlockType.subclass = docParBlockTypeSub 1086# end class docParBlockTypeSub 1087 1088 1089class docMarkupTypeSub(supermod.docMarkupType): 1090 1091 node_type = "docmarkup" 1092 1093 def __init__(self, valueOf_='', mixedclass_=None, content_=None): 1094 supermod.docMarkupType.__init__(self, valueOf_, mixedclass_, content_) 1095 self.type_ = None 1096 1097 def buildChildren(self, child_, nodeName_): 1098 if child_.nodeType == Node.TEXT_NODE: 1099 obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', 1100 child_.nodeValue) 1101 self.content_.append(obj_) 1102 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == 'ref': 1103 childobj_ = supermod.docRefTextType.factory() 1104 childobj_.build(child_) 1105 obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'ref', 1106 childobj_) 1107 self.content_.append(obj_) 1108 if child_.nodeType == Node.TEXT_NODE: 1109 self.valueOf_ += child_.nodeValue 1110 elif child_.nodeType == Node.CDATA_SECTION_NODE: 1111 self.valueOf_ += '![CDATA[' + child_.nodeValue + ']]' 1112 1113 1114supermod.docMarkupType.subclass = docMarkupTypeSub 1115# end class docMarkupTypeSub 1116 1117 1118class docTitleTypeSub(supermod.docTitleType): 1119 1120 node_type = "doctitle" 1121 1122 def __init__(self, valueOf_='', mixedclass_=None, content_=None): 1123 supermod.docTitleType.__init__(self, valueOf_, mixedclass_, content_) 1124 self.type_ = None 1125 1126 def buildChildren(self, child_, nodeName_): 1127 supermod.docTitleType.buildChildren(self, child_, nodeName_) 1128 1129 if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": 1130 obj_ = supermod.docRefTextType.factory() 1131 obj_.build(child_) 1132 self.content_.append(obj_) 1133 self.valueOf_ += obj_.valueOf_ 1134 elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor": 1135 obj_ = supermod.docAnchorType.factory() 1136 obj_.build(child_) 1137 self.content_.append(obj_) 1138 1139 1140supermod.docTitleType.subclass = docTitleTypeSub 1141# end class docTitleTypeSub 1142 1143 1144class ParseError(Exception): 1145 pass 1146 1147 1148class FileIOError(Exception): 1149 pass 1150 1151 1152def parse(inFilename): 1153 1154 try: 1155 doc = minidom.parse(inFilename) 1156 except IOError as e: 1157 raise FileIOError(e) 1158 except ExpatError as e: 1159 raise ParseError(e) 1160 1161 rootNode = doc.documentElement 1162 rootObj = supermod.DoxygenType.factory() 1163 rootObj.build(rootNode) 1164 return rootObj 1165