How to use showIndent method in autotest

Best Python code snippet using autotest_python

compoundsuper.py

Source:compoundsuper.py Github

copy

Full Screen

...45ExternalEncoding = 'ascii'46#47# Support/utility functions.48#49def showIndent(outfile, level):50 for idx in range(level):51 outfile.write(' ')52def quote_xml(inStr):53 s1 = (isinstance(inStr, basestring) and inStr or54 '%s' % inStr)55 s1 = s1.replace('&', '&amp;')56 s1 = s1.replace('<', '&lt;')57 s1 = s1.replace('>', '&gt;')58 return s159def quote_attrib(inStr):60 s1 = (isinstance(inStr, basestring) and inStr or61 '%s' % inStr)62 s1 = s1.replace('&', '&amp;')63 s1 = s1.replace('<', '&lt;')64 s1 = s1.replace('>', '&gt;')65 if '"' in s1:66 if "'" in s1:67 s1 = '"%s"' % s1.replace('"', "&quot;")68 else:69 s1 = "'%s'" % s170 else:71 s1 = '"%s"' % s172 return s173def quote_python(inStr):74 s1 = inStr75 if s1.find("'") == -1:76 if s1.find('\n') == -1:77 return "'%s'" % s178 else:79 return "'''%s'''" % s180 else:81 if s1.find('"') != -1:82 s1 = s1.replace('"', '\\"')83 if s1.find('\n') == -1:84 return '"%s"' % s185 else:86 return '"""%s"""' % s187class MixedContainer:88 # Constants for category:89 CategoryNone = 090 CategoryText = 191 CategorySimple = 292 CategoryComplex = 393 # Constants for content_type:94 TypeNone = 095 TypeText = 196 TypeString = 297 TypeInteger = 398 TypeFloat = 499 TypeDecimal = 5100 TypeDouble = 6101 TypeBoolean = 7102 def __init__(self, category, content_type, name, value):103 self.category = category104 self.content_type = content_type105 self.name = name106 self.value = value107 def getCategory(self):108 return self.category109 def getContenttype(self, content_type):110 return self.content_type111 def getValue(self):112 return self.value113 def getName(self):114 return self.name115 def export(self, outfile, level, name, namespace):116 if self.category == MixedContainer.CategoryText:117 outfile.write(self.value)118 elif self.category == MixedContainer.CategorySimple:119 self.exportSimple(outfile, level, name)120 else: # category == MixedContainer.CategoryComplex121 self.value.export(outfile, level, namespace,name)122 def exportSimple(self, outfile, level, name):123 if self.content_type == MixedContainer.TypeString:124 outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))125 elif self.content_type == MixedContainer.TypeInteger or \126 self.content_type == MixedContainer.TypeBoolean:127 outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))128 elif self.content_type == MixedContainer.TypeFloat or \129 self.content_type == MixedContainer.TypeDecimal:130 outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))131 elif self.content_type == MixedContainer.TypeDouble:132 outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))133 def exportLiteral(self, outfile, level, name):134 if self.category == MixedContainer.CategoryText:135 showIndent(outfile, level)136 outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \137 (self.category, self.content_type, self.name, self.value))138 elif self.category == MixedContainer.CategorySimple:139 showIndent(outfile, level)140 outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \141 (self.category, self.content_type, self.name, self.value))142 else: # category == MixedContainer.CategoryComplex143 showIndent(outfile, level)144 outfile.write('MixedContainer(%d, %d, "%s",\n' % \145 (self.category, self.content_type, self.name,))146 self.value.exportLiteral(outfile, level + 1)147 showIndent(outfile, level)148 outfile.write(')\n')149class _MemberSpec(object):150 def __init__(self, name='', data_type='', container=0):151 self.name = name152 self.data_type = data_type153 self.container = container154 def set_name(self, name): self.name = name155 def get_name(self): return self.name156 def set_data_type(self, data_type): self.data_type = data_type157 def get_data_type(self): return self.data_type158 def set_container(self, container): self.container = container159 def get_container(self): return self.container160#161# Data representation classes.162#163class DoxygenType(GeneratedsSuper):164 subclass = None165 superclass = None166 def __init__(self, version=None, compounddef=None):167 self.version = version168 self.compounddef = compounddef169 def factory(*args_, **kwargs_):170 if DoxygenType.subclass:171 return DoxygenType.subclass(*args_, **kwargs_)172 else:173 return DoxygenType(*args_, **kwargs_)174 factory = staticmethod(factory)175 def get_compounddef(self): return self.compounddef176 def set_compounddef(self, compounddef): self.compounddef = compounddef177 def get_version(self): return self.version178 def set_version(self, version): self.version = version179 def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''):180 showIndent(outfile, level)181 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))182 self.exportAttributes(outfile, level, namespace_, name_='DoxygenType')183 if self.hasContent_():184 outfile.write('>\n')185 self.exportChildren(outfile, level + 1, namespace_, name_)186 showIndent(outfile, level)187 outfile.write('</%s%s>\n' % (namespace_, name_))188 else:189 outfile.write(' />\n')190 def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'):191 outfile.write(' version=%s' % (quote_attrib(self.version), ))192 def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'):193 if self.compounddef:194 self.compounddef.export(outfile, level, namespace_, name_='compounddef')195 def hasContent_(self):196 if (197 self.compounddef is not None198 ):199 return True200 else:201 return False202 def exportLiteral(self, outfile, level, name_='DoxygenType'):203 level += 1204 self.exportLiteralAttributes(outfile, level, name_)205 if self.hasContent_():206 self.exportLiteralChildren(outfile, level, name_)207 def exportLiteralAttributes(self, outfile, level, name_):208 if self.version is not None:209 showIndent(outfile, level)210 outfile.write('version = "%s",\n' % (self.version,))211 def exportLiteralChildren(self, outfile, level, name_):212 if self.compounddef:213 showIndent(outfile, level)214 outfile.write('compounddef=model_.compounddefType(\n')215 self.compounddef.exportLiteral(outfile, level, name_='compounddef')216 showIndent(outfile, level)217 outfile.write('),\n')218 def build(self, node_):219 attrs = node_.attributes220 self.buildAttributes(attrs)221 for child_ in node_.childNodes:222 nodeName_ = child_.nodeName.split(':')[-1]223 self.buildChildren(child_, nodeName_)224 def buildAttributes(self, attrs):225 if attrs.get('version'):226 self.version = attrs.get('version').value227 def buildChildren(self, child_, nodeName_):228 if child_.nodeType == Node.ELEMENT_NODE and \229 nodeName_ == 'compounddef':230 obj_ = compounddefType.factory()231 obj_.build(child_)232 self.set_compounddef(obj_)233# end class DoxygenType234class compounddefType(GeneratedsSuper):235 subclass = None236 superclass = None237 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):238 self.kind = kind239 self.prot = prot240 self.id = id241 self.compoundname = compoundname242 self.title = title243 if basecompoundref is None:244 self.basecompoundref = []245 else:246 self.basecompoundref = basecompoundref247 if derivedcompoundref is None:248 self.derivedcompoundref = []249 else:250 self.derivedcompoundref = derivedcompoundref251 if includes is None:252 self.includes = []253 else:254 self.includes = includes255 if includedby is None:256 self.includedby = []257 else:258 self.includedby = includedby259 self.incdepgraph = incdepgraph260 self.invincdepgraph = invincdepgraph261 if innerdir is None:262 self.innerdir = []263 else:264 self.innerdir = innerdir265 if innerfile is None:266 self.innerfile = []267 else:268 self.innerfile = innerfile269 if innerclass is None:270 self.innerclass = []271 else:272 self.innerclass = innerclass273 if innernamespace is None:274 self.innernamespace = []275 else:276 self.innernamespace = innernamespace277 if innerpage is None:278 self.innerpage = []279 else:280 self.innerpage = innerpage281 if innergroup is None:282 self.innergroup = []283 else:284 self.innergroup = innergroup285 self.templateparamlist = templateparamlist286 if sectiondef is None:287 self.sectiondef = []288 else:289 self.sectiondef = sectiondef290 self.briefdescription = briefdescription291 self.detaileddescription = detaileddescription292 self.inheritancegraph = inheritancegraph293 self.collaborationgraph = collaborationgraph294 self.programlisting = programlisting295 self.location = location296 self.listofallmembers = listofallmembers297 def factory(*args_, **kwargs_):298 if compounddefType.subclass:299 return compounddefType.subclass(*args_, **kwargs_)300 else:301 return compounddefType(*args_, **kwargs_)302 factory = staticmethod(factory)303 def get_compoundname(self): return self.compoundname304 def set_compoundname(self, compoundname): self.compoundname = compoundname305 def get_title(self): return self.title306 def set_title(self, title): self.title = title307 def get_basecompoundref(self): return self.basecompoundref308 def set_basecompoundref(self, basecompoundref): self.basecompoundref = basecompoundref309 def add_basecompoundref(self, value): self.basecompoundref.append(value)310 def insert_basecompoundref(self, index, value): self.basecompoundref[index] = value311 def get_derivedcompoundref(self): return self.derivedcompoundref312 def set_derivedcompoundref(self, derivedcompoundref): self.derivedcompoundref = derivedcompoundref313 def add_derivedcompoundref(self, value): self.derivedcompoundref.append(value)314 def insert_derivedcompoundref(self, index, value): self.derivedcompoundref[index] = value315 def get_includes(self): return self.includes316 def set_includes(self, includes): self.includes = includes317 def add_includes(self, value): self.includes.append(value)318 def insert_includes(self, index, value): self.includes[index] = value319 def get_includedby(self): return self.includedby320 def set_includedby(self, includedby): self.includedby = includedby321 def add_includedby(self, value): self.includedby.append(value)322 def insert_includedby(self, index, value): self.includedby[index] = value323 def get_incdepgraph(self): return self.incdepgraph324 def set_incdepgraph(self, incdepgraph): self.incdepgraph = incdepgraph325 def get_invincdepgraph(self): return self.invincdepgraph326 def set_invincdepgraph(self, invincdepgraph): self.invincdepgraph = invincdepgraph327 def get_innerdir(self): return self.innerdir328 def set_innerdir(self, innerdir): self.innerdir = innerdir329 def add_innerdir(self, value): self.innerdir.append(value)330 def insert_innerdir(self, index, value): self.innerdir[index] = value331 def get_innerfile(self): return self.innerfile332 def set_innerfile(self, innerfile): self.innerfile = innerfile333 def add_innerfile(self, value): self.innerfile.append(value)334 def insert_innerfile(self, index, value): self.innerfile[index] = value335 def get_innerclass(self): return self.innerclass336 def set_innerclass(self, innerclass): self.innerclass = innerclass337 def add_innerclass(self, value): self.innerclass.append(value)338 def insert_innerclass(self, index, value): self.innerclass[index] = value339 def get_innernamespace(self): return self.innernamespace340 def set_innernamespace(self, innernamespace): self.innernamespace = innernamespace341 def add_innernamespace(self, value): self.innernamespace.append(value)342 def insert_innernamespace(self, index, value): self.innernamespace[index] = value343 def get_innerpage(self): return self.innerpage344 def set_innerpage(self, innerpage): self.innerpage = innerpage345 def add_innerpage(self, value): self.innerpage.append(value)346 def insert_innerpage(self, index, value): self.innerpage[index] = value347 def get_innergroup(self): return self.innergroup348 def set_innergroup(self, innergroup): self.innergroup = innergroup349 def add_innergroup(self, value): self.innergroup.append(value)350 def insert_innergroup(self, index, value): self.innergroup[index] = value351 def get_templateparamlist(self): return self.templateparamlist352 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist353 def get_sectiondef(self): return self.sectiondef354 def set_sectiondef(self, sectiondef): self.sectiondef = sectiondef355 def add_sectiondef(self, value): self.sectiondef.append(value)356 def insert_sectiondef(self, index, value): self.sectiondef[index] = value357 def get_briefdescription(self): return self.briefdescription358 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription359 def get_detaileddescription(self): return self.detaileddescription360 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription361 def get_inheritancegraph(self): return self.inheritancegraph362 def set_inheritancegraph(self, inheritancegraph): self.inheritancegraph = inheritancegraph363 def get_collaborationgraph(self): return self.collaborationgraph364 def set_collaborationgraph(self, collaborationgraph): self.collaborationgraph = collaborationgraph365 def get_programlisting(self): return self.programlisting366 def set_programlisting(self, programlisting): self.programlisting = programlisting367 def get_location(self): return self.location368 def set_location(self, location): self.location = location369 def get_listofallmembers(self): return self.listofallmembers370 def set_listofallmembers(self, listofallmembers): self.listofallmembers = listofallmembers371 def get_kind(self): return self.kind372 def set_kind(self, kind): self.kind = kind373 def get_prot(self): return self.prot374 def set_prot(self, prot): self.prot = prot375 def get_id(self): return self.id376 def set_id(self, id): self.id = id377 def export(self, outfile, level, namespace_='', name_='compounddefType', namespacedef_=''):378 showIndent(outfile, level)379 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))380 self.exportAttributes(outfile, level, namespace_, name_='compounddefType')381 if self.hasContent_():382 outfile.write('>\n')383 self.exportChildren(outfile, level + 1, namespace_, name_)384 showIndent(outfile, level)385 outfile.write('</%s%s>\n' % (namespace_, name_))386 else:387 outfile.write(' />\n')388 def exportAttributes(self, outfile, level, namespace_='', name_='compounddefType'):389 if self.kind is not None:390 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))391 if self.prot is not None:392 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))393 if self.id is not None:394 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))395 def exportChildren(self, outfile, level, namespace_='', name_='compounddefType'):396 if self.compoundname is not None:397 showIndent(outfile, level)398 outfile.write('<%scompoundname>%s</%scompoundname>\n' % (namespace_, self.format_string(quote_xml(self.compoundname).encode(ExternalEncoding), input_name='compoundname'), namespace_))399 if self.title is not None:400 showIndent(outfile, level)401 outfile.write('<%stitle>%s</%stitle>\n' % (namespace_, self.format_string(quote_xml(self.title).encode(ExternalEncoding), input_name='title'), namespace_))402 for basecompoundref_ in self.basecompoundref:403 basecompoundref_.export(outfile, level, namespace_, name_='basecompoundref')404 for derivedcompoundref_ in self.derivedcompoundref:405 derivedcompoundref_.export(outfile, level, namespace_, name_='derivedcompoundref')406 for includes_ in self.includes:407 includes_.export(outfile, level, namespace_, name_='includes')408 for includedby_ in self.includedby:409 includedby_.export(outfile, level, namespace_, name_='includedby')410 if self.incdepgraph:411 self.incdepgraph.export(outfile, level, namespace_, name_='incdepgraph')412 if self.invincdepgraph:413 self.invincdepgraph.export(outfile, level, namespace_, name_='invincdepgraph')414 for innerdir_ in self.innerdir:415 innerdir_.export(outfile, level, namespace_, name_='innerdir')416 for innerfile_ in self.innerfile:417 innerfile_.export(outfile, level, namespace_, name_='innerfile')418 for innerclass_ in self.innerclass:419 innerclass_.export(outfile, level, namespace_, name_='innerclass')420 for innernamespace_ in self.innernamespace:421 innernamespace_.export(outfile, level, namespace_, name_='innernamespace')422 for innerpage_ in self.innerpage:423 innerpage_.export(outfile, level, namespace_, name_='innerpage')424 for innergroup_ in self.innergroup:425 innergroup_.export(outfile, level, namespace_, name_='innergroup')426 if self.templateparamlist:427 self.templateparamlist.export(outfile, level, namespace_, name_='templateparamlist')428 for sectiondef_ in self.sectiondef:429 sectiondef_.export(outfile, level, namespace_, name_='sectiondef')430 if self.briefdescription:431 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')432 if self.detaileddescription:433 self.detaileddescription.export(outfile, level, namespace_, name_='detaileddescription')434 if self.inheritancegraph:435 self.inheritancegraph.export(outfile, level, namespace_, name_='inheritancegraph')436 if self.collaborationgraph:437 self.collaborationgraph.export(outfile, level, namespace_, name_='collaborationgraph')438 if self.programlisting:439 self.programlisting.export(outfile, level, namespace_, name_='programlisting')440 if self.location:441 self.location.export(outfile, level, namespace_, name_='location')442 if self.listofallmembers:443 self.listofallmembers.export(outfile, level, namespace_, name_='listofallmembers')444 def hasContent_(self):445 if (446 self.compoundname is not None or447 self.title is not None or448 self.basecompoundref is not None or449 self.derivedcompoundref is not None or450 self.includes is not None or451 self.includedby is not None or452 self.incdepgraph is not None or453 self.invincdepgraph is not None or454 self.innerdir is not None or455 self.innerfile is not None or456 self.innerclass is not None or457 self.innernamespace is not None or458 self.innerpage is not None or459 self.innergroup is not None or460 self.templateparamlist is not None or461 self.sectiondef is not None or462 self.briefdescription is not None or463 self.detaileddescription is not None or464 self.inheritancegraph is not None or465 self.collaborationgraph is not None or466 self.programlisting is not None or467 self.location is not None or468 self.listofallmembers is not None469 ):470 return True471 else:472 return False473 def exportLiteral(self, outfile, level, name_='compounddefType'):474 level += 1475 self.exportLiteralAttributes(outfile, level, name_)476 if self.hasContent_():477 self.exportLiteralChildren(outfile, level, name_)478 def exportLiteralAttributes(self, outfile, level, name_):479 if self.kind is not None:480 showIndent(outfile, level)481 outfile.write('kind = "%s",\n' % (self.kind,))482 if self.prot is not None:483 showIndent(outfile, level)484 outfile.write('prot = "%s",\n' % (self.prot,))485 if self.id is not None:486 showIndent(outfile, level)487 outfile.write('id = %s,\n' % (self.id,))488 def exportLiteralChildren(self, outfile, level, name_):489 showIndent(outfile, level)490 outfile.write('compoundname=%s,\n' % quote_python(self.compoundname).encode(ExternalEncoding))491 if self.title:492 showIndent(outfile, level)493 outfile.write('title=model_.xsd_string(\n')494 self.title.exportLiteral(outfile, level, name_='title')495 showIndent(outfile, level)496 outfile.write('),\n')497 showIndent(outfile, level)498 outfile.write('basecompoundref=[\n')499 level += 1500 for basecompoundref in self.basecompoundref:501 showIndent(outfile, level)502 outfile.write('model_.basecompoundref(\n')503 basecompoundref.exportLiteral(outfile, level, name_='basecompoundref')504 showIndent(outfile, level)505 outfile.write('),\n')506 level -= 1507 showIndent(outfile, level)508 outfile.write('],\n')509 showIndent(outfile, level)510 outfile.write('derivedcompoundref=[\n')511 level += 1512 for derivedcompoundref in self.derivedcompoundref:513 showIndent(outfile, level)514 outfile.write('model_.derivedcompoundref(\n')515 derivedcompoundref.exportLiteral(outfile, level, name_='derivedcompoundref')516 showIndent(outfile, level)517 outfile.write('),\n')518 level -= 1519 showIndent(outfile, level)520 outfile.write('],\n')521 showIndent(outfile, level)522 outfile.write('includes=[\n')523 level += 1524 for includes in self.includes:525 showIndent(outfile, level)526 outfile.write('model_.includes(\n')527 includes.exportLiteral(outfile, level, name_='includes')528 showIndent(outfile, level)529 outfile.write('),\n')530 level -= 1531 showIndent(outfile, level)532 outfile.write('],\n')533 showIndent(outfile, level)534 outfile.write('includedby=[\n')535 level += 1536 for includedby in self.includedby:537 showIndent(outfile, level)538 outfile.write('model_.includedby(\n')539 includedby.exportLiteral(outfile, level, name_='includedby')540 showIndent(outfile, level)541 outfile.write('),\n')542 level -= 1543 showIndent(outfile, level)544 outfile.write('],\n')545 if self.incdepgraph:546 showIndent(outfile, level)547 outfile.write('incdepgraph=model_.graphType(\n')548 self.incdepgraph.exportLiteral(outfile, level, name_='incdepgraph')549 showIndent(outfile, level)550 outfile.write('),\n')551 if self.invincdepgraph:552 showIndent(outfile, level)553 outfile.write('invincdepgraph=model_.graphType(\n')554 self.invincdepgraph.exportLiteral(outfile, level, name_='invincdepgraph')555 showIndent(outfile, level)556 outfile.write('),\n')557 showIndent(outfile, level)558 outfile.write('innerdir=[\n')559 level += 1560 for innerdir in self.innerdir:561 showIndent(outfile, level)562 outfile.write('model_.innerdir(\n')563 innerdir.exportLiteral(outfile, level, name_='innerdir')564 showIndent(outfile, level)565 outfile.write('),\n')566 level -= 1567 showIndent(outfile, level)568 outfile.write('],\n')569 showIndent(outfile, level)570 outfile.write('innerfile=[\n')571 level += 1572 for innerfile in self.innerfile:573 showIndent(outfile, level)574 outfile.write('model_.innerfile(\n')575 innerfile.exportLiteral(outfile, level, name_='innerfile')576 showIndent(outfile, level)577 outfile.write('),\n')578 level -= 1579 showIndent(outfile, level)580 outfile.write('],\n')581 showIndent(outfile, level)582 outfile.write('innerclass=[\n')583 level += 1584 for innerclass in self.innerclass:585 showIndent(outfile, level)586 outfile.write('model_.innerclass(\n')587 innerclass.exportLiteral(outfile, level, name_='innerclass')588 showIndent(outfile, level)589 outfile.write('),\n')590 level -= 1591 showIndent(outfile, level)592 outfile.write('],\n')593 showIndent(outfile, level)594 outfile.write('innernamespace=[\n')595 level += 1596 for innernamespace in self.innernamespace:597 showIndent(outfile, level)598 outfile.write('model_.innernamespace(\n')599 innernamespace.exportLiteral(outfile, level, name_='innernamespace')600 showIndent(outfile, level)601 outfile.write('),\n')602 level -= 1603 showIndent(outfile, level)604 outfile.write('],\n')605 showIndent(outfile, level)606 outfile.write('innerpage=[\n')607 level += 1608 for innerpage in self.innerpage:609 showIndent(outfile, level)610 outfile.write('model_.innerpage(\n')611 innerpage.exportLiteral(outfile, level, name_='innerpage')612 showIndent(outfile, level)613 outfile.write('),\n')614 level -= 1615 showIndent(outfile, level)616 outfile.write('],\n')617 showIndent(outfile, level)618 outfile.write('innergroup=[\n')619 level += 1620 for innergroup in self.innergroup:621 showIndent(outfile, level)622 outfile.write('model_.innergroup(\n')623 innergroup.exportLiteral(outfile, level, name_='innergroup')624 showIndent(outfile, level)625 outfile.write('),\n')626 level -= 1627 showIndent(outfile, level)628 outfile.write('],\n')629 if self.templateparamlist:630 showIndent(outfile, level)631 outfile.write('templateparamlist=model_.templateparamlistType(\n')632 self.templateparamlist.exportLiteral(outfile, level, name_='templateparamlist')633 showIndent(outfile, level)634 outfile.write('),\n')635 showIndent(outfile, level)636 outfile.write('sectiondef=[\n')637 level += 1638 for sectiondef in self.sectiondef:639 showIndent(outfile, level)640 outfile.write('model_.sectiondef(\n')641 sectiondef.exportLiteral(outfile, level, name_='sectiondef')642 showIndent(outfile, level)643 outfile.write('),\n')644 level -= 1645 showIndent(outfile, level)646 outfile.write('],\n')647 if self.briefdescription:648 showIndent(outfile, level)649 outfile.write('briefdescription=model_.descriptionType(\n')650 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')651 showIndent(outfile, level)652 outfile.write('),\n')653 if self.detaileddescription:654 showIndent(outfile, level)655 outfile.write('detaileddescription=model_.descriptionType(\n')656 self.detaileddescription.exportLiteral(outfile, level, name_='detaileddescription')657 showIndent(outfile, level)658 outfile.write('),\n')659 if self.inheritancegraph:660 showIndent(outfile, level)661 outfile.write('inheritancegraph=model_.graphType(\n')662 self.inheritancegraph.exportLiteral(outfile, level, name_='inheritancegraph')663 showIndent(outfile, level)664 outfile.write('),\n')665 if self.collaborationgraph:666 showIndent(outfile, level)667 outfile.write('collaborationgraph=model_.graphType(\n')668 self.collaborationgraph.exportLiteral(outfile, level, name_='collaborationgraph')669 showIndent(outfile, level)670 outfile.write('),\n')671 if self.programlisting:672 showIndent(outfile, level)673 outfile.write('programlisting=model_.listingType(\n')674 self.programlisting.exportLiteral(outfile, level, name_='programlisting')675 showIndent(outfile, level)676 outfile.write('),\n')677 if self.location:678 showIndent(outfile, level)679 outfile.write('location=model_.locationType(\n')680 self.location.exportLiteral(outfile, level, name_='location')681 showIndent(outfile, level)682 outfile.write('),\n')683 if self.listofallmembers:684 showIndent(outfile, level)685 outfile.write('listofallmembers=model_.listofallmembersType(\n')686 self.listofallmembers.exportLiteral(outfile, level, name_='listofallmembers')687 showIndent(outfile, level)688 outfile.write('),\n')689 def build(self, node_):690 attrs = node_.attributes691 self.buildAttributes(attrs)692 for child_ in node_.childNodes:693 nodeName_ = child_.nodeName.split(':')[-1]694 self.buildChildren(child_, nodeName_)695 def buildAttributes(self, attrs):696 if attrs.get('kind'):697 self.kind = attrs.get('kind').value698 if attrs.get('prot'):699 self.prot = attrs.get('prot').value700 if attrs.get('id'):701 self.id = attrs.get('id').value702 def buildChildren(self, child_, nodeName_):703 if child_.nodeType == Node.ELEMENT_NODE and \704 nodeName_ == 'compoundname':705 compoundname_ = ''706 for text__content_ in child_.childNodes:707 compoundname_ += text__content_.nodeValue708 self.compoundname = compoundname_709 elif child_.nodeType == Node.ELEMENT_NODE and \710 nodeName_ == 'title':711 obj_ = docTitleType.factory()712 obj_.build(child_)713 self.set_title(obj_)714 elif child_.nodeType == Node.ELEMENT_NODE and \715 nodeName_ == 'basecompoundref':716 obj_ = compoundRefType.factory()717 obj_.build(child_)718 self.basecompoundref.append(obj_)719 elif child_.nodeType == Node.ELEMENT_NODE and \720 nodeName_ == 'derivedcompoundref':721 obj_ = compoundRefType.factory()722 obj_.build(child_)723 self.derivedcompoundref.append(obj_)724 elif child_.nodeType == Node.ELEMENT_NODE and \725 nodeName_ == 'includes':726 obj_ = incType.factory()727 obj_.build(child_)728 self.includes.append(obj_)729 elif child_.nodeType == Node.ELEMENT_NODE and \730 nodeName_ == 'includedby':731 obj_ = incType.factory()732 obj_.build(child_)733 self.includedby.append(obj_)734 elif child_.nodeType == Node.ELEMENT_NODE and \735 nodeName_ == 'incdepgraph':736 obj_ = graphType.factory()737 obj_.build(child_)738 self.set_incdepgraph(obj_)739 elif child_.nodeType == Node.ELEMENT_NODE and \740 nodeName_ == 'invincdepgraph':741 obj_ = graphType.factory()742 obj_.build(child_)743 self.set_invincdepgraph(obj_)744 elif child_.nodeType == Node.ELEMENT_NODE and \745 nodeName_ == 'innerdir':746 obj_ = refType.factory()747 obj_.build(child_)748 self.innerdir.append(obj_)749 elif child_.nodeType == Node.ELEMENT_NODE and \750 nodeName_ == 'innerfile':751 obj_ = refType.factory()752 obj_.build(child_)753 self.innerfile.append(obj_)754 elif child_.nodeType == Node.ELEMENT_NODE and \755 nodeName_ == 'innerclass':756 obj_ = refType.factory()757 obj_.build(child_)758 self.innerclass.append(obj_)759 elif child_.nodeType == Node.ELEMENT_NODE and \760 nodeName_ == 'innernamespace':761 obj_ = refType.factory()762 obj_.build(child_)763 self.innernamespace.append(obj_)764 elif child_.nodeType == Node.ELEMENT_NODE and \765 nodeName_ == 'innerpage':766 obj_ = refType.factory()767 obj_.build(child_)768 self.innerpage.append(obj_)769 elif child_.nodeType == Node.ELEMENT_NODE and \770 nodeName_ == 'innergroup':771 obj_ = refType.factory()772 obj_.build(child_)773 self.innergroup.append(obj_)774 elif child_.nodeType == Node.ELEMENT_NODE and \775 nodeName_ == 'templateparamlist':776 obj_ = templateparamlistType.factory()777 obj_.build(child_)778 self.set_templateparamlist(obj_)779 elif child_.nodeType == Node.ELEMENT_NODE and \780 nodeName_ == 'sectiondef':781 obj_ = sectiondefType.factory()782 obj_.build(child_)783 self.sectiondef.append(obj_)784 elif child_.nodeType == Node.ELEMENT_NODE and \785 nodeName_ == 'briefdescription':786 obj_ = descriptionType.factory()787 obj_.build(child_)788 self.set_briefdescription(obj_)789 elif child_.nodeType == Node.ELEMENT_NODE and \790 nodeName_ == 'detaileddescription':791 obj_ = descriptionType.factory()792 obj_.build(child_)793 self.set_detaileddescription(obj_)794 elif child_.nodeType == Node.ELEMENT_NODE and \795 nodeName_ == 'inheritancegraph':796 obj_ = graphType.factory()797 obj_.build(child_)798 self.set_inheritancegraph(obj_)799 elif child_.nodeType == Node.ELEMENT_NODE and \800 nodeName_ == 'collaborationgraph':801 obj_ = graphType.factory()802 obj_.build(child_)803 self.set_collaborationgraph(obj_)804 elif child_.nodeType == Node.ELEMENT_NODE and \805 nodeName_ == 'programlisting':806 obj_ = listingType.factory()807 obj_.build(child_)808 self.set_programlisting(obj_)809 elif child_.nodeType == Node.ELEMENT_NODE and \810 nodeName_ == 'location':811 obj_ = locationType.factory()812 obj_.build(child_)813 self.set_location(obj_)814 elif child_.nodeType == Node.ELEMENT_NODE and \815 nodeName_ == 'listofallmembers':816 obj_ = listofallmembersType.factory()817 obj_.build(child_)818 self.set_listofallmembers(obj_)819# end class compounddefType820class listofallmembersType(GeneratedsSuper):821 subclass = None822 superclass = None823 def __init__(self, member=None):824 if member is None:825 self.member = []826 else:827 self.member = member828 def factory(*args_, **kwargs_):829 if listofallmembersType.subclass:830 return listofallmembersType.subclass(*args_, **kwargs_)831 else:832 return listofallmembersType(*args_, **kwargs_)833 factory = staticmethod(factory)834 def get_member(self): return self.member835 def set_member(self, member): self.member = member836 def add_member(self, value): self.member.append(value)837 def insert_member(self, index, value): self.member[index] = value838 def export(self, outfile, level, namespace_='', name_='listofallmembersType', namespacedef_=''):839 showIndent(outfile, level)840 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))841 self.exportAttributes(outfile, level, namespace_, name_='listofallmembersType')842 if self.hasContent_():843 outfile.write('>\n')844 self.exportChildren(outfile, level + 1, namespace_, name_)845 showIndent(outfile, level)846 outfile.write('</%s%s>\n' % (namespace_, name_))847 else:848 outfile.write(' />\n')849 def exportAttributes(self, outfile, level, namespace_='', name_='listofallmembersType'):850 pass851 def exportChildren(self, outfile, level, namespace_='', name_='listofallmembersType'):852 for member_ in self.member:853 member_.export(outfile, level, namespace_, name_='member')854 def hasContent_(self):855 if (856 self.member is not None857 ):858 return True859 else:860 return False861 def exportLiteral(self, outfile, level, name_='listofallmembersType'):862 level += 1863 self.exportLiteralAttributes(outfile, level, name_)864 if self.hasContent_():865 self.exportLiteralChildren(outfile, level, name_)866 def exportLiteralAttributes(self, outfile, level, name_):867 pass868 def exportLiteralChildren(self, outfile, level, name_):869 showIndent(outfile, level)870 outfile.write('member=[\n')871 level += 1872 for member in self.member:873 showIndent(outfile, level)874 outfile.write('model_.member(\n')875 member.exportLiteral(outfile, level, name_='member')876 showIndent(outfile, level)877 outfile.write('),\n')878 level -= 1879 showIndent(outfile, level)880 outfile.write('],\n')881 def build(self, node_):882 attrs = node_.attributes883 self.buildAttributes(attrs)884 for child_ in node_.childNodes:885 nodeName_ = child_.nodeName.split(':')[-1]886 self.buildChildren(child_, nodeName_)887 def buildAttributes(self, attrs):888 pass889 def buildChildren(self, child_, nodeName_):890 if child_.nodeType == Node.ELEMENT_NODE and \891 nodeName_ == 'member':892 obj_ = memberRefType.factory()893 obj_.build(child_)894 self.member.append(obj_)895# end class listofallmembersType896class memberRefType(GeneratedsSuper):897 subclass = None898 superclass = None899 def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope=None, name=None):900 self.virt = virt901 self.prot = prot902 self.refid = refid903 self.ambiguityscope = ambiguityscope904 self.scope = scope905 self.name = name906 def factory(*args_, **kwargs_):907 if memberRefType.subclass:908 return memberRefType.subclass(*args_, **kwargs_)909 else:910 return memberRefType(*args_, **kwargs_)911 factory = staticmethod(factory)912 def get_scope(self): return self.scope913 def set_scope(self, scope): self.scope = scope914 def get_name(self): return self.name915 def set_name(self, name): self.name = name916 def get_virt(self): return self.virt917 def set_virt(self, virt): self.virt = virt918 def get_prot(self): return self.prot919 def set_prot(self, prot): self.prot = prot920 def get_refid(self): return self.refid921 def set_refid(self, refid): self.refid = refid922 def get_ambiguityscope(self): return self.ambiguityscope923 def set_ambiguityscope(self, ambiguityscope): self.ambiguityscope = ambiguityscope924 def export(self, outfile, level, namespace_='', name_='memberRefType', namespacedef_=''):925 showIndent(outfile, level)926 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))927 self.exportAttributes(outfile, level, namespace_, name_='memberRefType')928 if self.hasContent_():929 outfile.write('>\n')930 self.exportChildren(outfile, level + 1, namespace_, name_)931 showIndent(outfile, level)932 outfile.write('</%s%s>\n' % (namespace_, name_))933 else:934 outfile.write(' />\n')935 def exportAttributes(self, outfile, level, namespace_='', name_='memberRefType'):936 if self.virt is not None:937 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))938 if self.prot is not None:939 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))940 if self.refid is not None:941 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))942 if self.ambiguityscope is not None:943 outfile.write(' ambiguityscope=%s' % (self.format_string(quote_attrib(self.ambiguityscope).encode(ExternalEncoding), input_name='ambiguityscope'), ))944 def exportChildren(self, outfile, level, namespace_='', name_='memberRefType'):945 if self.scope is not None:946 showIndent(outfile, level)947 outfile.write('<%sscope>%s</%sscope>\n' % (namespace_, self.format_string(quote_xml(self.scope).encode(ExternalEncoding), input_name='scope'), namespace_))948 if self.name is not None:949 showIndent(outfile, level)950 outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))951 def hasContent_(self):952 if (953 self.scope is not None or954 self.name is not None955 ):956 return True957 else:958 return False959 def exportLiteral(self, outfile, level, name_='memberRefType'):960 level += 1961 self.exportLiteralAttributes(outfile, level, name_)962 if self.hasContent_():963 self.exportLiteralChildren(outfile, level, name_)964 def exportLiteralAttributes(self, outfile, level, name_):965 if self.virt is not None:966 showIndent(outfile, level)967 outfile.write('virt = "%s",\n' % (self.virt,))968 if self.prot is not None:969 showIndent(outfile, level)970 outfile.write('prot = "%s",\n' % (self.prot,))971 if self.refid is not None:972 showIndent(outfile, level)973 outfile.write('refid = %s,\n' % (self.refid,))974 if self.ambiguityscope is not None:975 showIndent(outfile, level)976 outfile.write('ambiguityscope = %s,\n' % (self.ambiguityscope,))977 def exportLiteralChildren(self, outfile, level, name_):978 showIndent(outfile, level)979 outfile.write('scope=%s,\n' % quote_python(self.scope).encode(ExternalEncoding))980 showIndent(outfile, level)981 outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))982 def build(self, node_):983 attrs = node_.attributes984 self.buildAttributes(attrs)985 for child_ in node_.childNodes:986 nodeName_ = child_.nodeName.split(':')[-1]987 self.buildChildren(child_, nodeName_)988 def buildAttributes(self, attrs):989 if attrs.get('virt'):990 self.virt = attrs.get('virt').value991 if attrs.get('prot'):992 self.prot = attrs.get('prot').value993 if attrs.get('refid'):994 self.refid = attrs.get('refid').value995 if attrs.get('ambiguityscope'):996 self.ambiguityscope = attrs.get('ambiguityscope').value997 def buildChildren(self, child_, nodeName_):998 if child_.nodeType == Node.ELEMENT_NODE and \999 nodeName_ == 'scope':1000 scope_ = ''1001 for text__content_ in child_.childNodes:1002 scope_ += text__content_.nodeValue1003 self.scope = scope_1004 elif child_.nodeType == Node.ELEMENT_NODE and \1005 nodeName_ == 'name':1006 name_ = ''1007 for text__content_ in child_.childNodes:1008 name_ += text__content_.nodeValue1009 self.name = name_1010# end class memberRefType1011class scope(GeneratedsSuper):1012 subclass = None1013 superclass = None1014 def __init__(self, valueOf_=''):1015 self.valueOf_ = valueOf_1016 def factory(*args_, **kwargs_):1017 if scope.subclass:1018 return scope.subclass(*args_, **kwargs_)1019 else:1020 return scope(*args_, **kwargs_)1021 factory = staticmethod(factory)1022 def getValueOf_(self): return self.valueOf_1023 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1024 def export(self, outfile, level, namespace_='', name_='scope', namespacedef_=''):1025 showIndent(outfile, level)1026 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1027 self.exportAttributes(outfile, level, namespace_, name_='scope')1028 if self.hasContent_():1029 outfile.write('>\n')1030 self.exportChildren(outfile, level + 1, namespace_, name_)1031 showIndent(outfile, level)1032 outfile.write('</%s%s>\n' % (namespace_, name_))1033 else:1034 outfile.write(' />\n')1035 def exportAttributes(self, outfile, level, namespace_='', name_='scope'):1036 pass1037 def exportChildren(self, outfile, level, namespace_='', name_='scope'):1038 if self.valueOf_.find('![CDATA')>-1:1039 value=quote_xml('%s' % self.valueOf_)1040 value=value.replace('![CDATA','<![CDATA')1041 value=value.replace(']]',']]>')1042 outfile.write(value)1043 else:1044 outfile.write(quote_xml('%s' % self.valueOf_))1045 def hasContent_(self):1046 if (1047 self.valueOf_ is not None1048 ):1049 return True1050 else:1051 return False1052 def exportLiteral(self, outfile, level, name_='scope'):1053 level += 11054 self.exportLiteralAttributes(outfile, level, name_)1055 if self.hasContent_():1056 self.exportLiteralChildren(outfile, level, name_)1057 def exportLiteralAttributes(self, outfile, level, name_):1058 pass1059 def exportLiteralChildren(self, outfile, level, name_):1060 showIndent(outfile, level)1061 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1062 def build(self, node_):1063 attrs = node_.attributes1064 self.buildAttributes(attrs)1065 self.valueOf_ = ''1066 for child_ in node_.childNodes:1067 nodeName_ = child_.nodeName.split(':')[-1]1068 self.buildChildren(child_, nodeName_)1069 def buildAttributes(self, attrs):1070 pass1071 def buildChildren(self, child_, nodeName_):1072 if child_.nodeType == Node.TEXT_NODE:1073 self.valueOf_ += child_.nodeValue1074 elif child_.nodeType == Node.CDATA_SECTION_NODE:1075 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1076# end class scope1077class name(GeneratedsSuper):1078 subclass = None1079 superclass = None1080 def __init__(self, valueOf_=''):1081 self.valueOf_ = valueOf_1082 def factory(*args_, **kwargs_):1083 if name.subclass:1084 return name.subclass(*args_, **kwargs_)1085 else:1086 return name(*args_, **kwargs_)1087 factory = staticmethod(factory)1088 def getValueOf_(self): return self.valueOf_1089 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1090 def export(self, outfile, level, namespace_='', name_='name', namespacedef_=''):1091 showIndent(outfile, level)1092 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1093 self.exportAttributes(outfile, level, namespace_, name_='name')1094 if self.hasContent_():1095 outfile.write('>\n')1096 self.exportChildren(outfile, level + 1, namespace_, name_)1097 showIndent(outfile, level)1098 outfile.write('</%s%s>\n' % (namespace_, name_))1099 else:1100 outfile.write(' />\n')1101 def exportAttributes(self, outfile, level, namespace_='', name_='name'):1102 pass1103 def exportChildren(self, outfile, level, namespace_='', name_='name'):1104 if self.valueOf_.find('![CDATA')>-1:1105 value=quote_xml('%s' % self.valueOf_)1106 value=value.replace('![CDATA','<![CDATA')1107 value=value.replace(']]',']]>')1108 outfile.write(value)1109 else:1110 outfile.write(quote_xml('%s' % self.valueOf_))1111 def hasContent_(self):1112 if (1113 self.valueOf_ is not None1114 ):1115 return True1116 else:1117 return False1118 def exportLiteral(self, outfile, level, name_='name'):1119 level += 11120 self.exportLiteralAttributes(outfile, level, name_)1121 if self.hasContent_():1122 self.exportLiteralChildren(outfile, level, name_)1123 def exportLiteralAttributes(self, outfile, level, name_):1124 pass1125 def exportLiteralChildren(self, outfile, level, name_):1126 showIndent(outfile, level)1127 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1128 def build(self, node_):1129 attrs = node_.attributes1130 self.buildAttributes(attrs)1131 self.valueOf_ = ''1132 for child_ in node_.childNodes:1133 nodeName_ = child_.nodeName.split(':')[-1]1134 self.buildChildren(child_, nodeName_)1135 def buildAttributes(self, attrs):1136 pass1137 def buildChildren(self, child_, nodeName_):1138 if child_.nodeType == Node.TEXT_NODE:1139 self.valueOf_ += child_.nodeValue1140 elif child_.nodeType == Node.CDATA_SECTION_NODE:1141 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1142# end class name1143class compoundRefType(GeneratedsSuper):1144 subclass = None1145 superclass = None1146 def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1147 self.virt = virt1148 self.prot = prot1149 self.refid = refid1150 if mixedclass_ is None:1151 self.mixedclass_ = MixedContainer1152 else:1153 self.mixedclass_ = mixedclass_1154 if content_ is None:1155 self.content_ = []1156 else:1157 self.content_ = content_1158 def factory(*args_, **kwargs_):1159 if compoundRefType.subclass:1160 return compoundRefType.subclass(*args_, **kwargs_)1161 else:1162 return compoundRefType(*args_, **kwargs_)1163 factory = staticmethod(factory)1164 def get_virt(self): return self.virt1165 def set_virt(self, virt): self.virt = virt1166 def get_prot(self): return self.prot1167 def set_prot(self, prot): self.prot = prot1168 def get_refid(self): return self.refid1169 def set_refid(self, refid): self.refid = refid1170 def getValueOf_(self): return self.valueOf_1171 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1172 def export(self, outfile, level, namespace_='', name_='compoundRefType', namespacedef_=''):1173 showIndent(outfile, level)1174 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1175 self.exportAttributes(outfile, level, namespace_, name_='compoundRefType')1176 outfile.write('>')1177 self.exportChildren(outfile, level + 1, namespace_, name_)1178 outfile.write('</%s%s>\n' % (namespace_, name_))1179 def exportAttributes(self, outfile, level, namespace_='', name_='compoundRefType'):1180 if self.virt is not None:1181 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))1182 if self.prot is not None:1183 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1184 if self.refid is not None:1185 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1186 def exportChildren(self, outfile, level, namespace_='', name_='compoundRefType'):1187 if self.valueOf_.find('![CDATA')>-1:1188 value=quote_xml('%s' % self.valueOf_)1189 value=value.replace('![CDATA','<![CDATA')1190 value=value.replace(']]',']]>')1191 outfile.write(value)1192 else:1193 outfile.write(quote_xml('%s' % self.valueOf_))1194 def hasContent_(self):1195 if (1196 self.valueOf_ is not None1197 ):1198 return True1199 else:1200 return False1201 def exportLiteral(self, outfile, level, name_='compoundRefType'):1202 level += 11203 self.exportLiteralAttributes(outfile, level, name_)1204 if self.hasContent_():1205 self.exportLiteralChildren(outfile, level, name_)1206 def exportLiteralAttributes(self, outfile, level, name_):1207 if self.virt is not None:1208 showIndent(outfile, level)1209 outfile.write('virt = "%s",\n' % (self.virt,))1210 if self.prot is not None:1211 showIndent(outfile, level)1212 outfile.write('prot = "%s",\n' % (self.prot,))1213 if self.refid is not None:1214 showIndent(outfile, level)1215 outfile.write('refid = %s,\n' % (self.refid,))1216 def exportLiteralChildren(self, outfile, level, name_):1217 showIndent(outfile, level)1218 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1219 def build(self, node_):1220 attrs = node_.attributes1221 self.buildAttributes(attrs)1222 self.valueOf_ = ''1223 for child_ in node_.childNodes:1224 nodeName_ = child_.nodeName.split(':')[-1]1225 self.buildChildren(child_, nodeName_)1226 def buildAttributes(self, attrs):1227 if attrs.get('virt'):1228 self.virt = attrs.get('virt').value1229 if attrs.get('prot'):1230 self.prot = attrs.get('prot').value1231 if attrs.get('refid'):1232 self.refid = attrs.get('refid').value1233 def buildChildren(self, child_, nodeName_):1234 if child_.nodeType == Node.TEXT_NODE:1235 obj_ = self.mixedclass_(MixedContainer.CategoryText,1236 MixedContainer.TypeNone, '', child_.nodeValue)1237 self.content_.append(obj_)1238 if child_.nodeType == Node.TEXT_NODE:1239 self.valueOf_ += child_.nodeValue1240 elif child_.nodeType == Node.CDATA_SECTION_NODE:1241 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1242# end class compoundRefType1243class reimplementType(GeneratedsSuper):1244 subclass = None1245 superclass = None1246 def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):1247 self.refid = refid1248 if mixedclass_ is None:1249 self.mixedclass_ = MixedContainer1250 else:1251 self.mixedclass_ = mixedclass_1252 if content_ is None:1253 self.content_ = []1254 else:1255 self.content_ = content_1256 def factory(*args_, **kwargs_):1257 if reimplementType.subclass:1258 return reimplementType.subclass(*args_, **kwargs_)1259 else:1260 return reimplementType(*args_, **kwargs_)1261 factory = staticmethod(factory)1262 def get_refid(self): return self.refid1263 def set_refid(self, refid): self.refid = refid1264 def getValueOf_(self): return self.valueOf_1265 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1266 def export(self, outfile, level, namespace_='', name_='reimplementType', namespacedef_=''):1267 showIndent(outfile, level)1268 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1269 self.exportAttributes(outfile, level, namespace_, name_='reimplementType')1270 outfile.write('>')1271 self.exportChildren(outfile, level + 1, namespace_, name_)1272 outfile.write('</%s%s>\n' % (namespace_, name_))1273 def exportAttributes(self, outfile, level, namespace_='', name_='reimplementType'):1274 if self.refid is not None:1275 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1276 def exportChildren(self, outfile, level, namespace_='', name_='reimplementType'):1277 if self.valueOf_.find('![CDATA')>-1:1278 value=quote_xml('%s' % self.valueOf_)1279 value=value.replace('![CDATA','<![CDATA')1280 value=value.replace(']]',']]>')1281 outfile.write(value)1282 else:1283 outfile.write(quote_xml('%s' % self.valueOf_))1284 def hasContent_(self):1285 if (1286 self.valueOf_ is not None1287 ):1288 return True1289 else:1290 return False1291 def exportLiteral(self, outfile, level, name_='reimplementType'):1292 level += 11293 self.exportLiteralAttributes(outfile, level, name_)1294 if self.hasContent_():1295 self.exportLiteralChildren(outfile, level, name_)1296 def exportLiteralAttributes(self, outfile, level, name_):1297 if self.refid is not None:1298 showIndent(outfile, level)1299 outfile.write('refid = %s,\n' % (self.refid,))1300 def exportLiteralChildren(self, outfile, level, name_):1301 showIndent(outfile, level)1302 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1303 def build(self, node_):1304 attrs = node_.attributes1305 self.buildAttributes(attrs)1306 self.valueOf_ = ''1307 for child_ in node_.childNodes:1308 nodeName_ = child_.nodeName.split(':')[-1]1309 self.buildChildren(child_, nodeName_)1310 def buildAttributes(self, attrs):1311 if attrs.get('refid'):1312 self.refid = attrs.get('refid').value1313 def buildChildren(self, child_, nodeName_):1314 if child_.nodeType == Node.TEXT_NODE:1315 obj_ = self.mixedclass_(MixedContainer.CategoryText,1316 MixedContainer.TypeNone, '', child_.nodeValue)1317 self.content_.append(obj_)1318 if child_.nodeType == Node.TEXT_NODE:1319 self.valueOf_ += child_.nodeValue1320 elif child_.nodeType == Node.CDATA_SECTION_NODE:1321 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1322# end class reimplementType1323class incType(GeneratedsSuper):1324 subclass = None1325 superclass = None1326 def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1327 self.local = local1328 self.refid = refid1329 if mixedclass_ is None:1330 self.mixedclass_ = MixedContainer1331 else:1332 self.mixedclass_ = mixedclass_1333 if content_ is None:1334 self.content_ = []1335 else:1336 self.content_ = content_1337 def factory(*args_, **kwargs_):1338 if incType.subclass:1339 return incType.subclass(*args_, **kwargs_)1340 else:1341 return incType(*args_, **kwargs_)1342 factory = staticmethod(factory)1343 def get_local(self): return self.local1344 def set_local(self, local): self.local = local1345 def get_refid(self): return self.refid1346 def set_refid(self, refid): self.refid = refid1347 def getValueOf_(self): return self.valueOf_1348 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1349 def export(self, outfile, level, namespace_='', name_='incType', namespacedef_=''):1350 showIndent(outfile, level)1351 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1352 self.exportAttributes(outfile, level, namespace_, name_='incType')1353 outfile.write('>')1354 self.exportChildren(outfile, level + 1, namespace_, name_)1355 outfile.write('</%s%s>\n' % (namespace_, name_))1356 def exportAttributes(self, outfile, level, namespace_='', name_='incType'):1357 if self.local is not None:1358 outfile.write(' local=%s' % (quote_attrib(self.local), ))1359 if self.refid is not None:1360 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1361 def exportChildren(self, outfile, level, namespace_='', name_='incType'):1362 if self.valueOf_.find('![CDATA')>-1:1363 value=quote_xml('%s' % self.valueOf_)1364 value=value.replace('![CDATA','<![CDATA')1365 value=value.replace(']]',']]>')1366 outfile.write(value)1367 else:1368 outfile.write(quote_xml('%s' % self.valueOf_))1369 def hasContent_(self):1370 if (1371 self.valueOf_ is not None1372 ):1373 return True1374 else:1375 return False1376 def exportLiteral(self, outfile, level, name_='incType'):1377 level += 11378 self.exportLiteralAttributes(outfile, level, name_)1379 if self.hasContent_():1380 self.exportLiteralChildren(outfile, level, name_)1381 def exportLiteralAttributes(self, outfile, level, name_):1382 if self.local is not None:1383 showIndent(outfile, level)1384 outfile.write('local = "%s",\n' % (self.local,))1385 if self.refid is not None:1386 showIndent(outfile, level)1387 outfile.write('refid = %s,\n' % (self.refid,))1388 def exportLiteralChildren(self, outfile, level, name_):1389 showIndent(outfile, level)1390 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1391 def build(self, node_):1392 attrs = node_.attributes1393 self.buildAttributes(attrs)1394 self.valueOf_ = ''1395 for child_ in node_.childNodes:1396 nodeName_ = child_.nodeName.split(':')[-1]1397 self.buildChildren(child_, nodeName_)1398 def buildAttributes(self, attrs):1399 if attrs.get('local'):1400 self.local = attrs.get('local').value1401 if attrs.get('refid'):1402 self.refid = attrs.get('refid').value1403 def buildChildren(self, child_, nodeName_):1404 if child_.nodeType == Node.TEXT_NODE:1405 obj_ = self.mixedclass_(MixedContainer.CategoryText,1406 MixedContainer.TypeNone, '', child_.nodeValue)1407 self.content_.append(obj_)1408 if child_.nodeType == Node.TEXT_NODE:1409 self.valueOf_ += child_.nodeValue1410 elif child_.nodeType == Node.CDATA_SECTION_NODE:1411 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1412# end class incType1413class refType(GeneratedsSuper):1414 subclass = None1415 superclass = None1416 def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1417 self.prot = prot1418 self.refid = refid1419 if mixedclass_ is None:1420 self.mixedclass_ = MixedContainer1421 else:1422 self.mixedclass_ = mixedclass_1423 if content_ is None:1424 self.content_ = []1425 else:1426 self.content_ = content_1427 def factory(*args_, **kwargs_):1428 if refType.subclass:1429 return refType.subclass(*args_, **kwargs_)1430 else:1431 return refType(*args_, **kwargs_)1432 factory = staticmethod(factory)1433 def get_prot(self): return self.prot1434 def set_prot(self, prot): self.prot = prot1435 def get_refid(self): return self.refid1436 def set_refid(self, refid): self.refid = refid1437 def getValueOf_(self): return self.valueOf_1438 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1439 def export(self, outfile, level, namespace_='', name_='refType', namespacedef_=''):1440 showIndent(outfile, level)1441 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1442 self.exportAttributes(outfile, level, namespace_, name_='refType')1443 outfile.write('>')1444 self.exportChildren(outfile, level + 1, namespace_, name_)1445 outfile.write('</%s%s>\n' % (namespace_, name_))1446 def exportAttributes(self, outfile, level, namespace_='', name_='refType'):1447 if self.prot is not None:1448 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1449 if self.refid is not None:1450 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1451 def exportChildren(self, outfile, level, namespace_='', name_='refType'):1452 if self.valueOf_.find('![CDATA')>-1:1453 value=quote_xml('%s' % self.valueOf_)1454 value=value.replace('![CDATA','<![CDATA')1455 value=value.replace(']]',']]>')1456 outfile.write(value)1457 else:1458 outfile.write(quote_xml('%s' % self.valueOf_))1459 def hasContent_(self):1460 if (1461 self.valueOf_ is not None1462 ):1463 return True1464 else:1465 return False1466 def exportLiteral(self, outfile, level, name_='refType'):1467 level += 11468 self.exportLiteralAttributes(outfile, level, name_)1469 if self.hasContent_():1470 self.exportLiteralChildren(outfile, level, name_)1471 def exportLiteralAttributes(self, outfile, level, name_):1472 if self.prot is not None:1473 showIndent(outfile, level)1474 outfile.write('prot = "%s",\n' % (self.prot,))1475 if self.refid is not None:1476 showIndent(outfile, level)1477 outfile.write('refid = %s,\n' % (self.refid,))1478 def exportLiteralChildren(self, outfile, level, name_):1479 showIndent(outfile, level)1480 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1481 def build(self, node_):1482 attrs = node_.attributes1483 self.buildAttributes(attrs)1484 self.valueOf_ = ''1485 for child_ in node_.childNodes:1486 nodeName_ = child_.nodeName.split(':')[-1]1487 self.buildChildren(child_, nodeName_)1488 def buildAttributes(self, attrs):1489 if attrs.get('prot'):1490 self.prot = attrs.get('prot').value1491 if attrs.get('refid'):1492 self.refid = attrs.get('refid').value1493 def buildChildren(self, child_, nodeName_):1494 if child_.nodeType == Node.TEXT_NODE:1495 obj_ = self.mixedclass_(MixedContainer.CategoryText,1496 MixedContainer.TypeNone, '', child_.nodeValue)1497 self.content_.append(obj_)1498 if child_.nodeType == Node.TEXT_NODE:1499 self.valueOf_ += child_.nodeValue1500 elif child_.nodeType == Node.CDATA_SECTION_NODE:1501 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1502# end class refType1503class refTextType(GeneratedsSuper):1504 subclass = None1505 superclass = None1506 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):1507 self.refid = refid1508 self.kindref = kindref1509 self.external = external1510 if mixedclass_ is None:1511 self.mixedclass_ = MixedContainer1512 else:1513 self.mixedclass_ = mixedclass_1514 if content_ is None:1515 self.content_ = []1516 else:1517 self.content_ = content_1518 def factory(*args_, **kwargs_):1519 if refTextType.subclass:1520 return refTextType.subclass(*args_, **kwargs_)1521 else:1522 return refTextType(*args_, **kwargs_)1523 factory = staticmethod(factory)1524 def get_refid(self): return self.refid1525 def set_refid(self, refid): self.refid = refid1526 def get_kindref(self): return self.kindref1527 def set_kindref(self, kindref): self.kindref = kindref1528 def get_external(self): return self.external1529 def set_external(self, external): self.external = external1530 def getValueOf_(self): return self.valueOf_1531 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1532 def export(self, outfile, level, namespace_='', name_='refTextType', namespacedef_=''):1533 showIndent(outfile, level)1534 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1535 self.exportAttributes(outfile, level, namespace_, name_='refTextType')1536 outfile.write('>')1537 self.exportChildren(outfile, level + 1, namespace_, name_)1538 outfile.write('</%s%s>\n' % (namespace_, name_))1539 def exportAttributes(self, outfile, level, namespace_='', name_='refTextType'):1540 if self.refid is not None:1541 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1542 if self.kindref is not None:1543 outfile.write(' kindref=%s' % (quote_attrib(self.kindref), ))1544 if self.external is not None:1545 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))1546 def exportChildren(self, outfile, level, namespace_='', name_='refTextType'):1547 if self.valueOf_.find('![CDATA')>-1:1548 value=quote_xml('%s' % self.valueOf_)1549 value=value.replace('![CDATA','<![CDATA')1550 value=value.replace(']]',']]>')1551 outfile.write(value)1552 else:1553 outfile.write(quote_xml('%s' % self.valueOf_))1554 def hasContent_(self):1555 if (1556 self.valueOf_ is not None1557 ):1558 return True1559 else:1560 return False1561 def exportLiteral(self, outfile, level, name_='refTextType'):1562 level += 11563 self.exportLiteralAttributes(outfile, level, name_)1564 if self.hasContent_():1565 self.exportLiteralChildren(outfile, level, name_)1566 def exportLiteralAttributes(self, outfile, level, name_):1567 if self.refid is not None:1568 showIndent(outfile, level)1569 outfile.write('refid = %s,\n' % (self.refid,))1570 if self.kindref is not None:1571 showIndent(outfile, level)1572 outfile.write('kindref = "%s",\n' % (self.kindref,))1573 if self.external is not None:1574 showIndent(outfile, level)1575 outfile.write('external = %s,\n' % (self.external,))1576 def exportLiteralChildren(self, outfile, level, name_):1577 showIndent(outfile, level)1578 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1579 def build(self, node_):1580 attrs = node_.attributes1581 self.buildAttributes(attrs)1582 self.valueOf_ = ''1583 for child_ in node_.childNodes:1584 nodeName_ = child_.nodeName.split(':')[-1]1585 self.buildChildren(child_, nodeName_)1586 def buildAttributes(self, attrs):1587 if attrs.get('refid'):1588 self.refid = attrs.get('refid').value1589 if attrs.get('kindref'):1590 self.kindref = attrs.get('kindref').value1591 if attrs.get('external'):1592 self.external = attrs.get('external').value1593 def buildChildren(self, child_, nodeName_):1594 if child_.nodeType == Node.TEXT_NODE:1595 obj_ = self.mixedclass_(MixedContainer.CategoryText,1596 MixedContainer.TypeNone, '', child_.nodeValue)1597 self.content_.append(obj_)1598 if child_.nodeType == Node.TEXT_NODE:1599 self.valueOf_ += child_.nodeValue1600 elif child_.nodeType == Node.CDATA_SECTION_NODE:1601 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1602# end class refTextType1603class sectiondefType(GeneratedsSuper):1604 subclass = None1605 superclass = None1606 def __init__(self, kind=None, header=None, description=None, memberdef=None):1607 self.kind = kind1608 self.header = header1609 self.description = description1610 if memberdef is None:1611 self.memberdef = []1612 else:1613 self.memberdef = memberdef1614 def factory(*args_, **kwargs_):1615 if sectiondefType.subclass:1616 return sectiondefType.subclass(*args_, **kwargs_)1617 else:1618 return sectiondefType(*args_, **kwargs_)1619 factory = staticmethod(factory)1620 def get_header(self): return self.header1621 def set_header(self, header): self.header = header1622 def get_description(self): return self.description1623 def set_description(self, description): self.description = description1624 def get_memberdef(self): return self.memberdef1625 def set_memberdef(self, memberdef): self.memberdef = memberdef1626 def add_memberdef(self, value): self.memberdef.append(value)1627 def insert_memberdef(self, index, value): self.memberdef[index] = value1628 def get_kind(self): return self.kind1629 def set_kind(self, kind): self.kind = kind1630 def export(self, outfile, level, namespace_='', name_='sectiondefType', namespacedef_=''):1631 showIndent(outfile, level)1632 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1633 self.exportAttributes(outfile, level, namespace_, name_='sectiondefType')1634 if self.hasContent_():1635 outfile.write('>\n')1636 self.exportChildren(outfile, level + 1, namespace_, name_)1637 showIndent(outfile, level)1638 outfile.write('</%s%s>\n' % (namespace_, name_))1639 else:1640 outfile.write(' />\n')1641 def exportAttributes(self, outfile, level, namespace_='', name_='sectiondefType'):1642 if self.kind is not None:1643 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))1644 def exportChildren(self, outfile, level, namespace_='', name_='sectiondefType'):1645 if self.header is not None:1646 showIndent(outfile, level)1647 outfile.write('<%sheader>%s</%sheader>\n' % (namespace_, self.format_string(quote_xml(self.header).encode(ExternalEncoding), input_name='header'), namespace_))1648 if self.description:1649 self.description.export(outfile, level, namespace_, name_='description')1650 for memberdef_ in self.memberdef:1651 memberdef_.export(outfile, level, namespace_, name_='memberdef')1652 def hasContent_(self):1653 if (1654 self.header is not None or1655 self.description is not None or1656 self.memberdef is not None1657 ):1658 return True1659 else:1660 return False1661 def exportLiteral(self, outfile, level, name_='sectiondefType'):1662 level += 11663 self.exportLiteralAttributes(outfile, level, name_)1664 if self.hasContent_():1665 self.exportLiteralChildren(outfile, level, name_)1666 def exportLiteralAttributes(self, outfile, level, name_):1667 if self.kind is not None:1668 showIndent(outfile, level)1669 outfile.write('kind = "%s",\n' % (self.kind,))1670 def exportLiteralChildren(self, outfile, level, name_):1671 showIndent(outfile, level)1672 outfile.write('header=%s,\n' % quote_python(self.header).encode(ExternalEncoding))1673 if self.description:1674 showIndent(outfile, level)1675 outfile.write('description=model_.descriptionType(\n')1676 self.description.exportLiteral(outfile, level, name_='description')1677 showIndent(outfile, level)1678 outfile.write('),\n')1679 showIndent(outfile, level)1680 outfile.write('memberdef=[\n')1681 level += 11682 for memberdef in self.memberdef:1683 showIndent(outfile, level)1684 outfile.write('model_.memberdef(\n')1685 memberdef.exportLiteral(outfile, level, name_='memberdef')1686 showIndent(outfile, level)1687 outfile.write('),\n')1688 level -= 11689 showIndent(outfile, level)1690 outfile.write('],\n')1691 def build(self, node_):1692 attrs = node_.attributes1693 self.buildAttributes(attrs)1694 for child_ in node_.childNodes:1695 nodeName_ = child_.nodeName.split(':')[-1]1696 self.buildChildren(child_, nodeName_)1697 def buildAttributes(self, attrs):1698 if attrs.get('kind'):1699 self.kind = attrs.get('kind').value1700 def buildChildren(self, child_, nodeName_):1701 if child_.nodeType == Node.ELEMENT_NODE and \1702 nodeName_ == 'header':1703 header_ = ''1704 for text__content_ in child_.childNodes:1705 header_ += text__content_.nodeValue1706 self.header = header_1707 elif child_.nodeType == Node.ELEMENT_NODE and \1708 nodeName_ == 'description':1709 obj_ = descriptionType.factory()1710 obj_.build(child_)1711 self.set_description(obj_)1712 elif child_.nodeType == Node.ELEMENT_NODE and \1713 nodeName_ == 'memberdef':1714 obj_ = memberdefType.factory()1715 obj_.build(child_)1716 self.memberdef.append(obj_)1717# end class sectiondefType1718class memberdefType(GeneratedsSuper):1719 subclass = None1720 superclass = None1721 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, 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):1722 self.initonly = initonly1723 self.kind = kind1724 self.volatile = volatile1725 self.const = const1726 self.raisexx = raisexx1727 self.virt = virt1728 self.readable = readable1729 self.prot = prot1730 self.explicit = explicit1731 self.new = new1732 self.final = final1733 self.writable = writable1734 self.add = add1735 self.static = static1736 self.remove = remove1737 self.sealed = sealed1738 self.mutable = mutable1739 self.gettable = gettable1740 self.inline = inline1741 self.settable = settable1742 self.id = id1743 self.templateparamlist = templateparamlist1744 self.type_ = type_1745 self.definition = definition1746 self.argsstring = argsstring1747 self.name = name1748 self.read = read1749 self.write = write1750 self.bitfield = bitfield1751 if reimplements is None:1752 self.reimplements = []1753 else:1754 self.reimplements = reimplements1755 if reimplementedby is None:1756 self.reimplementedby = []1757 else:1758 self.reimplementedby = reimplementedby1759 if param is None:1760 self.param = []1761 else:1762 self.param = param1763 if enumvalue is None:1764 self.enumvalue = []1765 else:1766 self.enumvalue = enumvalue1767 self.initializer = initializer1768 self.exceptions = exceptions1769 self.briefdescription = briefdescription1770 self.detaileddescription = detaileddescription1771 self.inbodydescription = inbodydescription1772 self.location = location1773 if references is None:1774 self.references = []1775 else:1776 self.references = references1777 if referencedby is None:1778 self.referencedby = []1779 else:1780 self.referencedby = referencedby1781 def factory(*args_, **kwargs_):1782 if memberdefType.subclass:1783 return memberdefType.subclass(*args_, **kwargs_)1784 else:1785 return memberdefType(*args_, **kwargs_)1786 factory = staticmethod(factory)1787 def get_templateparamlist(self): return self.templateparamlist1788 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist1789 def get_type(self): return self.type_1790 def set_type(self, type_): self.type_ = type_1791 def get_definition(self): return self.definition1792 def set_definition(self, definition): self.definition = definition1793 def get_argsstring(self): return self.argsstring1794 def set_argsstring(self, argsstring): self.argsstring = argsstring1795 def get_name(self): return self.name1796 def set_name(self, name): self.name = name1797 def get_read(self): return self.read1798 def set_read(self, read): self.read = read1799 def get_write(self): return self.write1800 def set_write(self, write): self.write = write1801 def get_bitfield(self): return self.bitfield1802 def set_bitfield(self, bitfield): self.bitfield = bitfield1803 def get_reimplements(self): return self.reimplements1804 def set_reimplements(self, reimplements): self.reimplements = reimplements1805 def add_reimplements(self, value): self.reimplements.append(value)1806 def insert_reimplements(self, index, value): self.reimplements[index] = value1807 def get_reimplementedby(self): return self.reimplementedby1808 def set_reimplementedby(self, reimplementedby): self.reimplementedby = reimplementedby1809 def add_reimplementedby(self, value): self.reimplementedby.append(value)1810 def insert_reimplementedby(self, index, value): self.reimplementedby[index] = value1811 def get_param(self): return self.param1812 def set_param(self, param): self.param = param1813 def add_param(self, value): self.param.append(value)1814 def insert_param(self, index, value): self.param[index] = value1815 def get_enumvalue(self): return self.enumvalue1816 def set_enumvalue(self, enumvalue): self.enumvalue = enumvalue1817 def add_enumvalue(self, value): self.enumvalue.append(value)1818 def insert_enumvalue(self, index, value): self.enumvalue[index] = value1819 def get_initializer(self): return self.initializer1820 def set_initializer(self, initializer): self.initializer = initializer1821 def get_exceptions(self): return self.exceptions1822 def set_exceptions(self, exceptions): self.exceptions = exceptions1823 def get_briefdescription(self): return self.briefdescription1824 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription1825 def get_detaileddescription(self): return self.detaileddescription1826 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription1827 def get_inbodydescription(self): return self.inbodydescription1828 def set_inbodydescription(self, inbodydescription): self.inbodydescription = inbodydescription1829 def get_location(self): return self.location1830 def set_location(self, location): self.location = location1831 def get_references(self): return self.references1832 def set_references(self, references): self.references = references1833 def add_references(self, value): self.references.append(value)1834 def insert_references(self, index, value): self.references[index] = value1835 def get_referencedby(self): return self.referencedby1836 def set_referencedby(self, referencedby): self.referencedby = referencedby1837 def add_referencedby(self, value): self.referencedby.append(value)1838 def insert_referencedby(self, index, value): self.referencedby[index] = value1839 def get_initonly(self): return self.initonly1840 def set_initonly(self, initonly): self.initonly = initonly1841 def get_kind(self): return self.kind1842 def set_kind(self, kind): self.kind = kind1843 def get_volatile(self): return self.volatile1844 def set_volatile(self, volatile): self.volatile = volatile1845 def get_const(self): return self.const1846 def set_const(self, const): self.const = const1847 def get_raise(self): return self.raisexx1848 def set_raise(self, raisexx): self.raisexx = raisexx1849 def get_virt(self): return self.virt1850 def set_virt(self, virt): self.virt = virt1851 def get_readable(self): return self.readable1852 def set_readable(self, readable): self.readable = readable1853 def get_prot(self): return self.prot1854 def set_prot(self, prot): self.prot = prot1855 def get_explicit(self): return self.explicit1856 def set_explicit(self, explicit): self.explicit = explicit1857 def get_new(self): return self.new1858 def set_new(self, new): self.new = new1859 def get_final(self): return self.final1860 def set_final(self, final): self.final = final1861 def get_writable(self): return self.writable1862 def set_writable(self, writable): self.writable = writable1863 def get_add(self): return self.add1864 def set_add(self, add): self.add = add1865 def get_static(self): return self.static1866 def set_static(self, static): self.static = static1867 def get_remove(self): return self.remove1868 def set_remove(self, remove): self.remove = remove1869 def get_sealed(self): return self.sealed1870 def set_sealed(self, sealed): self.sealed = sealed1871 def get_mutable(self): return self.mutable1872 def set_mutable(self, mutable): self.mutable = mutable1873 def get_gettable(self): return self.gettable1874 def set_gettable(self, gettable): self.gettable = gettable1875 def get_inline(self): return self.inline1876 def set_inline(self, inline): self.inline = inline1877 def get_settable(self): return self.settable1878 def set_settable(self, settable): self.settable = settable1879 def get_id(self): return self.id1880 def set_id(self, id): self.id = id1881 def export(self, outfile, level, namespace_='', name_='memberdefType', namespacedef_=''):1882 showIndent(outfile, level)1883 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1884 self.exportAttributes(outfile, level, namespace_, name_='memberdefType')1885 if self.hasContent_():1886 outfile.write('>\n')1887 self.exportChildren(outfile, level + 1, namespace_, name_)1888 showIndent(outfile, level)1889 outfile.write('</%s%s>\n' % (namespace_, name_))1890 else:1891 outfile.write(' />\n')1892 def exportAttributes(self, outfile, level, namespace_='', name_='memberdefType'):1893 if self.initonly is not None:1894 outfile.write(' initonly=%s' % (quote_attrib(self.initonly), ))1895 if self.kind is not None:1896 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))1897 if self.volatile is not None:1898 outfile.write(' volatile=%s' % (quote_attrib(self.volatile), ))1899 if self.const is not None:1900 outfile.write(' const=%s' % (quote_attrib(self.const), ))1901 if self.raisexx is not None:1902 outfile.write(' raise=%s' % (quote_attrib(self.raisexx), ))1903 if self.virt is not None:1904 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))1905 if self.readable is not None:1906 outfile.write(' readable=%s' % (quote_attrib(self.readable), ))1907 if self.prot is not None:1908 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1909 if self.explicit is not None:1910 outfile.write(' explicit=%s' % (quote_attrib(self.explicit), ))1911 if self.new is not None:1912 outfile.write(' new=%s' % (quote_attrib(self.new), ))1913 if self.final is not None:1914 outfile.write(' final=%s' % (quote_attrib(self.final), ))1915 if self.writable is not None:1916 outfile.write(' writable=%s' % (quote_attrib(self.writable), ))1917 if self.add is not None:1918 outfile.write(' add=%s' % (quote_attrib(self.add), ))1919 if self.static is not None:1920 outfile.write(' static=%s' % (quote_attrib(self.static), ))1921 if self.remove is not None:1922 outfile.write(' remove=%s' % (quote_attrib(self.remove), ))1923 if self.sealed is not None:1924 outfile.write(' sealed=%s' % (quote_attrib(self.sealed), ))1925 if self.mutable is not None:1926 outfile.write(' mutable=%s' % (quote_attrib(self.mutable), ))1927 if self.gettable is not None:1928 outfile.write(' gettable=%s' % (quote_attrib(self.gettable), ))1929 if self.inline is not None:1930 outfile.write(' inline=%s' % (quote_attrib(self.inline), ))1931 if self.settable is not None:1932 outfile.write(' settable=%s' % (quote_attrib(self.settable), ))1933 if self.id is not None:1934 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))1935 def exportChildren(self, outfile, level, namespace_='', name_='memberdefType'):1936 if self.templateparamlist:1937 self.templateparamlist.export(outfile, level, namespace_, name_='templateparamlist')1938 if self.type_:1939 self.type_.export(outfile, level, namespace_, name_='type')1940 if self.definition is not None:1941 showIndent(outfile, level)1942 outfile.write('<%sdefinition>%s</%sdefinition>\n' % (namespace_, self.format_string(quote_xml(self.definition).encode(ExternalEncoding), input_name='definition'), namespace_))1943 if self.argsstring is not None:1944 showIndent(outfile, level)1945 outfile.write('<%sargsstring>%s</%sargsstring>\n' % (namespace_, self.format_string(quote_xml(self.argsstring).encode(ExternalEncoding), input_name='argsstring'), namespace_))1946 if self.name is not None:1947 showIndent(outfile, level)1948 outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))1949 if self.read is not None:1950 showIndent(outfile, level)1951 outfile.write('<%sread>%s</%sread>\n' % (namespace_, self.format_string(quote_xml(self.read).encode(ExternalEncoding), input_name='read'), namespace_))1952 if self.write is not None:1953 showIndent(outfile, level)1954 outfile.write('<%swrite>%s</%swrite>\n' % (namespace_, self.format_string(quote_xml(self.write).encode(ExternalEncoding), input_name='write'), namespace_))1955 if self.bitfield is not None:1956 showIndent(outfile, level)1957 outfile.write('<%sbitfield>%s</%sbitfield>\n' % (namespace_, self.format_string(quote_xml(self.bitfield).encode(ExternalEncoding), input_name='bitfield'), namespace_))1958 for reimplements_ in self.reimplements:1959 reimplements_.export(outfile, level, namespace_, name_='reimplements')1960 for reimplementedby_ in self.reimplementedby:1961 reimplementedby_.export(outfile, level, namespace_, name_='reimplementedby')1962 for param_ in self.param:1963 param_.export(outfile, level, namespace_, name_='param')1964 for enumvalue_ in self.enumvalue:1965 enumvalue_.export(outfile, level, namespace_, name_='enumvalue')1966 if self.initializer:1967 self.initializer.export(outfile, level, namespace_, name_='initializer')1968 if self.exceptions:1969 self.exceptions.export(outfile, level, namespace_, name_='exceptions')1970 if self.briefdescription:1971 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')1972 if self.detaileddescription:1973 self.detaileddescription.export(outfile, level, namespace_, name_='detaileddescription')1974 if self.inbodydescription:1975 self.inbodydescription.export(outfile, level, namespace_, name_='inbodydescription')1976 if self.location:1977 self.location.export(outfile, level, namespace_, name_='location', )1978 for references_ in self.references:1979 references_.export(outfile, level, namespace_, name_='references')1980 for referencedby_ in self.referencedby:1981 referencedby_.export(outfile, level, namespace_, name_='referencedby')1982 def hasContent_(self):1983 if (1984 self.templateparamlist is not None or1985 self.type_ is not None or1986 self.definition is not None or1987 self.argsstring is not None or1988 self.name is not None or1989 self.read is not None or1990 self.write is not None or1991 self.bitfield is not None or1992 self.reimplements is not None or1993 self.reimplementedby is not None or1994 self.param is not None or1995 self.enumvalue is not None or1996 self.initializer is not None or1997 self.exceptions is not None or1998 self.briefdescription is not None or1999 self.detaileddescription is not None or2000 self.inbodydescription is not None or2001 self.location is not None or2002 self.references is not None or2003 self.referencedby is not None2004 ):2005 return True2006 else:2007 return False2008 def exportLiteral(self, outfile, level, name_='memberdefType'):2009 level += 12010 self.exportLiteralAttributes(outfile, level, name_)2011 if self.hasContent_():2012 self.exportLiteralChildren(outfile, level, name_)2013 def exportLiteralAttributes(self, outfile, level, name_):2014 if self.initonly is not None:2015 showIndent(outfile, level)2016 outfile.write('initonly = "%s",\n' % (self.initonly,))2017 if self.kind is not None:2018 showIndent(outfile, level)2019 outfile.write('kind = "%s",\n' % (self.kind,))2020 if self.volatile is not None:2021 showIndent(outfile, level)2022 outfile.write('volatile = "%s",\n' % (self.volatile,))2023 if self.const is not None:2024 showIndent(outfile, level)2025 outfile.write('const = "%s",\n' % (self.const,))2026 if self.raisexx is not None:2027 showIndent(outfile, level)2028 outfile.write('raisexx = "%s",\n' % (self.raisexx,))2029 if self.virt is not None:2030 showIndent(outfile, level)2031 outfile.write('virt = "%s",\n' % (self.virt,))2032 if self.readable is not None:2033 showIndent(outfile, level)2034 outfile.write('readable = "%s",\n' % (self.readable,))2035 if self.prot is not None:2036 showIndent(outfile, level)2037 outfile.write('prot = "%s",\n' % (self.prot,))2038 if self.explicit is not None:2039 showIndent(outfile, level)2040 outfile.write('explicit = "%s",\n' % (self.explicit,))2041 if self.new is not None:2042 showIndent(outfile, level)2043 outfile.write('new = "%s",\n' % (self.new,))2044 if self.final is not None:2045 showIndent(outfile, level)2046 outfile.write('final = "%s",\n' % (self.final,))2047 if self.writable is not None:2048 showIndent(outfile, level)2049 outfile.write('writable = "%s",\n' % (self.writable,))2050 if self.add is not None:2051 showIndent(outfile, level)2052 outfile.write('add = "%s",\n' % (self.add,))2053 if self.static is not None:2054 showIndent(outfile, level)2055 outfile.write('static = "%s",\n' % (self.static,))2056 if self.remove is not None:2057 showIndent(outfile, level)2058 outfile.write('remove = "%s",\n' % (self.remove,))2059 if self.sealed is not None:2060 showIndent(outfile, level)2061 outfile.write('sealed = "%s",\n' % (self.sealed,))2062 if self.mutable is not None:2063 showIndent(outfile, level)2064 outfile.write('mutable = "%s",\n' % (self.mutable,))2065 if self.gettable is not None:2066 showIndent(outfile, level)2067 outfile.write('gettable = "%s",\n' % (self.gettable,))2068 if self.inline is not None:2069 showIndent(outfile, level)2070 outfile.write('inline = "%s",\n' % (self.inline,))2071 if self.settable is not None:2072 showIndent(outfile, level)2073 outfile.write('settable = "%s",\n' % (self.settable,))2074 if self.id is not None:2075 showIndent(outfile, level)2076 outfile.write('id = %s,\n' % (self.id,))2077 def exportLiteralChildren(self, outfile, level, name_):2078 if self.templateparamlist:2079 showIndent(outfile, level)2080 outfile.write('templateparamlist=model_.templateparamlistType(\n')2081 self.templateparamlist.exportLiteral(outfile, level, name_='templateparamlist')2082 showIndent(outfile, level)2083 outfile.write('),\n')2084 if self.type_:2085 showIndent(outfile, level)2086 outfile.write('type_=model_.linkedTextType(\n')2087 self.type_.exportLiteral(outfile, level, name_='type')2088 showIndent(outfile, level)2089 outfile.write('),\n')2090 showIndent(outfile, level)2091 outfile.write('definition=%s,\n' % quote_python(self.definition).encode(ExternalEncoding))2092 showIndent(outfile, level)2093 outfile.write('argsstring=%s,\n' % quote_python(self.argsstring).encode(ExternalEncoding))2094 showIndent(outfile, level)2095 outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))2096 showIndent(outfile, level)2097 outfile.write('read=%s,\n' % quote_python(self.read).encode(ExternalEncoding))2098 showIndent(outfile, level)2099 outfile.write('write=%s,\n' % quote_python(self.write).encode(ExternalEncoding))2100 showIndent(outfile, level)2101 outfile.write('bitfield=%s,\n' % quote_python(self.bitfield).encode(ExternalEncoding))2102 showIndent(outfile, level)2103 outfile.write('reimplements=[\n')2104 level += 12105 for reimplements in self.reimplements:2106 showIndent(outfile, level)2107 outfile.write('model_.reimplements(\n')2108 reimplements.exportLiteral(outfile, level, name_='reimplements')2109 showIndent(outfile, level)2110 outfile.write('),\n')2111 level -= 12112 showIndent(outfile, level)2113 outfile.write('],\n')2114 showIndent(outfile, level)2115 outfile.write('reimplementedby=[\n')2116 level += 12117 for reimplementedby in self.reimplementedby:2118 showIndent(outfile, level)2119 outfile.write('model_.reimplementedby(\n')2120 reimplementedby.exportLiteral(outfile, level, name_='reimplementedby')2121 showIndent(outfile, level)2122 outfile.write('),\n')2123 level -= 12124 showIndent(outfile, level)2125 outfile.write('],\n')2126 showIndent(outfile, level)2127 outfile.write('param=[\n')2128 level += 12129 for param in self.param:2130 showIndent(outfile, level)2131 outfile.write('model_.param(\n')2132 param.exportLiteral(outfile, level, name_='param')2133 showIndent(outfile, level)2134 outfile.write('),\n')2135 level -= 12136 showIndent(outfile, level)2137 outfile.write('],\n')2138 showIndent(outfile, level)2139 outfile.write('enumvalue=[\n')2140 level += 12141 for enumvalue in self.enumvalue:2142 showIndent(outfile, level)2143 outfile.write('model_.enumvalue(\n')2144 enumvalue.exportLiteral(outfile, level, name_='enumvalue')2145 showIndent(outfile, level)2146 outfile.write('),\n')2147 level -= 12148 showIndent(outfile, level)2149 outfile.write('],\n')2150 if self.initializer:2151 showIndent(outfile, level)2152 outfile.write('initializer=model_.linkedTextType(\n')2153 self.initializer.exportLiteral(outfile, level, name_='initializer')2154 showIndent(outfile, level)2155 outfile.write('),\n')2156 if self.exceptions:2157 showIndent(outfile, level)2158 outfile.write('exceptions=model_.linkedTextType(\n')2159 self.exceptions.exportLiteral(outfile, level, name_='exceptions')2160 showIndent(outfile, level)2161 outfile.write('),\n')2162 if self.briefdescription:2163 showIndent(outfile, level)2164 outfile.write('briefdescription=model_.descriptionType(\n')2165 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')2166 showIndent(outfile, level)2167 outfile.write('),\n')2168 if self.detaileddescription:2169 showIndent(outfile, level)2170 outfile.write('detaileddescription=model_.descriptionType(\n')2171 self.detaileddescription.exportLiteral(outfile, level, name_='detaileddescription')2172 showIndent(outfile, level)2173 outfile.write('),\n')2174 if self.inbodydescription:2175 showIndent(outfile, level)2176 outfile.write('inbodydescription=model_.descriptionType(\n')2177 self.inbodydescription.exportLiteral(outfile, level, name_='inbodydescription')2178 showIndent(outfile, level)2179 outfile.write('),\n')2180 if self.location:2181 showIndent(outfile, level)2182 outfile.write('location=model_.locationType(\n')2183 self.location.exportLiteral(outfile, level, name_='location')2184 showIndent(outfile, level)2185 outfile.write('),\n')2186 showIndent(outfile, level)2187 outfile.write('references=[\n')2188 level += 12189 for references in self.references:2190 showIndent(outfile, level)2191 outfile.write('model_.references(\n')2192 references.exportLiteral(outfile, level, name_='references')2193 showIndent(outfile, level)2194 outfile.write('),\n')2195 level -= 12196 showIndent(outfile, level)2197 outfile.write('],\n')2198 showIndent(outfile, level)2199 outfile.write('referencedby=[\n')2200 level += 12201 for referencedby in self.referencedby:2202 showIndent(outfile, level)2203 outfile.write('model_.referencedby(\n')2204 referencedby.exportLiteral(outfile, level, name_='referencedby')2205 showIndent(outfile, level)2206 outfile.write('),\n')2207 level -= 12208 showIndent(outfile, level)2209 outfile.write('],\n')2210 def build(self, node_):2211 attrs = node_.attributes2212 self.buildAttributes(attrs)2213 for child_ in node_.childNodes:2214 nodeName_ = child_.nodeName.split(':')[-1]2215 self.buildChildren(child_, nodeName_)2216 def buildAttributes(self, attrs):2217 if attrs.get('initonly'):2218 self.initonly = attrs.get('initonly').value2219 if attrs.get('kind'):2220 self.kind = attrs.get('kind').value2221 if attrs.get('volatile'):2222 self.volatile = attrs.get('volatile').value2223 if attrs.get('const'):2224 self.const = attrs.get('const').value2225 if attrs.get('raise'):2226 self.raisexx = attrs.get('raise').value2227 if attrs.get('virt'):2228 self.virt = attrs.get('virt').value2229 if attrs.get('readable'):2230 self.readable = attrs.get('readable').value2231 if attrs.get('prot'):2232 self.prot = attrs.get('prot').value2233 if attrs.get('explicit'):2234 self.explicit = attrs.get('explicit').value2235 if attrs.get('new'):2236 self.new = attrs.get('new').value2237 if attrs.get('final'):2238 self.final = attrs.get('final').value2239 if attrs.get('writable'):2240 self.writable = attrs.get('writable').value2241 if attrs.get('add'):2242 self.add = attrs.get('add').value2243 if attrs.get('static'):2244 self.static = attrs.get('static').value2245 if attrs.get('remove'):2246 self.remove = attrs.get('remove').value2247 if attrs.get('sealed'):2248 self.sealed = attrs.get('sealed').value2249 if attrs.get('mutable'):2250 self.mutable = attrs.get('mutable').value2251 if attrs.get('gettable'):2252 self.gettable = attrs.get('gettable').value2253 if attrs.get('inline'):2254 self.inline = attrs.get('inline').value2255 if attrs.get('settable'):2256 self.settable = attrs.get('settable').value2257 if attrs.get('id'):2258 self.id = attrs.get('id').value2259 def buildChildren(self, child_, nodeName_):2260 if child_.nodeType == Node.ELEMENT_NODE and \2261 nodeName_ == 'templateparamlist':2262 obj_ = templateparamlistType.factory()2263 obj_.build(child_)2264 self.set_templateparamlist(obj_)2265 elif child_.nodeType == Node.ELEMENT_NODE and \2266 nodeName_ == 'type':2267 obj_ = linkedTextType.factory()2268 obj_.build(child_)2269 self.set_type(obj_)2270 elif child_.nodeType == Node.ELEMENT_NODE and \2271 nodeName_ == 'definition':2272 definition_ = ''2273 for text__content_ in child_.childNodes:2274 definition_ += text__content_.nodeValue2275 self.definition = definition_2276 elif child_.nodeType == Node.ELEMENT_NODE and \2277 nodeName_ == 'argsstring':2278 argsstring_ = ''2279 for text__content_ in child_.childNodes:2280 argsstring_ += text__content_.nodeValue2281 self.argsstring = argsstring_2282 elif child_.nodeType == Node.ELEMENT_NODE and \2283 nodeName_ == 'name':2284 name_ = ''2285 for text__content_ in child_.childNodes:2286 name_ += text__content_.nodeValue2287 self.name = name_2288 elif child_.nodeType == Node.ELEMENT_NODE and \2289 nodeName_ == 'read':2290 read_ = ''2291 for text__content_ in child_.childNodes:2292 read_ += text__content_.nodeValue2293 self.read = read_2294 elif child_.nodeType == Node.ELEMENT_NODE and \2295 nodeName_ == 'write':2296 write_ = ''2297 for text__content_ in child_.childNodes:2298 write_ += text__content_.nodeValue2299 self.write = write_2300 elif child_.nodeType == Node.ELEMENT_NODE and \2301 nodeName_ == 'bitfield':2302 bitfield_ = ''2303 for text__content_ in child_.childNodes:2304 bitfield_ += text__content_.nodeValue2305 self.bitfield = bitfield_2306 elif child_.nodeType == Node.ELEMENT_NODE and \2307 nodeName_ == 'reimplements':2308 obj_ = reimplementType.factory()2309 obj_.build(child_)2310 self.reimplements.append(obj_)2311 elif child_.nodeType == Node.ELEMENT_NODE and \2312 nodeName_ == 'reimplementedby':2313 obj_ = reimplementType.factory()2314 obj_.build(child_)2315 self.reimplementedby.append(obj_)2316 elif child_.nodeType == Node.ELEMENT_NODE and \2317 nodeName_ == 'param':2318 obj_ = paramType.factory()2319 obj_.build(child_)2320 self.param.append(obj_)2321 elif child_.nodeType == Node.ELEMENT_NODE and \2322 nodeName_ == 'enumvalue':2323 obj_ = enumvalueType.factory()2324 obj_.build(child_)2325 self.enumvalue.append(obj_)2326 elif child_.nodeType == Node.ELEMENT_NODE and \2327 nodeName_ == 'initializer':2328 obj_ = linkedTextType.factory()2329 obj_.build(child_)2330 self.set_initializer(obj_)2331 elif child_.nodeType == Node.ELEMENT_NODE and \2332 nodeName_ == 'exceptions':2333 obj_ = linkedTextType.factory()2334 obj_.build(child_)2335 self.set_exceptions(obj_)2336 elif child_.nodeType == Node.ELEMENT_NODE and \2337 nodeName_ == 'briefdescription':2338 obj_ = descriptionType.factory()2339 obj_.build(child_)2340 self.set_briefdescription(obj_)2341 elif child_.nodeType == Node.ELEMENT_NODE and \2342 nodeName_ == 'detaileddescription':2343 obj_ = descriptionType.factory()2344 obj_.build(child_)2345 self.set_detaileddescription(obj_)2346 elif child_.nodeType == Node.ELEMENT_NODE and \2347 nodeName_ == 'inbodydescription':2348 obj_ = descriptionType.factory()2349 obj_.build(child_)2350 self.set_inbodydescription(obj_)2351 elif child_.nodeType == Node.ELEMENT_NODE and \2352 nodeName_ == 'location':2353 obj_ = locationType.factory()2354 obj_.build(child_)2355 self.set_location(obj_)2356 elif child_.nodeType == Node.ELEMENT_NODE and \2357 nodeName_ == 'references':2358 obj_ = referenceType.factory()2359 obj_.build(child_)2360 self.references.append(obj_)2361 elif child_.nodeType == Node.ELEMENT_NODE and \2362 nodeName_ == 'referencedby':2363 obj_ = referenceType.factory()2364 obj_.build(child_)2365 self.referencedby.append(obj_)2366# end class memberdefType2367class definition(GeneratedsSuper):2368 subclass = None2369 superclass = None2370 def __init__(self, valueOf_=''):2371 self.valueOf_ = valueOf_2372 def factory(*args_, **kwargs_):2373 if definition.subclass:2374 return definition.subclass(*args_, **kwargs_)2375 else:2376 return definition(*args_, **kwargs_)2377 factory = staticmethod(factory)2378 def getValueOf_(self): return self.valueOf_2379 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2380 def export(self, outfile, level, namespace_='', name_='definition', namespacedef_=''):2381 showIndent(outfile, level)2382 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2383 self.exportAttributes(outfile, level, namespace_, name_='definition')2384 if self.hasContent_():2385 outfile.write('>\n')2386 self.exportChildren(outfile, level + 1, namespace_, name_)2387 showIndent(outfile, level)2388 outfile.write('</%s%s>\n' % (namespace_, name_))2389 else:2390 outfile.write(' />\n')2391 def exportAttributes(self, outfile, level, namespace_='', name_='definition'):2392 pass2393 def exportChildren(self, outfile, level, namespace_='', name_='definition'):2394 if self.valueOf_.find('![CDATA')>-1:2395 value=quote_xml('%s' % self.valueOf_)2396 value=value.replace('![CDATA','<![CDATA')2397 value=value.replace(']]',']]>')2398 outfile.write(value)2399 else:2400 outfile.write(quote_xml('%s' % self.valueOf_))2401 def hasContent_(self):2402 if (2403 self.valueOf_ is not None2404 ):2405 return True2406 else:2407 return False2408 def exportLiteral(self, outfile, level, name_='definition'):2409 level += 12410 self.exportLiteralAttributes(outfile, level, name_)2411 if self.hasContent_():2412 self.exportLiteralChildren(outfile, level, name_)2413 def exportLiteralAttributes(self, outfile, level, name_):2414 pass2415 def exportLiteralChildren(self, outfile, level, name_):2416 showIndent(outfile, level)2417 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2418 def build(self, node_):2419 attrs = node_.attributes2420 self.buildAttributes(attrs)2421 self.valueOf_ = ''2422 for child_ in node_.childNodes:2423 nodeName_ = child_.nodeName.split(':')[-1]2424 self.buildChildren(child_, nodeName_)2425 def buildAttributes(self, attrs):2426 pass2427 def buildChildren(self, child_, nodeName_):2428 if child_.nodeType == Node.TEXT_NODE:2429 self.valueOf_ += child_.nodeValue2430 elif child_.nodeType == Node.CDATA_SECTION_NODE:2431 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2432# end class definition2433class argsstring(GeneratedsSuper):2434 subclass = None2435 superclass = None2436 def __init__(self, valueOf_=''):2437 self.valueOf_ = valueOf_2438 def factory(*args_, **kwargs_):2439 if argsstring.subclass:2440 return argsstring.subclass(*args_, **kwargs_)2441 else:2442 return argsstring(*args_, **kwargs_)2443 factory = staticmethod(factory)2444 def getValueOf_(self): return self.valueOf_2445 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2446 def export(self, outfile, level, namespace_='', name_='argsstring', namespacedef_=''):2447 showIndent(outfile, level)2448 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2449 self.exportAttributes(outfile, level, namespace_, name_='argsstring')2450 if self.hasContent_():2451 outfile.write('>\n')2452 self.exportChildren(outfile, level + 1, namespace_, name_)2453 showIndent(outfile, level)2454 outfile.write('</%s%s>\n' % (namespace_, name_))2455 else:2456 outfile.write(' />\n')2457 def exportAttributes(self, outfile, level, namespace_='', name_='argsstring'):2458 pass2459 def exportChildren(self, outfile, level, namespace_='', name_='argsstring'):2460 if self.valueOf_.find('![CDATA')>-1:2461 value=quote_xml('%s' % self.valueOf_)2462 value=value.replace('![CDATA','<![CDATA')2463 value=value.replace(']]',']]>')2464 outfile.write(value)2465 else:2466 outfile.write(quote_xml('%s' % self.valueOf_))2467 def hasContent_(self):2468 if (2469 self.valueOf_ is not None2470 ):2471 return True2472 else:2473 return False2474 def exportLiteral(self, outfile, level, name_='argsstring'):2475 level += 12476 self.exportLiteralAttributes(outfile, level, name_)2477 if self.hasContent_():2478 self.exportLiteralChildren(outfile, level, name_)2479 def exportLiteralAttributes(self, outfile, level, name_):2480 pass2481 def exportLiteralChildren(self, outfile, level, name_):2482 showIndent(outfile, level)2483 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2484 def build(self, node_):2485 attrs = node_.attributes2486 self.buildAttributes(attrs)2487 self.valueOf_ = ''2488 for child_ in node_.childNodes:2489 nodeName_ = child_.nodeName.split(':')[-1]2490 self.buildChildren(child_, nodeName_)2491 def buildAttributes(self, attrs):2492 pass2493 def buildChildren(self, child_, nodeName_):2494 if child_.nodeType == Node.TEXT_NODE:2495 self.valueOf_ += child_.nodeValue2496 elif child_.nodeType == Node.CDATA_SECTION_NODE:2497 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2498# end class argsstring2499class read(GeneratedsSuper):2500 subclass = None2501 superclass = None2502 def __init__(self, valueOf_=''):2503 self.valueOf_ = valueOf_2504 def factory(*args_, **kwargs_):2505 if read.subclass:2506 return read.subclass(*args_, **kwargs_)2507 else:2508 return read(*args_, **kwargs_)2509 factory = staticmethod(factory)2510 def getValueOf_(self): return self.valueOf_2511 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2512 def export(self, outfile, level, namespace_='', name_='read', namespacedef_=''):2513 showIndent(outfile, level)2514 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2515 self.exportAttributes(outfile, level, namespace_, name_='read')2516 if self.hasContent_():2517 outfile.write('>\n')2518 self.exportChildren(outfile, level + 1, namespace_, name_)2519 showIndent(outfile, level)2520 outfile.write('</%s%s>\n' % (namespace_, name_))2521 else:2522 outfile.write(' />\n')2523 def exportAttributes(self, outfile, level, namespace_='', name_='read'):2524 pass2525 def exportChildren(self, outfile, level, namespace_='', name_='read'):2526 if self.valueOf_.find('![CDATA')>-1:2527 value=quote_xml('%s' % self.valueOf_)2528 value=value.replace('![CDATA','<![CDATA')2529 value=value.replace(']]',']]>')2530 outfile.write(value)2531 else:2532 outfile.write(quote_xml('%s' % self.valueOf_))2533 def hasContent_(self):2534 if (2535 self.valueOf_ is not None2536 ):2537 return True2538 else:2539 return False2540 def exportLiteral(self, outfile, level, name_='read'):2541 level += 12542 self.exportLiteralAttributes(outfile, level, name_)2543 if self.hasContent_():2544 self.exportLiteralChildren(outfile, level, name_)2545 def exportLiteralAttributes(self, outfile, level, name_):2546 pass2547 def exportLiteralChildren(self, outfile, level, name_):2548 showIndent(outfile, level)2549 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2550 def build(self, node_):2551 attrs = node_.attributes2552 self.buildAttributes(attrs)2553 self.valueOf_ = ''2554 for child_ in node_.childNodes:2555 nodeName_ = child_.nodeName.split(':')[-1]2556 self.buildChildren(child_, nodeName_)2557 def buildAttributes(self, attrs):2558 pass2559 def buildChildren(self, child_, nodeName_):2560 if child_.nodeType == Node.TEXT_NODE:2561 self.valueOf_ += child_.nodeValue2562 elif child_.nodeType == Node.CDATA_SECTION_NODE:2563 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2564# end class read2565class write(GeneratedsSuper):2566 subclass = None2567 superclass = None2568 def __init__(self, valueOf_=''):2569 self.valueOf_ = valueOf_2570 def factory(*args_, **kwargs_):2571 if write.subclass:2572 return write.subclass(*args_, **kwargs_)2573 else:2574 return write(*args_, **kwargs_)2575 factory = staticmethod(factory)2576 def getValueOf_(self): return self.valueOf_2577 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2578 def export(self, outfile, level, namespace_='', name_='write', namespacedef_=''):2579 showIndent(outfile, level)2580 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2581 self.exportAttributes(outfile, level, namespace_, name_='write')2582 if self.hasContent_():2583 outfile.write('>\n')2584 self.exportChildren(outfile, level + 1, namespace_, name_)2585 showIndent(outfile, level)2586 outfile.write('</%s%s>\n' % (namespace_, name_))2587 else:2588 outfile.write(' />\n')2589 def exportAttributes(self, outfile, level, namespace_='', name_='write'):2590 pass2591 def exportChildren(self, outfile, level, namespace_='', name_='write'):2592 if self.valueOf_.find('![CDATA')>-1:2593 value=quote_xml('%s' % self.valueOf_)2594 value=value.replace('![CDATA','<![CDATA')2595 value=value.replace(']]',']]>')2596 outfile.write(value)2597 else:2598 outfile.write(quote_xml('%s' % self.valueOf_))2599 def hasContent_(self):2600 if (2601 self.valueOf_ is not None2602 ):2603 return True2604 else:2605 return False2606 def exportLiteral(self, outfile, level, name_='write'):2607 level += 12608 self.exportLiteralAttributes(outfile, level, name_)2609 if self.hasContent_():2610 self.exportLiteralChildren(outfile, level, name_)2611 def exportLiteralAttributes(self, outfile, level, name_):2612 pass2613 def exportLiteralChildren(self, outfile, level, name_):2614 showIndent(outfile, level)2615 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2616 def build(self, node_):2617 attrs = node_.attributes2618 self.buildAttributes(attrs)2619 self.valueOf_ = ''2620 for child_ in node_.childNodes:2621 nodeName_ = child_.nodeName.split(':')[-1]2622 self.buildChildren(child_, nodeName_)2623 def buildAttributes(self, attrs):2624 pass2625 def buildChildren(self, child_, nodeName_):2626 if child_.nodeType == Node.TEXT_NODE:2627 self.valueOf_ += child_.nodeValue2628 elif child_.nodeType == Node.CDATA_SECTION_NODE:2629 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2630# end class write2631class bitfield(GeneratedsSuper):2632 subclass = None2633 superclass = None2634 def __init__(self, valueOf_=''):2635 self.valueOf_ = valueOf_2636 def factory(*args_, **kwargs_):2637 if bitfield.subclass:2638 return bitfield.subclass(*args_, **kwargs_)2639 else:2640 return bitfield(*args_, **kwargs_)2641 factory = staticmethod(factory)2642 def getValueOf_(self): return self.valueOf_2643 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2644 def export(self, outfile, level, namespace_='', name_='bitfield', namespacedef_=''):2645 showIndent(outfile, level)2646 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2647 self.exportAttributes(outfile, level, namespace_, name_='bitfield')2648 if self.hasContent_():2649 outfile.write('>\n')2650 self.exportChildren(outfile, level + 1, namespace_, name_)2651 showIndent(outfile, level)2652 outfile.write('</%s%s>\n' % (namespace_, name_))2653 else:2654 outfile.write(' />\n')2655 def exportAttributes(self, outfile, level, namespace_='', name_='bitfield'):2656 pass2657 def exportChildren(self, outfile, level, namespace_='', name_='bitfield'):2658 if self.valueOf_.find('![CDATA')>-1:2659 value=quote_xml('%s' % self.valueOf_)2660 value=value.replace('![CDATA','<![CDATA')2661 value=value.replace(']]',']]>')2662 outfile.write(value)2663 else:2664 outfile.write(quote_xml('%s' % self.valueOf_))2665 def hasContent_(self):2666 if (2667 self.valueOf_ is not None2668 ):2669 return True2670 else:2671 return False2672 def exportLiteral(self, outfile, level, name_='bitfield'):2673 level += 12674 self.exportLiteralAttributes(outfile, level, name_)2675 if self.hasContent_():2676 self.exportLiteralChildren(outfile, level, name_)2677 def exportLiteralAttributes(self, outfile, level, name_):2678 pass2679 def exportLiteralChildren(self, outfile, level, name_):2680 showIndent(outfile, level)2681 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2682 def build(self, node_):2683 attrs = node_.attributes2684 self.buildAttributes(attrs)2685 self.valueOf_ = ''2686 for child_ in node_.childNodes:2687 nodeName_ = child_.nodeName.split(':')[-1]2688 self.buildChildren(child_, nodeName_)2689 def buildAttributes(self, attrs):2690 pass2691 def buildChildren(self, child_, nodeName_):2692 if child_.nodeType == Node.TEXT_NODE:2693 self.valueOf_ += child_.nodeValue2694 elif child_.nodeType == Node.CDATA_SECTION_NODE:2695 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2696# end class bitfield2697class descriptionType(GeneratedsSuper):2698 subclass = None2699 superclass = None2700 def __init__(self, title=None, para=None, sect1=None, internal=None, mixedclass_=None, content_=None):2701 if mixedclass_ is None:2702 self.mixedclass_ = MixedContainer2703 else:2704 self.mixedclass_ = mixedclass_2705 if content_ is None:2706 self.content_ = []2707 else:2708 self.content_ = content_2709 def factory(*args_, **kwargs_):2710 if descriptionType.subclass:2711 return descriptionType.subclass(*args_, **kwargs_)2712 else:2713 return descriptionType(*args_, **kwargs_)2714 factory = staticmethod(factory)2715 def get_title(self): return self.title2716 def set_title(self, title): self.title = title2717 def get_para(self): return self.para2718 def set_para(self, para): self.para = para2719 def add_para(self, value): self.para.append(value)2720 def insert_para(self, index, value): self.para[index] = value2721 def get_sect1(self): return self.sect12722 def set_sect1(self, sect1): self.sect1 = sect12723 def add_sect1(self, value): self.sect1.append(value)2724 def insert_sect1(self, index, value): self.sect1[index] = value2725 def get_internal(self): return self.internal2726 def set_internal(self, internal): self.internal = internal2727 def export(self, outfile, level, namespace_='', name_='descriptionType', namespacedef_=''):2728 showIndent(outfile, level)2729 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2730 self.exportAttributes(outfile, level, namespace_, name_='descriptionType')2731 outfile.write('>')2732 self.exportChildren(outfile, level + 1, namespace_, name_)2733 outfile.write('</%s%s>\n' % (namespace_, name_))2734 def exportAttributes(self, outfile, level, namespace_='', name_='descriptionType'):2735 pass2736 def exportChildren(self, outfile, level, namespace_='', name_='descriptionType'):2737 for item_ in self.content_:2738 item_.export(outfile, level, item_.name, namespace_)2739 def hasContent_(self):2740 if (2741 self.title is not None or2742 self.para is not None or2743 self.sect1 is not None or2744 self.internal is not None2745 ):2746 return True2747 else:2748 return False2749 def exportLiteral(self, outfile, level, name_='descriptionType'):2750 level += 12751 self.exportLiteralAttributes(outfile, level, name_)2752 if self.hasContent_():2753 self.exportLiteralChildren(outfile, level, name_)2754 def exportLiteralAttributes(self, outfile, level, name_):2755 pass2756 def exportLiteralChildren(self, outfile, level, name_):2757 showIndent(outfile, level)2758 outfile.write('content_ = [\n')2759 for item_ in self.content_:2760 item_.exportLiteral(outfile, level, name_)2761 showIndent(outfile, level)2762 outfile.write('],\n')2763 showIndent(outfile, level)2764 outfile.write('content_ = [\n')2765 for item_ in self.content_:2766 item_.exportLiteral(outfile, level, name_)2767 showIndent(outfile, level)2768 outfile.write('],\n')2769 showIndent(outfile, level)2770 outfile.write('content_ = [\n')2771 for item_ in self.content_:2772 item_.exportLiteral(outfile, level, name_)2773 showIndent(outfile, level)2774 outfile.write('],\n')2775 showIndent(outfile, level)2776 outfile.write('content_ = [\n')2777 for item_ in self.content_:2778 item_.exportLiteral(outfile, level, name_)2779 showIndent(outfile, level)2780 outfile.write('],\n')2781 def build(self, node_):2782 attrs = node_.attributes2783 self.buildAttributes(attrs)2784 for child_ in node_.childNodes:2785 nodeName_ = child_.nodeName.split(':')[-1]2786 self.buildChildren(child_, nodeName_)2787 def buildAttributes(self, attrs):2788 pass2789 def buildChildren(self, child_, nodeName_):2790 if child_.nodeType == Node.ELEMENT_NODE and \2791 nodeName_ == 'title':2792 childobj_ = docTitleType.factory()2793 childobj_.build(child_)2794 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2795 MixedContainer.TypeNone, 'title', childobj_)2796 self.content_.append(obj_)2797 elif child_.nodeType == Node.ELEMENT_NODE and \2798 nodeName_ == 'para':2799 childobj_ = docParaType.factory()2800 childobj_.build(child_)2801 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2802 MixedContainer.TypeNone, 'para', childobj_)2803 self.content_.append(obj_)2804 elif child_.nodeType == Node.ELEMENT_NODE and \2805 nodeName_ == 'sect1':2806 childobj_ = docSect1Type.factory()2807 childobj_.build(child_)2808 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2809 MixedContainer.TypeNone, 'sect1', childobj_)2810 self.content_.append(obj_)2811 elif child_.nodeType == Node.ELEMENT_NODE and \2812 nodeName_ == 'internal':2813 childobj_ = docInternalType.factory()2814 childobj_.build(child_)2815 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2816 MixedContainer.TypeNone, 'internal', childobj_)2817 self.content_.append(obj_)2818 elif child_.nodeType == Node.TEXT_NODE:2819 obj_ = self.mixedclass_(MixedContainer.CategoryText,2820 MixedContainer.TypeNone, '', child_.nodeValue)2821 self.content_.append(obj_)2822# end class descriptionType2823class enumvalueType(GeneratedsSuper):2824 subclass = None2825 superclass = None2826 def __init__(self, prot=None, id=None, name=None, initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):2827 self.prot = prot2828 self.id = id2829 if mixedclass_ is None:2830 self.mixedclass_ = MixedContainer2831 else:2832 self.mixedclass_ = mixedclass_2833 if content_ is None:2834 self.content_ = []2835 else:2836 self.content_ = content_2837 def factory(*args_, **kwargs_):2838 if enumvalueType.subclass:2839 return enumvalueType.subclass(*args_, **kwargs_)2840 else:2841 return enumvalueType(*args_, **kwargs_)2842 factory = staticmethod(factory)2843 def get_name(self): return self.name2844 def set_name(self, name): self.name = name2845 def get_initializer(self): return self.initializer2846 def set_initializer(self, initializer): self.initializer = initializer2847 def get_briefdescription(self): return self.briefdescription2848 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription2849 def get_detaileddescription(self): return self.detaileddescription2850 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription2851 def get_prot(self): return self.prot2852 def set_prot(self, prot): self.prot = prot2853 def get_id(self): return self.id2854 def set_id(self, id): self.id = id2855 def export(self, outfile, level, namespace_='', name_='enumvalueType', namespacedef_=''):2856 showIndent(outfile, level)2857 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2858 self.exportAttributes(outfile, level, namespace_, name_='enumvalueType')2859 outfile.write('>')2860 self.exportChildren(outfile, level + 1, namespace_, name_)2861 outfile.write('</%s%s>\n' % (namespace_, name_))2862 def exportAttributes(self, outfile, level, namespace_='', name_='enumvalueType'):2863 if self.prot is not None:2864 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))2865 if self.id is not None:2866 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))2867 def exportChildren(self, outfile, level, namespace_='', name_='enumvalueType'):2868 for item_ in self.content_:2869 item_.export(outfile, level, item_.name, namespace_)2870 def hasContent_(self):2871 if (2872 self.name is not None or2873 self.initializer is not None or2874 self.briefdescription is not None or2875 self.detaileddescription is not None2876 ):2877 return True2878 else:2879 return False2880 def exportLiteral(self, outfile, level, name_='enumvalueType'):2881 level += 12882 self.exportLiteralAttributes(outfile, level, name_)2883 if self.hasContent_():2884 self.exportLiteralChildren(outfile, level, name_)2885 def exportLiteralAttributes(self, outfile, level, name_):2886 if self.prot is not None:2887 showIndent(outfile, level)2888 outfile.write('prot = "%s",\n' % (self.prot,))2889 if self.id is not None:2890 showIndent(outfile, level)2891 outfile.write('id = %s,\n' % (self.id,))2892 def exportLiteralChildren(self, outfile, level, name_):2893 showIndent(outfile, level)2894 outfile.write('content_ = [\n')2895 for item_ in self.content_:2896 item_.exportLiteral(outfile, level, name_)2897 showIndent(outfile, level)2898 outfile.write('],\n')2899 showIndent(outfile, level)2900 outfile.write('content_ = [\n')2901 for item_ in self.content_:2902 item_.exportLiteral(outfile, level, name_)2903 showIndent(outfile, level)2904 outfile.write('],\n')2905 showIndent(outfile, level)2906 outfile.write('content_ = [\n')2907 for item_ in self.content_:2908 item_.exportLiteral(outfile, level, name_)2909 showIndent(outfile, level)2910 outfile.write('],\n')2911 showIndent(outfile, level)2912 outfile.write('content_ = [\n')2913 for item_ in self.content_:2914 item_.exportLiteral(outfile, level, name_)2915 showIndent(outfile, level)2916 outfile.write('],\n')2917 def build(self, node_):2918 attrs = node_.attributes2919 self.buildAttributes(attrs)2920 for child_ in node_.childNodes:2921 nodeName_ = child_.nodeName.split(':')[-1]2922 self.buildChildren(child_, nodeName_)2923 def buildAttributes(self, attrs):2924 if attrs.get('prot'):2925 self.prot = attrs.get('prot').value2926 if attrs.get('id'):2927 self.id = attrs.get('id').value2928 def buildChildren(self, child_, nodeName_):2929 if child_.nodeType == Node.ELEMENT_NODE and \2930 nodeName_ == 'name':2931 value_ = []2932 for text_ in child_.childNodes:2933 value_.append(text_.nodeValue)2934 valuestr_ = ''.join(value_)2935 obj_ = self.mixedclass_(MixedContainer.CategorySimple,2936 MixedContainer.TypeString, 'name', valuestr_)2937 self.content_.append(obj_)2938 elif child_.nodeType == Node.ELEMENT_NODE and \2939 nodeName_ == 'initializer':2940 childobj_ = linkedTextType.factory()2941 childobj_.build(child_)2942 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2943 MixedContainer.TypeNone, 'initializer', childobj_)2944 self.content_.append(obj_)2945 elif child_.nodeType == Node.ELEMENT_NODE and \2946 nodeName_ == 'briefdescription':2947 childobj_ = descriptionType.factory()2948 childobj_.build(child_)2949 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2950 MixedContainer.TypeNone, 'briefdescription', childobj_)2951 self.content_.append(obj_)2952 elif child_.nodeType == Node.ELEMENT_NODE and \2953 nodeName_ == 'detaileddescription':2954 childobj_ = descriptionType.factory()2955 childobj_.build(child_)2956 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2957 MixedContainer.TypeNone, 'detaileddescription', childobj_)2958 self.content_.append(obj_)2959 elif child_.nodeType == Node.TEXT_NODE:2960 obj_ = self.mixedclass_(MixedContainer.CategoryText,2961 MixedContainer.TypeNone, '', child_.nodeValue)2962 self.content_.append(obj_)2963# end class enumvalueType2964class templateparamlistType(GeneratedsSuper):2965 subclass = None2966 superclass = None2967 def __init__(self, param=None):2968 if param is None:2969 self.param = []2970 else:2971 self.param = param2972 def factory(*args_, **kwargs_):2973 if templateparamlistType.subclass:2974 return templateparamlistType.subclass(*args_, **kwargs_)2975 else:2976 return templateparamlistType(*args_, **kwargs_)2977 factory = staticmethod(factory)2978 def get_param(self): return self.param2979 def set_param(self, param): self.param = param2980 def add_param(self, value): self.param.append(value)2981 def insert_param(self, index, value): self.param[index] = value2982 def export(self, outfile, level, namespace_='', name_='templateparamlistType', namespacedef_=''):2983 showIndent(outfile, level)2984 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2985 self.exportAttributes(outfile, level, namespace_, name_='templateparamlistType')2986 if self.hasContent_():2987 outfile.write('>\n')2988 self.exportChildren(outfile, level + 1, namespace_, name_)2989 showIndent(outfile, level)2990 outfile.write('</%s%s>\n' % (namespace_, name_))2991 else:2992 outfile.write(' />\n')2993 def exportAttributes(self, outfile, level, namespace_='', name_='templateparamlistType'):2994 pass2995 def exportChildren(self, outfile, level, namespace_='', name_='templateparamlistType'):2996 for param_ in self.param:2997 param_.export(outfile, level, namespace_, name_='param')2998 def hasContent_(self):2999 if (3000 self.param is not None3001 ):3002 return True3003 else:3004 return False3005 def exportLiteral(self, outfile, level, name_='templateparamlistType'):3006 level += 13007 self.exportLiteralAttributes(outfile, level, name_)3008 if self.hasContent_():3009 self.exportLiteralChildren(outfile, level, name_)3010 def exportLiteralAttributes(self, outfile, level, name_):3011 pass3012 def exportLiteralChildren(self, outfile, level, name_):3013 showIndent(outfile, level)3014 outfile.write('param=[\n')3015 level += 13016 for param in self.param:3017 showIndent(outfile, level)3018 outfile.write('model_.param(\n')3019 param.exportLiteral(outfile, level, name_='param')3020 showIndent(outfile, level)3021 outfile.write('),\n')3022 level -= 13023 showIndent(outfile, level)3024 outfile.write('],\n')3025 def build(self, node_):3026 attrs = node_.attributes3027 self.buildAttributes(attrs)3028 for child_ in node_.childNodes:3029 nodeName_ = child_.nodeName.split(':')[-1]3030 self.buildChildren(child_, nodeName_)3031 def buildAttributes(self, attrs):3032 pass3033 def buildChildren(self, child_, nodeName_):3034 if child_.nodeType == Node.ELEMENT_NODE and \3035 nodeName_ == 'param':3036 obj_ = paramType.factory()3037 obj_.build(child_)3038 self.param.append(obj_)3039# end class templateparamlistType3040class paramType(GeneratedsSuper):3041 subclass = None3042 superclass = None3043 def __init__(self, type_=None, declname=None, defname=None, array=None, defval=None, briefdescription=None):3044 self.type_ = type_3045 self.declname = declname3046 self.defname = defname3047 self.array = array3048 self.defval = defval3049 self.briefdescription = briefdescription3050 def factory(*args_, **kwargs_):3051 if paramType.subclass:3052 return paramType.subclass(*args_, **kwargs_)3053 else:3054 return paramType(*args_, **kwargs_)3055 factory = staticmethod(factory)3056 def get_type(self): return self.type_3057 def set_type(self, type_): self.type_ = type_3058 def get_declname(self): return self.declname3059 def set_declname(self, declname): self.declname = declname3060 def get_defname(self): return self.defname3061 def set_defname(self, defname): self.defname = defname3062 def get_array(self): return self.array3063 def set_array(self, array): self.array = array3064 def get_defval(self): return self.defval3065 def set_defval(self, defval): self.defval = defval3066 def get_briefdescription(self): return self.briefdescription3067 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription3068 def export(self, outfile, level, namespace_='', name_='paramType', namespacedef_=''):3069 showIndent(outfile, level)3070 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3071 self.exportAttributes(outfile, level, namespace_, name_='paramType')3072 if self.hasContent_():3073 outfile.write('>\n')3074 self.exportChildren(outfile, level + 1, namespace_, name_)3075 showIndent(outfile, level)3076 outfile.write('</%s%s>\n' % (namespace_, name_))3077 else:3078 outfile.write(' />\n')3079 def exportAttributes(self, outfile, level, namespace_='', name_='paramType'):3080 pass3081 def exportChildren(self, outfile, level, namespace_='', name_='paramType'):3082 if self.type_:3083 self.type_.export(outfile, level, namespace_, name_='type')3084 if self.declname is not None:3085 showIndent(outfile, level)3086 outfile.write('<%sdeclname>%s</%sdeclname>\n' % (namespace_, self.format_string(quote_xml(self.declname).encode(ExternalEncoding), input_name='declname'), namespace_))3087 if self.defname is not None:3088 showIndent(outfile, level)3089 outfile.write('<%sdefname>%s</%sdefname>\n' % (namespace_, self.format_string(quote_xml(self.defname).encode(ExternalEncoding), input_name='defname'), namespace_))3090 if self.array is not None:3091 showIndent(outfile, level)3092 outfile.write('<%sarray>%s</%sarray>\n' % (namespace_, self.format_string(quote_xml(self.array).encode(ExternalEncoding), input_name='array'), namespace_))3093 if self.defval:3094 self.defval.export(outfile, level, namespace_, name_='defval')3095 if self.briefdescription:3096 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')3097 def hasContent_(self):3098 if (3099 self.type_ is not None or3100 self.declname is not None or3101 self.defname is not None or3102 self.array is not None or3103 self.defval is not None or3104 self.briefdescription is not None3105 ):3106 return True3107 else:3108 return False3109 def exportLiteral(self, outfile, level, name_='paramType'):3110 level += 13111 self.exportLiteralAttributes(outfile, level, name_)3112 if self.hasContent_():3113 self.exportLiteralChildren(outfile, level, name_)3114 def exportLiteralAttributes(self, outfile, level, name_):3115 pass3116 def exportLiteralChildren(self, outfile, level, name_):3117 if self.type_:3118 showIndent(outfile, level)3119 outfile.write('type_=model_.linkedTextType(\n')3120 self.type_.exportLiteral(outfile, level, name_='type')3121 showIndent(outfile, level)3122 outfile.write('),\n')3123 showIndent(outfile, level)3124 outfile.write('declname=%s,\n' % quote_python(self.declname).encode(ExternalEncoding))3125 showIndent(outfile, level)3126 outfile.write('defname=%s,\n' % quote_python(self.defname).encode(ExternalEncoding))3127 showIndent(outfile, level)3128 outfile.write('array=%s,\n' % quote_python(self.array).encode(ExternalEncoding))3129 if self.defval:3130 showIndent(outfile, level)3131 outfile.write('defval=model_.linkedTextType(\n')3132 self.defval.exportLiteral(outfile, level, name_='defval')3133 showIndent(outfile, level)3134 outfile.write('),\n')3135 if self.briefdescription:3136 showIndent(outfile, level)3137 outfile.write('briefdescription=model_.descriptionType(\n')3138 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')3139 showIndent(outfile, level)3140 outfile.write('),\n')3141 def build(self, node_):3142 attrs = node_.attributes3143 self.buildAttributes(attrs)3144 for child_ in node_.childNodes:3145 nodeName_ = child_.nodeName.split(':')[-1]3146 self.buildChildren(child_, nodeName_)3147 def buildAttributes(self, attrs):3148 pass3149 def buildChildren(self, child_, nodeName_):3150 if child_.nodeType == Node.ELEMENT_NODE and \3151 nodeName_ == 'type':3152 obj_ = linkedTextType.factory()3153 obj_.build(child_)3154 self.set_type(obj_)3155 elif child_.nodeType == Node.ELEMENT_NODE and \3156 nodeName_ == 'declname':3157 declname_ = ''3158 for text__content_ in child_.childNodes:3159 declname_ += text__content_.nodeValue3160 self.declname = declname_3161 elif child_.nodeType == Node.ELEMENT_NODE and \3162 nodeName_ == 'defname':3163 defname_ = ''3164 for text__content_ in child_.childNodes:3165 defname_ += text__content_.nodeValue3166 self.defname = defname_3167 elif child_.nodeType == Node.ELEMENT_NODE and \3168 nodeName_ == 'array':3169 array_ = ''3170 for text__content_ in child_.childNodes:3171 array_ += text__content_.nodeValue3172 self.array = array_3173 elif child_.nodeType == Node.ELEMENT_NODE and \3174 nodeName_ == 'defval':3175 obj_ = linkedTextType.factory()3176 obj_.build(child_)3177 self.set_defval(obj_)3178 elif child_.nodeType == Node.ELEMENT_NODE and \3179 nodeName_ == 'briefdescription':3180 obj_ = descriptionType.factory()3181 obj_.build(child_)3182 self.set_briefdescription(obj_)3183# end class paramType3184class declname(GeneratedsSuper):3185 subclass = None3186 superclass = None3187 def __init__(self, valueOf_=''):3188 self.valueOf_ = valueOf_3189 def factory(*args_, **kwargs_):3190 if declname.subclass:3191 return declname.subclass(*args_, **kwargs_)3192 else:3193 return declname(*args_, **kwargs_)3194 factory = staticmethod(factory)3195 def getValueOf_(self): return self.valueOf_3196 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3197 def export(self, outfile, level, namespace_='', name_='declname', namespacedef_=''):3198 showIndent(outfile, level)3199 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3200 self.exportAttributes(outfile, level, namespace_, name_='declname')3201 if self.hasContent_():3202 outfile.write('>\n')3203 self.exportChildren(outfile, level + 1, namespace_, name_)3204 showIndent(outfile, level)3205 outfile.write('</%s%s>\n' % (namespace_, name_))3206 else:3207 outfile.write(' />\n')3208 def exportAttributes(self, outfile, level, namespace_='', name_='declname'):3209 pass3210 def exportChildren(self, outfile, level, namespace_='', name_='declname'):3211 if self.valueOf_.find('![CDATA')>-1:3212 value=quote_xml('%s' % self.valueOf_)3213 value=value.replace('![CDATA','<![CDATA')3214 value=value.replace(']]',']]>')3215 outfile.write(value)3216 else:3217 outfile.write(quote_xml('%s' % self.valueOf_))3218 def hasContent_(self):3219 if (3220 self.valueOf_ is not None3221 ):3222 return True3223 else:3224 return False3225 def exportLiteral(self, outfile, level, name_='declname'):3226 level += 13227 self.exportLiteralAttributes(outfile, level, name_)3228 if self.hasContent_():3229 self.exportLiteralChildren(outfile, level, name_)3230 def exportLiteralAttributes(self, outfile, level, name_):3231 pass3232 def exportLiteralChildren(self, outfile, level, name_):3233 showIndent(outfile, level)3234 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3235 def build(self, node_):3236 attrs = node_.attributes3237 self.buildAttributes(attrs)3238 self.valueOf_ = ''3239 for child_ in node_.childNodes:3240 nodeName_ = child_.nodeName.split(':')[-1]3241 self.buildChildren(child_, nodeName_)3242 def buildAttributes(self, attrs):3243 pass3244 def buildChildren(self, child_, nodeName_):3245 if child_.nodeType == Node.TEXT_NODE:3246 self.valueOf_ += child_.nodeValue3247 elif child_.nodeType == Node.CDATA_SECTION_NODE:3248 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3249# end class declname3250class defname(GeneratedsSuper):3251 subclass = None3252 superclass = None3253 def __init__(self, valueOf_=''):3254 self.valueOf_ = valueOf_3255 def factory(*args_, **kwargs_):3256 if defname.subclass:3257 return defname.subclass(*args_, **kwargs_)3258 else:3259 return defname(*args_, **kwargs_)3260 factory = staticmethod(factory)3261 def getValueOf_(self): return self.valueOf_3262 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3263 def export(self, outfile, level, namespace_='', name_='defname', namespacedef_=''):3264 showIndent(outfile, level)3265 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3266 self.exportAttributes(outfile, level, namespace_, name_='defname')3267 if self.hasContent_():3268 outfile.write('>\n')3269 self.exportChildren(outfile, level + 1, namespace_, name_)3270 showIndent(outfile, level)3271 outfile.write('</%s%s>\n' % (namespace_, name_))3272 else:3273 outfile.write(' />\n')3274 def exportAttributes(self, outfile, level, namespace_='', name_='defname'):3275 pass3276 def exportChildren(self, outfile, level, namespace_='', name_='defname'):3277 if self.valueOf_.find('![CDATA')>-1:3278 value=quote_xml('%s' % self.valueOf_)3279 value=value.replace('![CDATA','<![CDATA')3280 value=value.replace(']]',']]>')3281 outfile.write(value)3282 else:3283 outfile.write(quote_xml('%s' % self.valueOf_))3284 def hasContent_(self):3285 if (3286 self.valueOf_ is not None3287 ):3288 return True3289 else:3290 return False3291 def exportLiteral(self, outfile, level, name_='defname'):3292 level += 13293 self.exportLiteralAttributes(outfile, level, name_)3294 if self.hasContent_():3295 self.exportLiteralChildren(outfile, level, name_)3296 def exportLiteralAttributes(self, outfile, level, name_):3297 pass3298 def exportLiteralChildren(self, outfile, level, name_):3299 showIndent(outfile, level)3300 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3301 def build(self, node_):3302 attrs = node_.attributes3303 self.buildAttributes(attrs)3304 self.valueOf_ = ''3305 for child_ in node_.childNodes:3306 nodeName_ = child_.nodeName.split(':')[-1]3307 self.buildChildren(child_, nodeName_)3308 def buildAttributes(self, attrs):3309 pass3310 def buildChildren(self, child_, nodeName_):3311 if child_.nodeType == Node.TEXT_NODE:3312 self.valueOf_ += child_.nodeValue3313 elif child_.nodeType == Node.CDATA_SECTION_NODE:3314 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3315# end class defname3316class array(GeneratedsSuper):3317 subclass = None3318 superclass = None3319 def __init__(self, valueOf_=''):3320 self.valueOf_ = valueOf_3321 def factory(*args_, **kwargs_):3322 if array.subclass:3323 return array.subclass(*args_, **kwargs_)3324 else:3325 return array(*args_, **kwargs_)3326 factory = staticmethod(factory)3327 def getValueOf_(self): return self.valueOf_3328 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3329 def export(self, outfile, level, namespace_='', name_='array', namespacedef_=''):3330 showIndent(outfile, level)3331 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3332 self.exportAttributes(outfile, level, namespace_, name_='array')3333 if self.hasContent_():3334 outfile.write('>\n')3335 self.exportChildren(outfile, level + 1, namespace_, name_)3336 showIndent(outfile, level)3337 outfile.write('</%s%s>\n' % (namespace_, name_))3338 else:3339 outfile.write(' />\n')3340 def exportAttributes(self, outfile, level, namespace_='', name_='array'):3341 pass3342 def exportChildren(self, outfile, level, namespace_='', name_='array'):3343 if self.valueOf_.find('![CDATA')>-1:3344 value=quote_xml('%s' % self.valueOf_)3345 value=value.replace('![CDATA','<![CDATA')3346 value=value.replace(']]',']]>')3347 outfile.write(value)3348 else:3349 outfile.write(quote_xml('%s' % self.valueOf_))3350 def hasContent_(self):3351 if (3352 self.valueOf_ is not None3353 ):3354 return True3355 else:3356 return False3357 def exportLiteral(self, outfile, level, name_='array'):3358 level += 13359 self.exportLiteralAttributes(outfile, level, name_)3360 if self.hasContent_():3361 self.exportLiteralChildren(outfile, level, name_)3362 def exportLiteralAttributes(self, outfile, level, name_):3363 pass3364 def exportLiteralChildren(self, outfile, level, name_):3365 showIndent(outfile, level)3366 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3367 def build(self, node_):3368 attrs = node_.attributes3369 self.buildAttributes(attrs)3370 self.valueOf_ = ''3371 for child_ in node_.childNodes:3372 nodeName_ = child_.nodeName.split(':')[-1]3373 self.buildChildren(child_, nodeName_)3374 def buildAttributes(self, attrs):3375 pass3376 def buildChildren(self, child_, nodeName_):3377 if child_.nodeType == Node.TEXT_NODE:3378 self.valueOf_ += child_.nodeValue3379 elif child_.nodeType == Node.CDATA_SECTION_NODE:3380 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3381# end class array3382class linkedTextType(GeneratedsSuper):3383 subclass = None3384 superclass = None3385 def __init__(self, ref=None, mixedclass_=None, content_=None):3386 if mixedclass_ is None:3387 self.mixedclass_ = MixedContainer3388 else:3389 self.mixedclass_ = mixedclass_3390 if content_ is None:3391 self.content_ = []3392 else:3393 self.content_ = content_3394 def factory(*args_, **kwargs_):3395 if linkedTextType.subclass:3396 return linkedTextType.subclass(*args_, **kwargs_)3397 else:3398 return linkedTextType(*args_, **kwargs_)3399 factory = staticmethod(factory)3400 def get_ref(self): return self.ref3401 def set_ref(self, ref): self.ref = ref3402 def add_ref(self, value): self.ref.append(value)3403 def insert_ref(self, index, value): self.ref[index] = value3404 def export(self, outfile, level, namespace_='', name_='linkedTextType', namespacedef_=''):3405 showIndent(outfile, level)3406 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3407 self.exportAttributes(outfile, level, namespace_, name_='linkedTextType')3408 outfile.write('>')3409 self.exportChildren(outfile, level + 1, namespace_, name_)3410 outfile.write('</%s%s>\n' % (namespace_, name_))3411 def exportAttributes(self, outfile, level, namespace_='', name_='linkedTextType'):3412 pass3413 def exportChildren(self, outfile, level, namespace_='', name_='linkedTextType'):3414 for item_ in self.content_:3415 item_.export(outfile, level, item_.name, namespace_)3416 def hasContent_(self):3417 if (3418 self.ref is not None3419 ):3420 return True3421 else:3422 return False3423 def exportLiteral(self, outfile, level, name_='linkedTextType'):3424 level += 13425 self.exportLiteralAttributes(outfile, level, name_)3426 if self.hasContent_():3427 self.exportLiteralChildren(outfile, level, name_)3428 def exportLiteralAttributes(self, outfile, level, name_):3429 pass3430 def exportLiteralChildren(self, outfile, level, name_):3431 showIndent(outfile, level)3432 outfile.write('content_ = [\n')3433 for item_ in self.content_:3434 item_.exportLiteral(outfile, level, name_)3435 showIndent(outfile, level)3436 outfile.write('],\n')3437 def build(self, node_):3438 attrs = node_.attributes3439 self.buildAttributes(attrs)3440 for child_ in node_.childNodes:3441 nodeName_ = child_.nodeName.split(':')[-1]3442 self.buildChildren(child_, nodeName_)3443 def buildAttributes(self, attrs):3444 pass3445 def buildChildren(self, child_, nodeName_):3446 if child_.nodeType == Node.ELEMENT_NODE and \3447 nodeName_ == 'ref':3448 childobj_ = docRefTextType.factory()3449 childobj_.build(child_)3450 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3451 MixedContainer.TypeNone, 'ref', childobj_)3452 self.content_.append(obj_)3453 elif child_.nodeType == Node.TEXT_NODE:3454 obj_ = self.mixedclass_(MixedContainer.CategoryText,3455 MixedContainer.TypeNone, '', child_.nodeValue)3456 self.content_.append(obj_)3457# end class linkedTextType3458class graphType(GeneratedsSuper):3459 subclass = None3460 superclass = None3461 def __init__(self, node=None):3462 if node is None:3463 self.node = []3464 else:3465 self.node = node3466 def factory(*args_, **kwargs_):3467 if graphType.subclass:3468 return graphType.subclass(*args_, **kwargs_)3469 else:3470 return graphType(*args_, **kwargs_)3471 factory = staticmethod(factory)3472 def get_node(self): return self.node3473 def set_node(self, node): self.node = node3474 def add_node(self, value): self.node.append(value)3475 def insert_node(self, index, value): self.node[index] = value3476 def export(self, outfile, level, namespace_='', name_='graphType', namespacedef_=''):3477 showIndent(outfile, level)3478 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3479 self.exportAttributes(outfile, level, namespace_, name_='graphType')3480 if self.hasContent_():3481 outfile.write('>\n')3482 self.exportChildren(outfile, level + 1, namespace_, name_)3483 showIndent(outfile, level)3484 outfile.write('</%s%s>\n' % (namespace_, name_))3485 else:3486 outfile.write(' />\n')3487 def exportAttributes(self, outfile, level, namespace_='', name_='graphType'):3488 pass3489 def exportChildren(self, outfile, level, namespace_='', name_='graphType'):3490 for node_ in self.node:3491 node_.export(outfile, level, namespace_, name_='node')3492 def hasContent_(self):3493 if (3494 self.node is not None3495 ):3496 return True3497 else:3498 return False3499 def exportLiteral(self, outfile, level, name_='graphType'):3500 level += 13501 self.exportLiteralAttributes(outfile, level, name_)3502 if self.hasContent_():3503 self.exportLiteralChildren(outfile, level, name_)3504 def exportLiteralAttributes(self, outfile, level, name_):3505 pass3506 def exportLiteralChildren(self, outfile, level, name_):3507 showIndent(outfile, level)3508 outfile.write('node=[\n')3509 level += 13510 for node in self.node:3511 showIndent(outfile, level)3512 outfile.write('model_.node(\n')3513 node.exportLiteral(outfile, level, name_='node')3514 showIndent(outfile, level)3515 outfile.write('),\n')3516 level -= 13517 showIndent(outfile, level)3518 outfile.write('],\n')3519 def build(self, node_):3520 attrs = node_.attributes3521 self.buildAttributes(attrs)3522 for child_ in node_.childNodes:3523 nodeName_ = child_.nodeName.split(':')[-1]3524 self.buildChildren(child_, nodeName_)3525 def buildAttributes(self, attrs):3526 pass3527 def buildChildren(self, child_, nodeName_):3528 if child_.nodeType == Node.ELEMENT_NODE and \3529 nodeName_ == 'node':3530 obj_ = nodeType.factory()3531 obj_.build(child_)3532 self.node.append(obj_)3533# end class graphType3534class nodeType(GeneratedsSuper):3535 subclass = None3536 superclass = None3537 def __init__(self, id=None, label=None, link=None, childnode=None):3538 self.id = id3539 self.label = label3540 self.link = link3541 if childnode is None:3542 self.childnode = []3543 else:3544 self.childnode = childnode3545 def factory(*args_, **kwargs_):3546 if nodeType.subclass:3547 return nodeType.subclass(*args_, **kwargs_)3548 else:3549 return nodeType(*args_, **kwargs_)3550 factory = staticmethod(factory)3551 def get_label(self): return self.label3552 def set_label(self, label): self.label = label3553 def get_link(self): return self.link3554 def set_link(self, link): self.link = link3555 def get_childnode(self): return self.childnode3556 def set_childnode(self, childnode): self.childnode = childnode3557 def add_childnode(self, value): self.childnode.append(value)3558 def insert_childnode(self, index, value): self.childnode[index] = value3559 def get_id(self): return self.id3560 def set_id(self, id): self.id = id3561 def export(self, outfile, level, namespace_='', name_='nodeType', namespacedef_=''):3562 showIndent(outfile, level)3563 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3564 self.exportAttributes(outfile, level, namespace_, name_='nodeType')3565 if self.hasContent_():3566 outfile.write('>\n')3567 self.exportChildren(outfile, level + 1, namespace_, name_)3568 showIndent(outfile, level)3569 outfile.write('</%s%s>\n' % (namespace_, name_))3570 else:3571 outfile.write(' />\n')3572 def exportAttributes(self, outfile, level, namespace_='', name_='nodeType'):3573 if self.id is not None:3574 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3575 def exportChildren(self, outfile, level, namespace_='', name_='nodeType'):3576 if self.label is not None:3577 showIndent(outfile, level)3578 outfile.write('<%slabel>%s</%slabel>\n' % (namespace_, self.format_string(quote_xml(self.label).encode(ExternalEncoding), input_name='label'), namespace_))3579 if self.link:3580 self.link.export(outfile, level, namespace_, name_='link')3581 for childnode_ in self.childnode:3582 childnode_.export(outfile, level, namespace_, name_='childnode')3583 def hasContent_(self):3584 if (3585 self.label is not None or3586 self.link is not None or3587 self.childnode is not None3588 ):3589 return True3590 else:3591 return False3592 def exportLiteral(self, outfile, level, name_='nodeType'):3593 level += 13594 self.exportLiteralAttributes(outfile, level, name_)3595 if self.hasContent_():3596 self.exportLiteralChildren(outfile, level, name_)3597 def exportLiteralAttributes(self, outfile, level, name_):3598 if self.id is not None:3599 showIndent(outfile, level)3600 outfile.write('id = %s,\n' % (self.id,))3601 def exportLiteralChildren(self, outfile, level, name_):3602 showIndent(outfile, level)3603 outfile.write('label=%s,\n' % quote_python(self.label).encode(ExternalEncoding))3604 if self.link:3605 showIndent(outfile, level)3606 outfile.write('link=model_.linkType(\n')3607 self.link.exportLiteral(outfile, level, name_='link')3608 showIndent(outfile, level)3609 outfile.write('),\n')3610 showIndent(outfile, level)3611 outfile.write('childnode=[\n')3612 level += 13613 for childnode in self.childnode:3614 showIndent(outfile, level)3615 outfile.write('model_.childnode(\n')3616 childnode.exportLiteral(outfile, level, name_='childnode')3617 showIndent(outfile, level)3618 outfile.write('),\n')3619 level -= 13620 showIndent(outfile, level)3621 outfile.write('],\n')3622 def build(self, node_):3623 attrs = node_.attributes3624 self.buildAttributes(attrs)3625 for child_ in node_.childNodes:3626 nodeName_ = child_.nodeName.split(':')[-1]3627 self.buildChildren(child_, nodeName_)3628 def buildAttributes(self, attrs):3629 if attrs.get('id'):3630 self.id = attrs.get('id').value3631 def buildChildren(self, child_, nodeName_):3632 if child_.nodeType == Node.ELEMENT_NODE and \3633 nodeName_ == 'label':3634 label_ = ''3635 for text__content_ in child_.childNodes:3636 label_ += text__content_.nodeValue3637 self.label = label_3638 elif child_.nodeType == Node.ELEMENT_NODE and \3639 nodeName_ == 'link':3640 obj_ = linkType.factory()3641 obj_.build(child_)3642 self.set_link(obj_)3643 elif child_.nodeType == Node.ELEMENT_NODE and \3644 nodeName_ == 'childnode':3645 obj_ = childnodeType.factory()3646 obj_.build(child_)3647 self.childnode.append(obj_)3648# end class nodeType3649class label(GeneratedsSuper):3650 subclass = None3651 superclass = None3652 def __init__(self, valueOf_=''):3653 self.valueOf_ = valueOf_3654 def factory(*args_, **kwargs_):3655 if label.subclass:3656 return label.subclass(*args_, **kwargs_)3657 else:3658 return label(*args_, **kwargs_)3659 factory = staticmethod(factory)3660 def getValueOf_(self): return self.valueOf_3661 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3662 def export(self, outfile, level, namespace_='', name_='label', namespacedef_=''):3663 showIndent(outfile, level)3664 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3665 self.exportAttributes(outfile, level, namespace_, name_='label')3666 if self.hasContent_():3667 outfile.write('>\n')3668 self.exportChildren(outfile, level + 1, namespace_, name_)3669 showIndent(outfile, level)3670 outfile.write('</%s%s>\n' % (namespace_, name_))3671 else:3672 outfile.write(' />\n')3673 def exportAttributes(self, outfile, level, namespace_='', name_='label'):3674 pass3675 def exportChildren(self, outfile, level, namespace_='', name_='label'):3676 if self.valueOf_.find('![CDATA')>-1:3677 value=quote_xml('%s' % self.valueOf_)3678 value=value.replace('![CDATA','<![CDATA')3679 value=value.replace(']]',']]>')3680 outfile.write(value)3681 else:3682 outfile.write(quote_xml('%s' % self.valueOf_))3683 def hasContent_(self):3684 if (3685 self.valueOf_ is not None3686 ):3687 return True3688 else:3689 return False3690 def exportLiteral(self, outfile, level, name_='label'):3691 level += 13692 self.exportLiteralAttributes(outfile, level, name_)3693 if self.hasContent_():3694 self.exportLiteralChildren(outfile, level, name_)3695 def exportLiteralAttributes(self, outfile, level, name_):3696 pass3697 def exportLiteralChildren(self, outfile, level, name_):3698 showIndent(outfile, level)3699 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3700 def build(self, node_):3701 attrs = node_.attributes3702 self.buildAttributes(attrs)3703 self.valueOf_ = ''3704 for child_ in node_.childNodes:3705 nodeName_ = child_.nodeName.split(':')[-1]3706 self.buildChildren(child_, nodeName_)3707 def buildAttributes(self, attrs):3708 pass3709 def buildChildren(self, child_, nodeName_):3710 if child_.nodeType == Node.TEXT_NODE:3711 self.valueOf_ += child_.nodeValue3712 elif child_.nodeType == Node.CDATA_SECTION_NODE:3713 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3714# end class label3715class childnodeType(GeneratedsSuper):3716 subclass = None3717 superclass = None3718 def __init__(self, relation=None, refid=None, edgelabel=None):3719 self.relation = relation3720 self.refid = refid3721 if edgelabel is None:3722 self.edgelabel = []3723 else:3724 self.edgelabel = edgelabel3725 def factory(*args_, **kwargs_):3726 if childnodeType.subclass:3727 return childnodeType.subclass(*args_, **kwargs_)3728 else:3729 return childnodeType(*args_, **kwargs_)3730 factory = staticmethod(factory)3731 def get_edgelabel(self): return self.edgelabel3732 def set_edgelabel(self, edgelabel): self.edgelabel = edgelabel3733 def add_edgelabel(self, value): self.edgelabel.append(value)3734 def insert_edgelabel(self, index, value): self.edgelabel[index] = value3735 def get_relation(self): return self.relation3736 def set_relation(self, relation): self.relation = relation3737 def get_refid(self): return self.refid3738 def set_refid(self, refid): self.refid = refid3739 def export(self, outfile, level, namespace_='', name_='childnodeType', namespacedef_=''):3740 showIndent(outfile, level)3741 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3742 self.exportAttributes(outfile, level, namespace_, name_='childnodeType')3743 if self.hasContent_():3744 outfile.write('>\n')3745 self.exportChildren(outfile, level + 1, namespace_, name_)3746 showIndent(outfile, level)3747 outfile.write('</%s%s>\n' % (namespace_, name_))3748 else:3749 outfile.write(' />\n')3750 def exportAttributes(self, outfile, level, namespace_='', name_='childnodeType'):3751 if self.relation is not None:3752 outfile.write(' relation=%s' % (quote_attrib(self.relation), ))3753 if self.refid is not None:3754 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))3755 def exportChildren(self, outfile, level, namespace_='', name_='childnodeType'):3756 for edgelabel_ in self.edgelabel:3757 showIndent(outfile, level)3758 outfile.write('<%sedgelabel>%s</%sedgelabel>\n' % (namespace_, self.format_string(quote_xml(edgelabel_).encode(ExternalEncoding), input_name='edgelabel'), namespace_))3759 def hasContent_(self):3760 if (3761 self.edgelabel is not None3762 ):3763 return True3764 else:3765 return False3766 def exportLiteral(self, outfile, level, name_='childnodeType'):3767 level += 13768 self.exportLiteralAttributes(outfile, level, name_)3769 if self.hasContent_():3770 self.exportLiteralChildren(outfile, level, name_)3771 def exportLiteralAttributes(self, outfile, level, name_):3772 if self.relation is not None:3773 showIndent(outfile, level)3774 outfile.write('relation = "%s",\n' % (self.relation,))3775 if self.refid is not None:3776 showIndent(outfile, level)3777 outfile.write('refid = %s,\n' % (self.refid,))3778 def exportLiteralChildren(self, outfile, level, name_):3779 showIndent(outfile, level)3780 outfile.write('edgelabel=[\n')3781 level += 13782 for edgelabel in self.edgelabel:3783 showIndent(outfile, level)3784 outfile.write('%s,\n' % quote_python(edgelabel).encode(ExternalEncoding))3785 level -= 13786 showIndent(outfile, level)3787 outfile.write('],\n')3788 def build(self, node_):3789 attrs = node_.attributes3790 self.buildAttributes(attrs)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('relation'):3796 self.relation = attrs.get('relation').value3797 if attrs.get('refid'):3798 self.refid = attrs.get('refid').value3799 def buildChildren(self, child_, nodeName_):3800 if child_.nodeType == Node.ELEMENT_NODE and \3801 nodeName_ == 'edgelabel':3802 edgelabel_ = ''3803 for text__content_ in child_.childNodes:3804 edgelabel_ += text__content_.nodeValue3805 self.edgelabel.append(edgelabel_)3806# end class childnodeType3807class edgelabel(GeneratedsSuper):3808 subclass = None3809 superclass = None3810 def __init__(self, valueOf_=''):3811 self.valueOf_ = valueOf_3812 def factory(*args_, **kwargs_):3813 if edgelabel.subclass:3814 return edgelabel.subclass(*args_, **kwargs_)3815 else:3816 return edgelabel(*args_, **kwargs_)3817 factory = staticmethod(factory)3818 def getValueOf_(self): return self.valueOf_3819 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3820 def export(self, outfile, level, namespace_='', name_='edgelabel', namespacedef_=''):3821 showIndent(outfile, level)3822 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3823 self.exportAttributes(outfile, level, namespace_, name_='edgelabel')3824 if self.hasContent_():3825 outfile.write('>\n')3826 self.exportChildren(outfile, level + 1, namespace_, name_)3827 showIndent(outfile, level)3828 outfile.write('</%s%s>\n' % (namespace_, name_))3829 else:3830 outfile.write(' />\n')3831 def exportAttributes(self, outfile, level, namespace_='', name_='edgelabel'):3832 pass3833 def exportChildren(self, outfile, level, namespace_='', name_='edgelabel'):3834 if self.valueOf_.find('![CDATA')>-1:3835 value=quote_xml('%s' % self.valueOf_)3836 value=value.replace('![CDATA','<![CDATA')3837 value=value.replace(']]',']]>')3838 outfile.write(value)3839 else:3840 outfile.write(quote_xml('%s' % self.valueOf_))3841 def hasContent_(self):3842 if (3843 self.valueOf_ is not None3844 ):3845 return True3846 else:3847 return False3848 def exportLiteral(self, outfile, level, name_='edgelabel'):3849 level += 13850 self.exportLiteralAttributes(outfile, level, name_)3851 if self.hasContent_():3852 self.exportLiteralChildren(outfile, level, name_)3853 def exportLiteralAttributes(self, outfile, level, name_):3854 pass3855 def exportLiteralChildren(self, outfile, level, name_):3856 showIndent(outfile, level)3857 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3858 def build(self, node_):3859 attrs = node_.attributes3860 self.buildAttributes(attrs)3861 self.valueOf_ = ''3862 for child_ in node_.childNodes:3863 nodeName_ = child_.nodeName.split(':')[-1]3864 self.buildChildren(child_, nodeName_)3865 def buildAttributes(self, attrs):3866 pass3867 def buildChildren(self, child_, nodeName_):3868 if child_.nodeType == Node.TEXT_NODE:3869 self.valueOf_ += child_.nodeValue3870 elif child_.nodeType == Node.CDATA_SECTION_NODE:3871 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3872# end class edgelabel3873class linkType(GeneratedsSuper):3874 subclass = None3875 superclass = None3876 def __init__(self, refid=None, external=None, valueOf_=''):3877 self.refid = refid3878 self.external = external3879 self.valueOf_ = valueOf_3880 def factory(*args_, **kwargs_):3881 if linkType.subclass:3882 return linkType.subclass(*args_, **kwargs_)3883 else:3884 return linkType(*args_, **kwargs_)3885 factory = staticmethod(factory)3886 def get_refid(self): return self.refid3887 def set_refid(self, refid): self.refid = refid3888 def get_external(self): return self.external3889 def set_external(self, external): self.external = external3890 def getValueOf_(self): return self.valueOf_3891 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3892 def export(self, outfile, level, namespace_='', name_='linkType', namespacedef_=''):3893 showIndent(outfile, level)3894 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3895 self.exportAttributes(outfile, level, namespace_, name_='linkType')3896 if self.hasContent_():3897 outfile.write('>\n')3898 self.exportChildren(outfile, level + 1, namespace_, name_)3899 showIndent(outfile, level)3900 outfile.write('</%s%s>\n' % (namespace_, name_))3901 else:3902 outfile.write(' />\n')3903 def exportAttributes(self, outfile, level, namespace_='', name_='linkType'):3904 if self.refid is not None:3905 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))3906 if self.external is not None:3907 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))3908 def exportChildren(self, outfile, level, namespace_='', name_='linkType'):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 exportLiteral(self, outfile, level, name_='linkType'):3924 level += 13925 self.exportLiteralAttributes(outfile, level, name_)3926 if self.hasContent_():3927 self.exportLiteralChildren(outfile, level, name_)3928 def exportLiteralAttributes(self, outfile, level, name_):3929 if self.refid is not None:3930 showIndent(outfile, level)3931 outfile.write('refid = %s,\n' % (self.refid,))3932 if self.external is not None:3933 showIndent(outfile, level)3934 outfile.write('external = %s,\n' % (self.external,))3935 def exportLiteralChildren(self, outfile, level, name_):3936 showIndent(outfile, level)3937 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3938 def build(self, node_):3939 attrs = node_.attributes3940 self.buildAttributes(attrs)3941 self.valueOf_ = ''3942 for child_ in node_.childNodes:3943 nodeName_ = child_.nodeName.split(':')[-1]3944 self.buildChildren(child_, nodeName_)3945 def buildAttributes(self, attrs):3946 if attrs.get('refid'):3947 self.refid = attrs.get('refid').value3948 if attrs.get('external'):3949 self.external = attrs.get('external').value3950 def buildChildren(self, child_, nodeName_):3951 if child_.nodeType == Node.TEXT_NODE:3952 self.valueOf_ += child_.nodeValue3953 elif child_.nodeType == Node.CDATA_SECTION_NODE:3954 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3955# end class linkType3956class listingType(GeneratedsSuper):3957 subclass = None3958 superclass = None3959 def __init__(self, codeline=None):3960 if codeline is None:3961 self.codeline = []3962 else:3963 self.codeline = codeline3964 def factory(*args_, **kwargs_):3965 if listingType.subclass:3966 return listingType.subclass(*args_, **kwargs_)3967 else:3968 return listingType(*args_, **kwargs_)3969 factory = staticmethod(factory)3970 def get_codeline(self): return self.codeline3971 def set_codeline(self, codeline): self.codeline = codeline3972 def add_codeline(self, value): self.codeline.append(value)3973 def insert_codeline(self, index, value): self.codeline[index] = value3974 def export(self, outfile, level, namespace_='', name_='listingType', namespacedef_=''):3975 showIndent(outfile, level)3976 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3977 self.exportAttributes(outfile, level, namespace_, name_='listingType')3978 if self.hasContent_():3979 outfile.write('>\n')3980 self.exportChildren(outfile, level + 1, namespace_, name_)3981 showIndent(outfile, level)3982 outfile.write('</%s%s>\n' % (namespace_, name_))3983 else:3984 outfile.write(' />\n')3985 def exportAttributes(self, outfile, level, namespace_='', name_='listingType'):3986 pass3987 def exportChildren(self, outfile, level, namespace_='', name_='listingType'):3988 for codeline_ in self.codeline:3989 codeline_.export(outfile, level, namespace_, name_='codeline')3990 def hasContent_(self):3991 if (3992 self.codeline is not None3993 ):3994 return True3995 else:3996 return False3997 def exportLiteral(self, outfile, level, name_='listingType'):3998 level += 13999 self.exportLiteralAttributes(outfile, level, name_)4000 if self.hasContent_():4001 self.exportLiteralChildren(outfile, level, name_)4002 def exportLiteralAttributes(self, outfile, level, name_):4003 pass4004 def exportLiteralChildren(self, outfile, level, name_):4005 showIndent(outfile, level)4006 outfile.write('codeline=[\n')4007 level += 14008 for codeline in self.codeline:4009 showIndent(outfile, level)4010 outfile.write('model_.codeline(\n')4011 codeline.exportLiteral(outfile, level, name_='codeline')4012 showIndent(outfile, level)4013 outfile.write('),\n')4014 level -= 14015 showIndent(outfile, level)4016 outfile.write('],\n')4017 def build(self, node_):4018 attrs = node_.attributes4019 self.buildAttributes(attrs)4020 for child_ in node_.childNodes:4021 nodeName_ = child_.nodeName.split(':')[-1]4022 self.buildChildren(child_, nodeName_)4023 def buildAttributes(self, attrs):4024 pass4025 def buildChildren(self, child_, nodeName_):4026 if child_.nodeType == Node.ELEMENT_NODE and \4027 nodeName_ == 'codeline':4028 obj_ = codelineType.factory()4029 obj_.build(child_)4030 self.codeline.append(obj_)4031# end class listingType4032class codelineType(GeneratedsSuper):4033 subclass = None4034 superclass = None4035 def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):4036 self.external = external4037 self.lineno = lineno4038 self.refkind = refkind4039 self.refid = refid4040 if highlight is None:4041 self.highlight = []4042 else:4043 self.highlight = highlight4044 def factory(*args_, **kwargs_):4045 if codelineType.subclass:4046 return codelineType.subclass(*args_, **kwargs_)4047 else:4048 return codelineType(*args_, **kwargs_)4049 factory = staticmethod(factory)4050 def get_highlight(self): return self.highlight4051 def set_highlight(self, highlight): self.highlight = highlight4052 def add_highlight(self, value): self.highlight.append(value)4053 def insert_highlight(self, index, value): self.highlight[index] = value4054 def get_external(self): return self.external4055 def set_external(self, external): self.external = external4056 def get_lineno(self): return self.lineno4057 def set_lineno(self, lineno): self.lineno = lineno4058 def get_refkind(self): return self.refkind4059 def set_refkind(self, refkind): self.refkind = refkind4060 def get_refid(self): return self.refid4061 def set_refid(self, refid): self.refid = refid4062 def export(self, outfile, level, namespace_='', name_='codelineType', namespacedef_=''):4063 showIndent(outfile, level)4064 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4065 self.exportAttributes(outfile, level, namespace_, name_='codelineType')4066 if self.hasContent_():4067 outfile.write('>\n')4068 self.exportChildren(outfile, level + 1, namespace_, name_)4069 showIndent(outfile, level)4070 outfile.write('</%s%s>\n' % (namespace_, name_))4071 else:4072 outfile.write(' />\n')4073 def exportAttributes(self, outfile, level, namespace_='', name_='codelineType'):4074 if self.external is not None:4075 outfile.write(' external=%s' % (quote_attrib(self.external), ))4076 if self.lineno is not None:4077 outfile.write(' lineno="%s"' % self.format_integer(self.lineno, input_name='lineno'))4078 if self.refkind is not None:4079 outfile.write(' refkind=%s' % (quote_attrib(self.refkind), ))4080 if self.refid is not None:4081 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))4082 def exportChildren(self, outfile, level, namespace_='', name_='codelineType'):4083 for highlight_ in self.highlight:4084 highlight_.export(outfile, level, namespace_, name_='highlight')4085 def hasContent_(self):4086 if (4087 self.highlight is not None4088 ):4089 return True4090 else:4091 return False4092 def exportLiteral(self, outfile, level, name_='codelineType'):4093 level += 14094 self.exportLiteralAttributes(outfile, level, name_)4095 if self.hasContent_():4096 self.exportLiteralChildren(outfile, level, name_)4097 def exportLiteralAttributes(self, outfile, level, name_):4098 if self.external is not None:4099 showIndent(outfile, level)4100 outfile.write('external = "%s",\n' % (self.external,))4101 if self.lineno is not None:4102 showIndent(outfile, level)4103 outfile.write('lineno = %s,\n' % (self.lineno,))4104 if self.refkind is not None:4105 showIndent(outfile, level)4106 outfile.write('refkind = "%s",\n' % (self.refkind,))4107 if self.refid is not None:4108 showIndent(outfile, level)4109 outfile.write('refid = %s,\n' % (self.refid,))4110 def exportLiteralChildren(self, outfile, level, name_):4111 showIndent(outfile, level)4112 outfile.write('highlight=[\n')4113 level += 14114 for highlight in self.highlight:4115 showIndent(outfile, level)4116 outfile.write('model_.highlight(\n')4117 highlight.exportLiteral(outfile, level, name_='highlight')4118 showIndent(outfile, level)4119 outfile.write('),\n')4120 level -= 14121 showIndent(outfile, level)4122 outfile.write('],\n')4123 def build(self, node_):4124 attrs = node_.attributes4125 self.buildAttributes(attrs)4126 for child_ in node_.childNodes:4127 nodeName_ = child_.nodeName.split(':')[-1]4128 self.buildChildren(child_, nodeName_)4129 def buildAttributes(self, attrs):4130 if attrs.get('external'):4131 self.external = attrs.get('external').value4132 if attrs.get('lineno'):4133 try:4134 self.lineno = int(attrs.get('lineno').value)4135 except ValueError, exp:4136 raise ValueError('Bad integer attribute (lineno): %s' % exp)4137 if attrs.get('refkind'):4138 self.refkind = attrs.get('refkind').value4139 if attrs.get('refid'):4140 self.refid = attrs.get('refid').value4141 def buildChildren(self, child_, nodeName_):4142 if child_.nodeType == Node.ELEMENT_NODE and \4143 nodeName_ == 'highlight':4144 obj_ = highlightType.factory()4145 obj_.build(child_)4146 self.highlight.append(obj_)4147# end class codelineType4148class highlightType(GeneratedsSuper):4149 subclass = None4150 superclass = None4151 def __init__(self, classxx=None, sp=None, ref=None, mixedclass_=None, content_=None):4152 self.classxx = classxx4153 if mixedclass_ is None:4154 self.mixedclass_ = MixedContainer4155 else:4156 self.mixedclass_ = mixedclass_4157 if content_ is None:4158 self.content_ = []4159 else:4160 self.content_ = content_4161 def factory(*args_, **kwargs_):4162 if highlightType.subclass:4163 return highlightType.subclass(*args_, **kwargs_)4164 else:4165 return highlightType(*args_, **kwargs_)4166 factory = staticmethod(factory)4167 def get_sp(self): return self.sp4168 def set_sp(self, sp): self.sp = sp4169 def add_sp(self, value): self.sp.append(value)4170 def insert_sp(self, index, value): self.sp[index] = value4171 def get_ref(self): return self.ref4172 def set_ref(self, ref): self.ref = ref4173 def add_ref(self, value): self.ref.append(value)4174 def insert_ref(self, index, value): self.ref[index] = value4175 def get_class(self): return self.classxx4176 def set_class(self, classxx): self.classxx = classxx4177 def export(self, outfile, level, namespace_='', name_='highlightType', namespacedef_=''):4178 showIndent(outfile, level)4179 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4180 self.exportAttributes(outfile, level, namespace_, name_='highlightType')4181 outfile.write('>')4182 self.exportChildren(outfile, level + 1, namespace_, name_)4183 outfile.write('</%s%s>\n' % (namespace_, name_))4184 def exportAttributes(self, outfile, level, namespace_='', name_='highlightType'):4185 if self.classxx is not None:4186 outfile.write(' class=%s' % (quote_attrib(self.classxx), ))4187 def exportChildren(self, outfile, level, namespace_='', name_='highlightType'):4188 for item_ in self.content_:4189 item_.export(outfile, level, item_.name, namespace_)4190 def hasContent_(self):4191 if (4192 self.sp is not None or4193 self.ref is not None4194 ):4195 return True4196 else:4197 return False4198 def exportLiteral(self, outfile, level, name_='highlightType'):4199 level += 14200 self.exportLiteralAttributes(outfile, level, name_)4201 if self.hasContent_():4202 self.exportLiteralChildren(outfile, level, name_)4203 def exportLiteralAttributes(self, outfile, level, name_):4204 if self.classxx is not None:4205 showIndent(outfile, level)4206 outfile.write('classxx = "%s",\n' % (self.classxx,))4207 def exportLiteralChildren(self, outfile, level, name_):4208 showIndent(outfile, level)4209 outfile.write('content_ = [\n')4210 for item_ in self.content_:4211 item_.exportLiteral(outfile, level, name_)4212 showIndent(outfile, level)4213 outfile.write('],\n')4214 showIndent(outfile, level)4215 outfile.write('content_ = [\n')4216 for item_ in self.content_:4217 item_.exportLiteral(outfile, level, name_)4218 showIndent(outfile, level)4219 outfile.write('],\n')4220 def build(self, node_):4221 attrs = node_.attributes4222 self.buildAttributes(attrs)4223 for child_ in node_.childNodes:4224 nodeName_ = child_.nodeName.split(':')[-1]4225 self.buildChildren(child_, nodeName_)4226 def buildAttributes(self, attrs):4227 if attrs.get('class'):4228 self.classxx = attrs.get('class').value4229 def buildChildren(self, child_, nodeName_):4230 if child_.nodeType == Node.ELEMENT_NODE and \4231 nodeName_ == 'sp':4232 value_ = []4233 for text_ in child_.childNodes:4234 value_.append(text_.nodeValue)4235 valuestr_ = ''.join(value_)4236 obj_ = self.mixedclass_(MixedContainer.CategorySimple,4237 MixedContainer.TypeString, 'sp', valuestr_)4238 self.content_.append(obj_)4239 elif child_.nodeType == Node.ELEMENT_NODE and \4240 nodeName_ == 'ref':4241 childobj_ = docRefTextType.factory()4242 childobj_.build(child_)4243 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4244 MixedContainer.TypeNone, 'ref', childobj_)4245 self.content_.append(obj_)4246 elif child_.nodeType == Node.TEXT_NODE:4247 obj_ = self.mixedclass_(MixedContainer.CategoryText,4248 MixedContainer.TypeNone, '', child_.nodeValue)4249 self.content_.append(obj_)4250# end class highlightType4251class sp(GeneratedsSuper):4252 subclass = None4253 superclass = None4254 def __init__(self, valueOf_=''):4255 self.valueOf_ = valueOf_4256 def factory(*args_, **kwargs_):4257 if sp.subclass:4258 return sp.subclass(*args_, **kwargs_)4259 else:4260 return sp(*args_, **kwargs_)4261 factory = staticmethod(factory)4262 def getValueOf_(self): return self.valueOf_4263 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4264 def export(self, outfile, level, namespace_='', name_='sp', namespacedef_=''):4265 showIndent(outfile, level)4266 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4267 self.exportAttributes(outfile, level, namespace_, name_='sp')4268 if self.hasContent_():4269 outfile.write('>\n')4270 self.exportChildren(outfile, level + 1, namespace_, name_)4271 showIndent(outfile, level)4272 outfile.write('</%s%s>\n' % (namespace_, name_))4273 else:4274 outfile.write(' />\n')4275 def exportAttributes(self, outfile, level, namespace_='', name_='sp'):4276 pass4277 def exportChildren(self, outfile, level, namespace_='', name_='sp'):4278 if self.valueOf_.find('![CDATA')>-1:4279 value=quote_xml('%s' % self.valueOf_)4280 value=value.replace('![CDATA','<![CDATA')4281 value=value.replace(']]',']]>')4282 outfile.write(value)4283 else:4284 outfile.write(quote_xml('%s' % self.valueOf_))4285 def hasContent_(self):4286 if (4287 self.valueOf_ is not None4288 ):4289 return True4290 else:4291 return False4292 def exportLiteral(self, outfile, level, name_='sp'):4293 level += 14294 self.exportLiteralAttributes(outfile, level, name_)4295 if self.hasContent_():4296 self.exportLiteralChildren(outfile, level, name_)4297 def exportLiteralAttributes(self, outfile, level, name_):4298 pass4299 def exportLiteralChildren(self, outfile, level, name_):4300 showIndent(outfile, level)4301 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4302 def build(self, node_):4303 attrs = node_.attributes4304 self.buildAttributes(attrs)4305 self.valueOf_ = ''4306 for child_ in node_.childNodes:4307 nodeName_ = child_.nodeName.split(':')[-1]4308 self.buildChildren(child_, nodeName_)4309 def buildAttributes(self, attrs):4310 pass4311 def buildChildren(self, child_, nodeName_):4312 if child_.nodeType == Node.TEXT_NODE:4313 self.valueOf_ += child_.nodeValue4314 elif child_.nodeType == Node.CDATA_SECTION_NODE:4315 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4316# end class sp4317class referenceType(GeneratedsSuper):4318 subclass = None4319 superclass = None4320 def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):4321 self.endline = endline4322 self.startline = startline4323 self.refid = refid4324 self.compoundref = compoundref4325 if mixedclass_ is None:4326 self.mixedclass_ = MixedContainer4327 else:4328 self.mixedclass_ = mixedclass_4329 if content_ is None:4330 self.content_ = []4331 else:4332 self.content_ = content_4333 def factory(*args_, **kwargs_):4334 if referenceType.subclass:4335 return referenceType.subclass(*args_, **kwargs_)4336 else:4337 return referenceType(*args_, **kwargs_)4338 factory = staticmethod(factory)4339 def get_endline(self): return self.endline4340 def set_endline(self, endline): self.endline = endline4341 def get_startline(self): return self.startline4342 def set_startline(self, startline): self.startline = startline4343 def get_refid(self): return self.refid4344 def set_refid(self, refid): self.refid = refid4345 def get_compoundref(self): return self.compoundref4346 def set_compoundref(self, compoundref): self.compoundref = compoundref4347 def getValueOf_(self): return self.valueOf_4348 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4349 def export(self, outfile, level, namespace_='', name_='referenceType', namespacedef_=''):4350 showIndent(outfile, level)4351 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4352 self.exportAttributes(outfile, level, namespace_, name_='referenceType')4353 outfile.write('>')4354 self.exportChildren(outfile, level + 1, namespace_, name_)4355 outfile.write('</%s%s>\n' % (namespace_, name_))4356 def exportAttributes(self, outfile, level, namespace_='', name_='referenceType'):4357 if self.endline is not None:4358 outfile.write(' endline="%s"' % self.format_integer(self.endline, input_name='endline'))4359 if self.startline is not None:4360 outfile.write(' startline="%s"' % self.format_integer(self.startline, input_name='startline'))4361 if self.refid is not None:4362 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))4363 if self.compoundref is not None:4364 outfile.write(' compoundref=%s' % (self.format_string(quote_attrib(self.compoundref).encode(ExternalEncoding), input_name='compoundref'), ))4365 def exportChildren(self, outfile, level, namespace_='', name_='referenceType'):4366 if self.valueOf_.find('![CDATA')>-1:4367 value=quote_xml('%s' % self.valueOf_)4368 value=value.replace('![CDATA','<![CDATA')4369 value=value.replace(']]',']]>')4370 outfile.write(value)4371 else:4372 outfile.write(quote_xml('%s' % self.valueOf_))4373 def hasContent_(self):4374 if (4375 self.valueOf_ is not None4376 ):4377 return True4378 else:4379 return False4380 def exportLiteral(self, outfile, level, name_='referenceType'):4381 level += 14382 self.exportLiteralAttributes(outfile, level, name_)4383 if self.hasContent_():4384 self.exportLiteralChildren(outfile, level, name_)4385 def exportLiteralAttributes(self, outfile, level, name_):4386 if self.endline is not None:4387 showIndent(outfile, level)4388 outfile.write('endline = %s,\n' % (self.endline,))4389 if self.startline is not None:4390 showIndent(outfile, level)4391 outfile.write('startline = %s,\n' % (self.startline,))4392 if self.refid is not None:4393 showIndent(outfile, level)4394 outfile.write('refid = %s,\n' % (self.refid,))4395 if self.compoundref is not None:4396 showIndent(outfile, level)4397 outfile.write('compoundref = %s,\n' % (self.compoundref,))4398 def exportLiteralChildren(self, outfile, level, name_):4399 showIndent(outfile, level)4400 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4401 def build(self, node_):4402 attrs = node_.attributes4403 self.buildAttributes(attrs)4404 self.valueOf_ = ''4405 for child_ in node_.childNodes:4406 nodeName_ = child_.nodeName.split(':')[-1]4407 self.buildChildren(child_, nodeName_)4408 def buildAttributes(self, attrs):4409 if attrs.get('endline'):4410 try:4411 self.endline = int(attrs.get('endline').value)4412 except ValueError, exp:4413 raise ValueError('Bad integer attribute (endline): %s' % exp)4414 if attrs.get('startline'):4415 try:4416 self.startline = int(attrs.get('startline').value)4417 except ValueError, exp:4418 raise ValueError('Bad integer attribute (startline): %s' % exp)4419 if attrs.get('refid'):4420 self.refid = attrs.get('refid').value4421 if attrs.get('compoundref'):4422 self.compoundref = attrs.get('compoundref').value4423 def buildChildren(self, child_, nodeName_):4424 if child_.nodeType == Node.TEXT_NODE:4425 obj_ = self.mixedclass_(MixedContainer.CategoryText,4426 MixedContainer.TypeNone, '', child_.nodeValue)4427 self.content_.append(obj_)4428 if child_.nodeType == Node.TEXT_NODE:4429 self.valueOf_ += child_.nodeValue4430 elif child_.nodeType == Node.CDATA_SECTION_NODE:4431 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4432# end class referenceType4433class locationType(GeneratedsSuper):4434 subclass = None4435 superclass = None4436 def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):4437 self.bodystart = bodystart4438 self.line = line4439 self.bodyend = bodyend4440 self.bodyfile = bodyfile4441 self.file = file4442 self.valueOf_ = valueOf_4443 def factory(*args_, **kwargs_):4444 if locationType.subclass:4445 return locationType.subclass(*args_, **kwargs_)4446 else:4447 return locationType(*args_, **kwargs_)4448 factory = staticmethod(factory)4449 def get_bodystart(self): return self.bodystart4450 def set_bodystart(self, bodystart): self.bodystart = bodystart4451 def get_line(self): return self.line4452 def set_line(self, line): self.line = line4453 def get_bodyend(self): return self.bodyend4454 def set_bodyend(self, bodyend): self.bodyend = bodyend4455 def get_bodyfile(self): return self.bodyfile4456 def set_bodyfile(self, bodyfile): self.bodyfile = bodyfile4457 def get_file(self): return self.file4458 def set_file(self, file): self.file = file4459 def getValueOf_(self): return self.valueOf_4460 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4461 def export(self, outfile, level, namespace_='', name_='locationType', namespacedef_=''):4462 showIndent(outfile, level)4463 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4464 self.exportAttributes(outfile, level, namespace_, name_='locationType')4465 if self.hasContent_():4466 outfile.write('>\n')4467 self.exportChildren(outfile, level + 1, namespace_, name_)4468 showIndent(outfile, level)4469 outfile.write('</%s%s>\n' % (namespace_, name_))4470 else:4471 outfile.write(' />\n')4472 def exportAttributes(self, outfile, level, namespace_='', name_='locationType'):4473 if self.bodystart is not None:4474 outfile.write(' bodystart="%s"' % self.format_integer(self.bodystart, input_name='bodystart'))4475 if self.line is not None:4476 outfile.write(' line="%s"' % self.format_integer(self.line, input_name='line'))4477 if self.bodyend is not None:4478 outfile.write(' bodyend="%s"' % self.format_integer(self.bodyend, input_name='bodyend'))4479 if self.bodyfile is not None:4480 outfile.write(' bodyfile=%s' % (self.format_string(quote_attrib(self.bodyfile).encode(ExternalEncoding), input_name='bodyfile'), ))4481 if self.file is not None:4482 outfile.write(' file=%s' % (self.format_string(quote_attrib(self.file).encode(ExternalEncoding), input_name='file'), ))4483 def exportChildren(self, outfile, level, namespace_='', name_='locationType'):4484 if self.valueOf_.find('![CDATA')>-1:4485 value=quote_xml('%s' % self.valueOf_)4486 value=value.replace('![CDATA','<![CDATA')4487 value=value.replace(']]',']]>')4488 outfile.write(value)4489 else:4490 outfile.write(quote_xml('%s' % self.valueOf_))4491 def hasContent_(self):4492 if (4493 self.valueOf_ is not None4494 ):4495 return True4496 else:4497 return False4498 def exportLiteral(self, outfile, level, name_='locationType'):4499 level += 14500 self.exportLiteralAttributes(outfile, level, name_)4501 if self.hasContent_():4502 self.exportLiteralChildren(outfile, level, name_)4503 def exportLiteralAttributes(self, outfile, level, name_):4504 if self.bodystart is not None:4505 showIndent(outfile, level)4506 outfile.write('bodystart = %s,\n' % (self.bodystart,))4507 if self.line is not None:4508 showIndent(outfile, level)4509 outfile.write('line = %s,\n' % (self.line,))4510 if self.bodyend is not None:4511 showIndent(outfile, level)4512 outfile.write('bodyend = %s,\n' % (self.bodyend,))4513 if self.bodyfile is not None:4514 showIndent(outfile, level)4515 outfile.write('bodyfile = %s,\n' % (self.bodyfile,))4516 if self.file is not None:4517 showIndent(outfile, level)4518 outfile.write('file = %s,\n' % (self.file,))4519 def exportLiteralChildren(self, outfile, level, name_):4520 showIndent(outfile, level)4521 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4522 def build(self, node_):4523 attrs = node_.attributes4524 self.buildAttributes(attrs)4525 self.valueOf_ = ''4526 for child_ in node_.childNodes:4527 nodeName_ = child_.nodeName.split(':')[-1]4528 self.buildChildren(child_, nodeName_)4529 def buildAttributes(self, attrs):4530 if attrs.get('bodystart'):4531 try:4532 self.bodystart = int(attrs.get('bodystart').value)4533 except ValueError, exp:4534 raise ValueError('Bad integer attribute (bodystart): %s' % exp)4535 if attrs.get('line'):4536 try:4537 self.line = int(attrs.get('line').value)4538 except ValueError, exp:4539 raise ValueError('Bad integer attribute (line): %s' % exp)4540 if attrs.get('bodyend'):4541 try:4542 self.bodyend = int(attrs.get('bodyend').value)4543 except ValueError, exp:4544 raise ValueError('Bad integer attribute (bodyend): %s' % exp)4545 if attrs.get('bodyfile'):4546 self.bodyfile = attrs.get('bodyfile').value4547 if attrs.get('file'):4548 self.file = attrs.get('file').value4549 def buildChildren(self, child_, nodeName_):4550 if child_.nodeType == Node.TEXT_NODE:4551 self.valueOf_ += child_.nodeValue4552 elif child_.nodeType == Node.CDATA_SECTION_NODE:4553 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4554# end class locationType4555class docSect1Type(GeneratedsSuper):4556 subclass = None4557 superclass = None4558 def __init__(self, id=None, title=None, para=None, sect2=None, internal=None, mixedclass_=None, content_=None):4559 self.id = id4560 if mixedclass_ is None:4561 self.mixedclass_ = MixedContainer4562 else:4563 self.mixedclass_ = mixedclass_4564 if content_ is None:4565 self.content_ = []4566 else:4567 self.content_ = content_4568 def factory(*args_, **kwargs_):4569 if docSect1Type.subclass:4570 return docSect1Type.subclass(*args_, **kwargs_)4571 else:4572 return docSect1Type(*args_, **kwargs_)4573 factory = staticmethod(factory)4574 def get_title(self): return self.title4575 def set_title(self, title): self.title = title4576 def get_para(self): return self.para4577 def set_para(self, para): self.para = para4578 def add_para(self, value): self.para.append(value)4579 def insert_para(self, index, value): self.para[index] = value4580 def get_sect2(self): return self.sect24581 def set_sect2(self, sect2): self.sect2 = sect24582 def add_sect2(self, value): self.sect2.append(value)4583 def insert_sect2(self, index, value): self.sect2[index] = value4584 def get_internal(self): return self.internal4585 def set_internal(self, internal): self.internal = internal4586 def get_id(self): return self.id4587 def set_id(self, id): self.id = id4588 def export(self, outfile, level, namespace_='', name_='docSect1Type', namespacedef_=''):4589 showIndent(outfile, level)4590 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4591 self.exportAttributes(outfile, level, namespace_, name_='docSect1Type')4592 outfile.write('>')4593 self.exportChildren(outfile, level + 1, namespace_, name_)4594 outfile.write('</%s%s>\n' % (namespace_, name_))4595 def exportAttributes(self, outfile, level, namespace_='', name_='docSect1Type'):4596 if self.id is not None:4597 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4598 def exportChildren(self, outfile, level, namespace_='', name_='docSect1Type'):4599 for item_ in self.content_:4600 item_.export(outfile, level, item_.name, namespace_)4601 def hasContent_(self):4602 if (4603 self.title is not None or4604 self.para is not None or4605 self.sect2 is not None or4606 self.internal is not None4607 ):4608 return True4609 else:4610 return False4611 def exportLiteral(self, outfile, level, name_='docSect1Type'):4612 level += 14613 self.exportLiteralAttributes(outfile, level, name_)4614 if self.hasContent_():4615 self.exportLiteralChildren(outfile, level, name_)4616 def exportLiteralAttributes(self, outfile, level, name_):4617 if self.id is not None:4618 showIndent(outfile, level)4619 outfile.write('id = %s,\n' % (self.id,))4620 def exportLiteralChildren(self, outfile, level, name_):4621 showIndent(outfile, level)4622 outfile.write('content_ = [\n')4623 for item_ in self.content_:4624 item_.exportLiteral(outfile, level, name_)4625 showIndent(outfile, level)4626 outfile.write('],\n')4627 showIndent(outfile, level)4628 outfile.write('content_ = [\n')4629 for item_ in self.content_:4630 item_.exportLiteral(outfile, level, name_)4631 showIndent(outfile, level)4632 outfile.write('],\n')4633 showIndent(outfile, level)4634 outfile.write('content_ = [\n')4635 for item_ in self.content_:4636 item_.exportLiteral(outfile, level, name_)4637 showIndent(outfile, level)4638 outfile.write('],\n')4639 showIndent(outfile, level)4640 outfile.write('content_ = [\n')4641 for item_ in self.content_:4642 item_.exportLiteral(outfile, level, name_)4643 showIndent(outfile, level)4644 outfile.write('],\n')4645 def build(self, node_):4646 attrs = node_.attributes4647 self.buildAttributes(attrs)4648 for child_ in node_.childNodes:4649 nodeName_ = child_.nodeName.split(':')[-1]4650 self.buildChildren(child_, nodeName_)4651 def buildAttributes(self, attrs):4652 if attrs.get('id'):4653 self.id = attrs.get('id').value4654 def buildChildren(self, child_, nodeName_):4655 if child_.nodeType == Node.ELEMENT_NODE and \4656 nodeName_ == 'title':4657 childobj_ = docTitleType.factory()4658 childobj_.build(child_)4659 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4660 MixedContainer.TypeNone, 'title', childobj_)4661 self.content_.append(obj_)4662 elif child_.nodeType == Node.ELEMENT_NODE and \4663 nodeName_ == 'para':4664 childobj_ = docParaType.factory()4665 childobj_.build(child_)4666 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4667 MixedContainer.TypeNone, 'para', childobj_)4668 self.content_.append(obj_)4669 elif child_.nodeType == Node.ELEMENT_NODE and \4670 nodeName_ == 'sect2':4671 childobj_ = docSect2Type.factory()4672 childobj_.build(child_)4673 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4674 MixedContainer.TypeNone, 'sect2', childobj_)4675 self.content_.append(obj_)4676 elif child_.nodeType == Node.ELEMENT_NODE and \4677 nodeName_ == 'internal':4678 childobj_ = docInternalS1Type.factory()4679 childobj_.build(child_)4680 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4681 MixedContainer.TypeNone, 'internal', childobj_)4682 self.content_.append(obj_)4683 elif child_.nodeType == Node.TEXT_NODE:4684 obj_ = self.mixedclass_(MixedContainer.CategoryText,4685 MixedContainer.TypeNone, '', child_.nodeValue)4686 self.content_.append(obj_)4687# end class docSect1Type4688class docSect2Type(GeneratedsSuper):4689 subclass = None4690 superclass = None4691 def __init__(self, id=None, title=None, para=None, sect3=None, internal=None, mixedclass_=None, content_=None):4692 self.id = id4693 if mixedclass_ is None:4694 self.mixedclass_ = MixedContainer4695 else:4696 self.mixedclass_ = mixedclass_4697 if content_ is None:4698 self.content_ = []4699 else:4700 self.content_ = content_4701 def factory(*args_, **kwargs_):4702 if docSect2Type.subclass:4703 return docSect2Type.subclass(*args_, **kwargs_)4704 else:4705 return docSect2Type(*args_, **kwargs_)4706 factory = staticmethod(factory)4707 def get_title(self): return self.title4708 def set_title(self, title): self.title = title4709 def get_para(self): return self.para4710 def set_para(self, para): self.para = para4711 def add_para(self, value): self.para.append(value)4712 def insert_para(self, index, value): self.para[index] = value4713 def get_sect3(self): return self.sect34714 def set_sect3(self, sect3): self.sect3 = sect34715 def add_sect3(self, value): self.sect3.append(value)4716 def insert_sect3(self, index, value): self.sect3[index] = value4717 def get_internal(self): return self.internal4718 def set_internal(self, internal): self.internal = internal4719 def get_id(self): return self.id4720 def set_id(self, id): self.id = id4721 def export(self, outfile, level, namespace_='', name_='docSect2Type', namespacedef_=''):4722 showIndent(outfile, level)4723 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4724 self.exportAttributes(outfile, level, namespace_, name_='docSect2Type')4725 outfile.write('>')4726 self.exportChildren(outfile, level + 1, namespace_, name_)4727 outfile.write('</%s%s>\n' % (namespace_, name_))4728 def exportAttributes(self, outfile, level, namespace_='', name_='docSect2Type'):4729 if self.id is not None:4730 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4731 def exportChildren(self, outfile, level, namespace_='', name_='docSect2Type'):4732 for item_ in self.content_:4733 item_.export(outfile, level, item_.name, namespace_)4734 def hasContent_(self):4735 if (4736 self.title is not None or4737 self.para is not None or4738 self.sect3 is not None or4739 self.internal is not None4740 ):4741 return True4742 else:4743 return False4744 def exportLiteral(self, outfile, level, name_='docSect2Type'):4745 level += 14746 self.exportLiteralAttributes(outfile, level, name_)4747 if self.hasContent_():4748 self.exportLiteralChildren(outfile, level, name_)4749 def exportLiteralAttributes(self, outfile, level, name_):4750 if self.id is not None:4751 showIndent(outfile, level)4752 outfile.write('id = %s,\n' % (self.id,))4753 def exportLiteralChildren(self, outfile, level, name_):4754 showIndent(outfile, level)4755 outfile.write('content_ = [\n')4756 for item_ in self.content_:4757 item_.exportLiteral(outfile, level, name_)4758 showIndent(outfile, level)4759 outfile.write('],\n')4760 showIndent(outfile, level)4761 outfile.write('content_ = [\n')4762 for item_ in self.content_:4763 item_.exportLiteral(outfile, level, name_)4764 showIndent(outfile, level)4765 outfile.write('],\n')4766 showIndent(outfile, level)4767 outfile.write('content_ = [\n')4768 for item_ in self.content_:4769 item_.exportLiteral(outfile, level, name_)4770 showIndent(outfile, level)4771 outfile.write('],\n')4772 showIndent(outfile, level)4773 outfile.write('content_ = [\n')4774 for item_ in self.content_:4775 item_.exportLiteral(outfile, level, name_)4776 showIndent(outfile, level)4777 outfile.write('],\n')4778 def build(self, node_):4779 attrs = node_.attributes4780 self.buildAttributes(attrs)4781 for child_ in node_.childNodes:4782 nodeName_ = child_.nodeName.split(':')[-1]4783 self.buildChildren(child_, nodeName_)4784 def buildAttributes(self, attrs):4785 if attrs.get('id'):4786 self.id = attrs.get('id').value4787 def buildChildren(self, child_, nodeName_):4788 if child_.nodeType == Node.ELEMENT_NODE and \4789 nodeName_ == 'title':4790 childobj_ = docTitleType.factory()4791 childobj_.build(child_)4792 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4793 MixedContainer.TypeNone, 'title', childobj_)4794 self.content_.append(obj_)4795 elif child_.nodeType == Node.ELEMENT_NODE and \4796 nodeName_ == 'para':4797 childobj_ = docParaType.factory()4798 childobj_.build(child_)4799 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4800 MixedContainer.TypeNone, 'para', childobj_)4801 self.content_.append(obj_)4802 elif child_.nodeType == Node.ELEMENT_NODE and \4803 nodeName_ == 'sect3':4804 childobj_ = docSect3Type.factory()4805 childobj_.build(child_)4806 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4807 MixedContainer.TypeNone, 'sect3', childobj_)4808 self.content_.append(obj_)4809 elif child_.nodeType == Node.ELEMENT_NODE and \4810 nodeName_ == 'internal':4811 childobj_ = docInternalS2Type.factory()4812 childobj_.build(child_)4813 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4814 MixedContainer.TypeNone, 'internal', childobj_)4815 self.content_.append(obj_)4816 elif child_.nodeType == Node.TEXT_NODE:4817 obj_ = self.mixedclass_(MixedContainer.CategoryText,4818 MixedContainer.TypeNone, '', child_.nodeValue)4819 self.content_.append(obj_)4820# end class docSect2Type4821class docSect3Type(GeneratedsSuper):4822 subclass = None4823 superclass = None4824 def __init__(self, id=None, title=None, para=None, sect4=None, internal=None, mixedclass_=None, content_=None):4825 self.id = id4826 if mixedclass_ is None:4827 self.mixedclass_ = MixedContainer4828 else:4829 self.mixedclass_ = mixedclass_4830 if content_ is None:4831 self.content_ = []4832 else:4833 self.content_ = content_4834 def factory(*args_, **kwargs_):4835 if docSect3Type.subclass:4836 return docSect3Type.subclass(*args_, **kwargs_)4837 else:4838 return docSect3Type(*args_, **kwargs_)4839 factory = staticmethod(factory)4840 def get_title(self): return self.title4841 def set_title(self, title): self.title = title4842 def get_para(self): return self.para4843 def set_para(self, para): self.para = para4844 def add_para(self, value): self.para.append(value)4845 def insert_para(self, index, value): self.para[index] = value4846 def get_sect4(self): return self.sect44847 def set_sect4(self, sect4): self.sect4 = sect44848 def add_sect4(self, value): self.sect4.append(value)4849 def insert_sect4(self, index, value): self.sect4[index] = value4850 def get_internal(self): return self.internal4851 def set_internal(self, internal): self.internal = internal4852 def get_id(self): return self.id4853 def set_id(self, id): self.id = id4854 def export(self, outfile, level, namespace_='', name_='docSect3Type', namespacedef_=''):4855 showIndent(outfile, level)4856 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4857 self.exportAttributes(outfile, level, namespace_, name_='docSect3Type')4858 outfile.write('>')4859 self.exportChildren(outfile, level + 1, namespace_, name_)4860 outfile.write('</%s%s>\n' % (namespace_, name_))4861 def exportAttributes(self, outfile, level, namespace_='', name_='docSect3Type'):4862 if self.id is not None:4863 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4864 def exportChildren(self, outfile, level, namespace_='', name_='docSect3Type'):4865 for item_ in self.content_:4866 item_.export(outfile, level, item_.name, namespace_)4867 def hasContent_(self):4868 if (4869 self.title is not None or4870 self.para is not None or4871 self.sect4 is not None or4872 self.internal is not None4873 ):4874 return True4875 else:4876 return False4877 def exportLiteral(self, outfile, level, name_='docSect3Type'):4878 level += 14879 self.exportLiteralAttributes(outfile, level, name_)4880 if self.hasContent_():4881 self.exportLiteralChildren(outfile, level, name_)4882 def exportLiteralAttributes(self, outfile, level, name_):4883 if self.id is not None:4884 showIndent(outfile, level)4885 outfile.write('id = %s,\n' % (self.id,))4886 def exportLiteralChildren(self, outfile, level, name_):4887 showIndent(outfile, level)4888 outfile.write('content_ = [\n')4889 for item_ in self.content_:4890 item_.exportLiteral(outfile, level, name_)4891 showIndent(outfile, level)4892 outfile.write('],\n')4893 showIndent(outfile, level)4894 outfile.write('content_ = [\n')4895 for item_ in self.content_:4896 item_.exportLiteral(outfile, level, name_)4897 showIndent(outfile, level)4898 outfile.write('],\n')4899 showIndent(outfile, level)4900 outfile.write('content_ = [\n')4901 for item_ in self.content_:4902 item_.exportLiteral(outfile, level, name_)4903 showIndent(outfile, level)4904 outfile.write('],\n')4905 showIndent(outfile, level)4906 outfile.write('content_ = [\n')4907 for item_ in self.content_:4908 item_.exportLiteral(outfile, level, name_)4909 showIndent(outfile, level)4910 outfile.write('],\n')4911 def build(self, node_):4912 attrs = node_.attributes4913 self.buildAttributes(attrs)4914 for child_ in node_.childNodes:4915 nodeName_ = child_.nodeName.split(':')[-1]4916 self.buildChildren(child_, nodeName_)4917 def buildAttributes(self, attrs):4918 if attrs.get('id'):4919 self.id = attrs.get('id').value4920 def buildChildren(self, child_, nodeName_):4921 if child_.nodeType == Node.ELEMENT_NODE and \4922 nodeName_ == 'title':4923 childobj_ = docTitleType.factory()4924 childobj_.build(child_)4925 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4926 MixedContainer.TypeNone, 'title', childobj_)4927 self.content_.append(obj_)4928 elif child_.nodeType == Node.ELEMENT_NODE and \4929 nodeName_ == 'para':4930 childobj_ = docParaType.factory()4931 childobj_.build(child_)4932 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4933 MixedContainer.TypeNone, 'para', childobj_)4934 self.content_.append(obj_)4935 elif child_.nodeType == Node.ELEMENT_NODE and \4936 nodeName_ == 'sect4':4937 childobj_ = docSect4Type.factory()4938 childobj_.build(child_)4939 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4940 MixedContainer.TypeNone, 'sect4', childobj_)4941 self.content_.append(obj_)4942 elif child_.nodeType == Node.ELEMENT_NODE and \4943 nodeName_ == 'internal':4944 childobj_ = docInternalS3Type.factory()4945 childobj_.build(child_)4946 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4947 MixedContainer.TypeNone, 'internal', childobj_)4948 self.content_.append(obj_)4949 elif child_.nodeType == Node.TEXT_NODE:4950 obj_ = self.mixedclass_(MixedContainer.CategoryText,4951 MixedContainer.TypeNone, '', child_.nodeValue)4952 self.content_.append(obj_)4953# end class docSect3Type4954class docSect4Type(GeneratedsSuper):4955 subclass = None4956 superclass = None4957 def __init__(self, id=None, title=None, para=None, internal=None, mixedclass_=None, content_=None):4958 self.id = id4959 if mixedclass_ is None:4960 self.mixedclass_ = MixedContainer4961 else:4962 self.mixedclass_ = mixedclass_4963 if content_ is None:4964 self.content_ = []4965 else:4966 self.content_ = content_4967 def factory(*args_, **kwargs_):4968 if docSect4Type.subclass:4969 return docSect4Type.subclass(*args_, **kwargs_)4970 else:4971 return docSect4Type(*args_, **kwargs_)4972 factory = staticmethod(factory)4973 def get_title(self): return self.title4974 def set_title(self, title): self.title = title4975 def get_para(self): return self.para4976 def set_para(self, para): self.para = para4977 def add_para(self, value): self.para.append(value)4978 def insert_para(self, index, value): self.para[index] = value4979 def get_internal(self): return self.internal4980 def set_internal(self, internal): self.internal = internal4981 def get_id(self): return self.id4982 def set_id(self, id): self.id = id4983 def export(self, outfile, level, namespace_='', name_='docSect4Type', namespacedef_=''):4984 showIndent(outfile, level)4985 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4986 self.exportAttributes(outfile, level, namespace_, name_='docSect4Type')4987 outfile.write('>')4988 self.exportChildren(outfile, level + 1, namespace_, name_)4989 outfile.write('</%s%s>\n' % (namespace_, name_))4990 def exportAttributes(self, outfile, level, namespace_='', name_='docSect4Type'):4991 if self.id is not None:4992 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4993 def exportChildren(self, outfile, level, namespace_='', name_='docSect4Type'):4994 for item_ in self.content_:4995 item_.export(outfile, level, item_.name, namespace_)4996 def hasContent_(self):4997 if (4998 self.title is not None or4999 self.para is not None or5000 self.internal is not None5001 ):5002 return True5003 else:5004 return False5005 def exportLiteral(self, outfile, level, name_='docSect4Type'):5006 level += 15007 self.exportLiteralAttributes(outfile, level, name_)5008 if self.hasContent_():5009 self.exportLiteralChildren(outfile, level, name_)5010 def exportLiteralAttributes(self, outfile, level, name_):5011 if self.id is not None:5012 showIndent(outfile, level)5013 outfile.write('id = %s,\n' % (self.id,))5014 def exportLiteralChildren(self, outfile, level, name_):5015 showIndent(outfile, level)5016 outfile.write('content_ = [\n')5017 for item_ in self.content_:5018 item_.exportLiteral(outfile, level, name_)5019 showIndent(outfile, level)5020 outfile.write('],\n')5021 showIndent(outfile, level)5022 outfile.write('content_ = [\n')5023 for item_ in self.content_:5024 item_.exportLiteral(outfile, level, name_)5025 showIndent(outfile, level)5026 outfile.write('],\n')5027 showIndent(outfile, level)5028 outfile.write('content_ = [\n')5029 for item_ in self.content_:5030 item_.exportLiteral(outfile, level, name_)5031 showIndent(outfile, level)5032 outfile.write('],\n')5033 def build(self, node_):5034 attrs = node_.attributes5035 self.buildAttributes(attrs)5036 for child_ in node_.childNodes:5037 nodeName_ = child_.nodeName.split(':')[-1]5038 self.buildChildren(child_, nodeName_)5039 def buildAttributes(self, attrs):5040 if attrs.get('id'):5041 self.id = attrs.get('id').value5042 def buildChildren(self, child_, nodeName_):5043 if child_.nodeType == Node.ELEMENT_NODE and \5044 nodeName_ == 'title':5045 childobj_ = docTitleType.factory()5046 childobj_.build(child_)5047 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5048 MixedContainer.TypeNone, 'title', childobj_)5049 self.content_.append(obj_)5050 elif child_.nodeType == Node.ELEMENT_NODE and \5051 nodeName_ == 'para':5052 childobj_ = docParaType.factory()5053 childobj_.build(child_)5054 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5055 MixedContainer.TypeNone, 'para', childobj_)5056 self.content_.append(obj_)5057 elif child_.nodeType == Node.ELEMENT_NODE and \5058 nodeName_ == 'internal':5059 childobj_ = docInternalS4Type.factory()5060 childobj_.build(child_)5061 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5062 MixedContainer.TypeNone, 'internal', childobj_)5063 self.content_.append(obj_)5064 elif child_.nodeType == Node.TEXT_NODE:5065 obj_ = self.mixedclass_(MixedContainer.CategoryText,5066 MixedContainer.TypeNone, '', child_.nodeValue)5067 self.content_.append(obj_)5068# end class docSect4Type5069class docInternalType(GeneratedsSuper):5070 subclass = None5071 superclass = None5072 def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):5073 if mixedclass_ is None:5074 self.mixedclass_ = MixedContainer5075 else:5076 self.mixedclass_ = mixedclass_5077 if content_ is None:5078 self.content_ = []5079 else:5080 self.content_ = content_5081 def factory(*args_, **kwargs_):5082 if docInternalType.subclass:5083 return docInternalType.subclass(*args_, **kwargs_)5084 else:5085 return docInternalType(*args_, **kwargs_)5086 factory = staticmethod(factory)5087 def get_para(self): return self.para5088 def set_para(self, para): self.para = para5089 def add_para(self, value): self.para.append(value)5090 def insert_para(self, index, value): self.para[index] = value5091 def get_sect1(self): return self.sect15092 def set_sect1(self, sect1): self.sect1 = sect15093 def add_sect1(self, value): self.sect1.append(value)5094 def insert_sect1(self, index, value): self.sect1[index] = value5095 def export(self, outfile, level, namespace_='', name_='docInternalType', namespacedef_=''):5096 showIndent(outfile, level)5097 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5098 self.exportAttributes(outfile, level, namespace_, name_='docInternalType')5099 outfile.write('>')5100 self.exportChildren(outfile, level + 1, namespace_, name_)5101 outfile.write('</%s%s>\n' % (namespace_, name_))5102 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalType'):5103 pass5104 def exportChildren(self, outfile, level, namespace_='', name_='docInternalType'):5105 for item_ in self.content_:5106 item_.export(outfile, level, item_.name, namespace_)5107 def hasContent_(self):5108 if (5109 self.para is not None or5110 self.sect1 is not None5111 ):5112 return True5113 else:5114 return False5115 def exportLiteral(self, outfile, level, name_='docInternalType'):5116 level += 15117 self.exportLiteralAttributes(outfile, level, name_)5118 if self.hasContent_():5119 self.exportLiteralChildren(outfile, level, name_)5120 def exportLiteralAttributes(self, outfile, level, name_):5121 pass5122 def exportLiteralChildren(self, outfile, level, name_):5123 showIndent(outfile, level)5124 outfile.write('content_ = [\n')5125 for item_ in self.content_:5126 item_.exportLiteral(outfile, level, name_)5127 showIndent(outfile, level)5128 outfile.write('],\n')5129 showIndent(outfile, level)5130 outfile.write('content_ = [\n')5131 for item_ in self.content_:5132 item_.exportLiteral(outfile, level, name_)5133 showIndent(outfile, level)5134 outfile.write('],\n')5135 def build(self, node_):5136 attrs = node_.attributes5137 self.buildAttributes(attrs)5138 for child_ in node_.childNodes:5139 nodeName_ = child_.nodeName.split(':')[-1]5140 self.buildChildren(child_, nodeName_)5141 def buildAttributes(self, attrs):5142 pass5143 def buildChildren(self, child_, nodeName_):5144 if child_.nodeType == Node.ELEMENT_NODE and \5145 nodeName_ == 'para':5146 childobj_ = docParaType.factory()5147 childobj_.build(child_)5148 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5149 MixedContainer.TypeNone, 'para', childobj_)5150 self.content_.append(obj_)5151 elif child_.nodeType == Node.ELEMENT_NODE and \5152 nodeName_ == 'sect1':5153 childobj_ = docSect1Type.factory()5154 childobj_.build(child_)5155 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5156 MixedContainer.TypeNone, 'sect1', childobj_)5157 self.content_.append(obj_)5158 elif child_.nodeType == Node.TEXT_NODE:5159 obj_ = self.mixedclass_(MixedContainer.CategoryText,5160 MixedContainer.TypeNone, '', child_.nodeValue)5161 self.content_.append(obj_)5162# end class docInternalType5163class docInternalS1Type(GeneratedsSuper):5164 subclass = None5165 superclass = None5166 def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):5167 if mixedclass_ is None:5168 self.mixedclass_ = MixedContainer5169 else:5170 self.mixedclass_ = mixedclass_5171 if content_ is None:5172 self.content_ = []5173 else:5174 self.content_ = content_5175 def factory(*args_, **kwargs_):5176 if docInternalS1Type.subclass:5177 return docInternalS1Type.subclass(*args_, **kwargs_)5178 else:5179 return docInternalS1Type(*args_, **kwargs_)5180 factory = staticmethod(factory)5181 def get_para(self): return self.para5182 def set_para(self, para): self.para = para5183 def add_para(self, value): self.para.append(value)5184 def insert_para(self, index, value): self.para[index] = value5185 def get_sect2(self): return self.sect25186 def set_sect2(self, sect2): self.sect2 = sect25187 def add_sect2(self, value): self.sect2.append(value)5188 def insert_sect2(self, index, value): self.sect2[index] = value5189 def export(self, outfile, level, namespace_='', name_='docInternalS1Type', namespacedef_=''):5190 showIndent(outfile, level)5191 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5192 self.exportAttributes(outfile, level, namespace_, name_='docInternalS1Type')5193 outfile.write('>')5194 self.exportChildren(outfile, level + 1, namespace_, name_)5195 outfile.write('</%s%s>\n' % (namespace_, name_))5196 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS1Type'):5197 pass5198 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS1Type'):5199 for item_ in self.content_:5200 item_.export(outfile, level, item_.name, namespace_)5201 def hasContent_(self):5202 if (5203 self.para is not None or5204 self.sect2 is not None5205 ):5206 return True5207 else:5208 return False5209 def exportLiteral(self, outfile, level, name_='docInternalS1Type'):5210 level += 15211 self.exportLiteralAttributes(outfile, level, name_)5212 if self.hasContent_():5213 self.exportLiteralChildren(outfile, level, name_)5214 def exportLiteralAttributes(self, outfile, level, name_):5215 pass5216 def exportLiteralChildren(self, outfile, level, name_):5217 showIndent(outfile, level)5218 outfile.write('content_ = [\n')5219 for item_ in self.content_:5220 item_.exportLiteral(outfile, level, name_)5221 showIndent(outfile, level)5222 outfile.write('],\n')5223 showIndent(outfile, level)5224 outfile.write('content_ = [\n')5225 for item_ in self.content_:5226 item_.exportLiteral(outfile, level, name_)5227 showIndent(outfile, level)5228 outfile.write('],\n')5229 def build(self, node_):5230 attrs = node_.attributes5231 self.buildAttributes(attrs)5232 for child_ in node_.childNodes:5233 nodeName_ = child_.nodeName.split(':')[-1]5234 self.buildChildren(child_, nodeName_)5235 def buildAttributes(self, attrs):5236 pass5237 def buildChildren(self, child_, nodeName_):5238 if child_.nodeType == Node.ELEMENT_NODE and \5239 nodeName_ == 'para':5240 childobj_ = docParaType.factory()5241 childobj_.build(child_)5242 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5243 MixedContainer.TypeNone, 'para', childobj_)5244 self.content_.append(obj_)5245 elif child_.nodeType == Node.ELEMENT_NODE and \5246 nodeName_ == 'sect2':5247 childobj_ = docSect2Type.factory()5248 childobj_.build(child_)5249 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5250 MixedContainer.TypeNone, 'sect2', childobj_)5251 self.content_.append(obj_)5252 elif child_.nodeType == Node.TEXT_NODE:5253 obj_ = self.mixedclass_(MixedContainer.CategoryText,5254 MixedContainer.TypeNone, '', child_.nodeValue)5255 self.content_.append(obj_)5256# end class docInternalS1Type5257class docInternalS2Type(GeneratedsSuper):5258 subclass = None5259 superclass = None5260 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):5261 if mixedclass_ is None:5262 self.mixedclass_ = MixedContainer5263 else:5264 self.mixedclass_ = mixedclass_5265 if content_ is None:5266 self.content_ = []5267 else:5268 self.content_ = content_5269 def factory(*args_, **kwargs_):5270 if docInternalS2Type.subclass:5271 return docInternalS2Type.subclass(*args_, **kwargs_)5272 else:5273 return docInternalS2Type(*args_, **kwargs_)5274 factory = staticmethod(factory)5275 def get_para(self): return self.para5276 def set_para(self, para): self.para = para5277 def add_para(self, value): self.para.append(value)5278 def insert_para(self, index, value): self.para[index] = value5279 def get_sect3(self): return self.sect35280 def set_sect3(self, sect3): self.sect3 = sect35281 def add_sect3(self, value): self.sect3.append(value)5282 def insert_sect3(self, index, value): self.sect3[index] = value5283 def export(self, outfile, level, namespace_='', name_='docInternalS2Type', namespacedef_=''):5284 showIndent(outfile, level)5285 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5286 self.exportAttributes(outfile, level, namespace_, name_='docInternalS2Type')5287 outfile.write('>')5288 self.exportChildren(outfile, level + 1, namespace_, name_)5289 outfile.write('</%s%s>\n' % (namespace_, name_))5290 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS2Type'):5291 pass5292 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS2Type'):5293 for item_ in self.content_:5294 item_.export(outfile, level, item_.name, namespace_)5295 def hasContent_(self):5296 if (5297 self.para is not None or5298 self.sect3 is not None5299 ):5300 return True5301 else:5302 return False5303 def exportLiteral(self, outfile, level, name_='docInternalS2Type'):5304 level += 15305 self.exportLiteralAttributes(outfile, level, name_)5306 if self.hasContent_():5307 self.exportLiteralChildren(outfile, level, name_)5308 def exportLiteralAttributes(self, outfile, level, name_):5309 pass5310 def exportLiteralChildren(self, outfile, level, name_):5311 showIndent(outfile, level)5312 outfile.write('content_ = [\n')5313 for item_ in self.content_:5314 item_.exportLiteral(outfile, level, name_)5315 showIndent(outfile, level)5316 outfile.write('],\n')5317 showIndent(outfile, level)5318 outfile.write('content_ = [\n')5319 for item_ in self.content_:5320 item_.exportLiteral(outfile, level, name_)5321 showIndent(outfile, level)5322 outfile.write('],\n')5323 def build(self, node_):5324 attrs = node_.attributes5325 self.buildAttributes(attrs)5326 for child_ in node_.childNodes:5327 nodeName_ = child_.nodeName.split(':')[-1]5328 self.buildChildren(child_, nodeName_)5329 def buildAttributes(self, attrs):5330 pass5331 def buildChildren(self, child_, nodeName_):5332 if child_.nodeType == Node.ELEMENT_NODE and \5333 nodeName_ == 'para':5334 childobj_ = docParaType.factory()5335 childobj_.build(child_)5336 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5337 MixedContainer.TypeNone, 'para', childobj_)5338 self.content_.append(obj_)5339 elif child_.nodeType == Node.ELEMENT_NODE and \5340 nodeName_ == 'sect3':5341 childobj_ = docSect3Type.factory()5342 childobj_.build(child_)5343 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5344 MixedContainer.TypeNone, 'sect3', childobj_)5345 self.content_.append(obj_)5346 elif child_.nodeType == Node.TEXT_NODE:5347 obj_ = self.mixedclass_(MixedContainer.CategoryText,5348 MixedContainer.TypeNone, '', child_.nodeValue)5349 self.content_.append(obj_)5350# end class docInternalS2Type5351class docInternalS3Type(GeneratedsSuper):5352 subclass = None5353 superclass = None5354 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):5355 if mixedclass_ is None:5356 self.mixedclass_ = MixedContainer5357 else:5358 self.mixedclass_ = mixedclass_5359 if content_ is None:5360 self.content_ = []5361 else:5362 self.content_ = content_5363 def factory(*args_, **kwargs_):5364 if docInternalS3Type.subclass:5365 return docInternalS3Type.subclass(*args_, **kwargs_)5366 else:5367 return docInternalS3Type(*args_, **kwargs_)5368 factory = staticmethod(factory)5369 def get_para(self): return self.para5370 def set_para(self, para): self.para = para5371 def add_para(self, value): self.para.append(value)5372 def insert_para(self, index, value): self.para[index] = value5373 def get_sect3(self): return self.sect35374 def set_sect3(self, sect3): self.sect3 = sect35375 def add_sect3(self, value): self.sect3.append(value)5376 def insert_sect3(self, index, value): self.sect3[index] = value5377 def export(self, outfile, level, namespace_='', name_='docInternalS3Type', namespacedef_=''):5378 showIndent(outfile, level)5379 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5380 self.exportAttributes(outfile, level, namespace_, name_='docInternalS3Type')5381 outfile.write('>')5382 self.exportChildren(outfile, level + 1, namespace_, name_)5383 outfile.write('</%s%s>\n' % (namespace_, name_))5384 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS3Type'):5385 pass5386 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS3Type'):5387 for item_ in self.content_:5388 item_.export(outfile, level, item_.name, namespace_)5389 def hasContent_(self):5390 if (5391 self.para is not None or5392 self.sect3 is not None5393 ):5394 return True5395 else:5396 return False5397 def exportLiteral(self, outfile, level, name_='docInternalS3Type'):5398 level += 15399 self.exportLiteralAttributes(outfile, level, name_)5400 if self.hasContent_():5401 self.exportLiteralChildren(outfile, level, name_)5402 def exportLiteralAttributes(self, outfile, level, name_):5403 pass5404 def exportLiteralChildren(self, outfile, level, name_):5405 showIndent(outfile, level)5406 outfile.write('content_ = [\n')5407 for item_ in self.content_:5408 item_.exportLiteral(outfile, level, name_)5409 showIndent(outfile, level)5410 outfile.write('],\n')5411 showIndent(outfile, level)5412 outfile.write('content_ = [\n')5413 for item_ in self.content_:5414 item_.exportLiteral(outfile, level, name_)5415 showIndent(outfile, level)5416 outfile.write('],\n')5417 def build(self, node_):5418 attrs = node_.attributes5419 self.buildAttributes(attrs)5420 for child_ in node_.childNodes:5421 nodeName_ = child_.nodeName.split(':')[-1]5422 self.buildChildren(child_, nodeName_)5423 def buildAttributes(self, attrs):5424 pass5425 def buildChildren(self, child_, nodeName_):5426 if child_.nodeType == Node.ELEMENT_NODE and \5427 nodeName_ == 'para':5428 childobj_ = docParaType.factory()5429 childobj_.build(child_)5430 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5431 MixedContainer.TypeNone, 'para', childobj_)5432 self.content_.append(obj_)5433 elif child_.nodeType == Node.ELEMENT_NODE and \5434 nodeName_ == 'sect3':5435 childobj_ = docSect4Type.factory()5436 childobj_.build(child_)5437 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5438 MixedContainer.TypeNone, 'sect3', childobj_)5439 self.content_.append(obj_)5440 elif child_.nodeType == Node.TEXT_NODE:5441 obj_ = self.mixedclass_(MixedContainer.CategoryText,5442 MixedContainer.TypeNone, '', child_.nodeValue)5443 self.content_.append(obj_)5444# end class docInternalS3Type5445class docInternalS4Type(GeneratedsSuper):5446 subclass = None5447 superclass = None5448 def __init__(self, para=None, mixedclass_=None, content_=None):5449 if mixedclass_ is None:5450 self.mixedclass_ = MixedContainer5451 else:5452 self.mixedclass_ = mixedclass_5453 if content_ is None:5454 self.content_ = []5455 else:5456 self.content_ = content_5457 def factory(*args_, **kwargs_):5458 if docInternalS4Type.subclass:5459 return docInternalS4Type.subclass(*args_, **kwargs_)5460 else:5461 return docInternalS4Type(*args_, **kwargs_)5462 factory = staticmethod(factory)5463 def get_para(self): return self.para5464 def set_para(self, para): self.para = para5465 def add_para(self, value): self.para.append(value)5466 def insert_para(self, index, value): self.para[index] = value5467 def export(self, outfile, level, namespace_='', name_='docInternalS4Type', namespacedef_=''):5468 showIndent(outfile, level)5469 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5470 self.exportAttributes(outfile, level, namespace_, name_='docInternalS4Type')5471 outfile.write('>')5472 self.exportChildren(outfile, level + 1, namespace_, name_)5473 outfile.write('</%s%s>\n' % (namespace_, name_))5474 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS4Type'):5475 pass5476 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS4Type'):5477 for item_ in self.content_:5478 item_.export(outfile, level, item_.name, namespace_)5479 def hasContent_(self):5480 if (5481 self.para is not None5482 ):5483 return True5484 else:5485 return False5486 def exportLiteral(self, outfile, level, name_='docInternalS4Type'):5487 level += 15488 self.exportLiteralAttributes(outfile, level, name_)5489 if self.hasContent_():5490 self.exportLiteralChildren(outfile, level, name_)5491 def exportLiteralAttributes(self, outfile, level, name_):5492 pass5493 def exportLiteralChildren(self, outfile, level, name_):5494 showIndent(outfile, level)5495 outfile.write('content_ = [\n')5496 for item_ in self.content_:5497 item_.exportLiteral(outfile, level, name_)5498 showIndent(outfile, level)5499 outfile.write('],\n')5500 def build(self, node_):5501 attrs = node_.attributes5502 self.buildAttributes(attrs)5503 for child_ in node_.childNodes:5504 nodeName_ = child_.nodeName.split(':')[-1]5505 self.buildChildren(child_, nodeName_)5506 def buildAttributes(self, attrs):5507 pass5508 def buildChildren(self, child_, nodeName_):5509 if child_.nodeType == Node.ELEMENT_NODE and \5510 nodeName_ == 'para':5511 childobj_ = docParaType.factory()5512 childobj_.build(child_)5513 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5514 MixedContainer.TypeNone, 'para', childobj_)5515 self.content_.append(obj_)5516 elif child_.nodeType == Node.TEXT_NODE:5517 obj_ = self.mixedclass_(MixedContainer.CategoryText,5518 MixedContainer.TypeNone, '', child_.nodeValue)5519 self.content_.append(obj_)5520# end class docInternalS4Type5521class docTitleType(GeneratedsSuper):5522 subclass = None5523 superclass = None5524 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5525 if mixedclass_ is None:5526 self.mixedclass_ = MixedContainer5527 else:5528 self.mixedclass_ = mixedclass_5529 if content_ is None:5530 self.content_ = []5531 else:5532 self.content_ = content_5533 def factory(*args_, **kwargs_):5534 if docTitleType.subclass:5535 return docTitleType.subclass(*args_, **kwargs_)5536 else:5537 return docTitleType(*args_, **kwargs_)5538 factory = staticmethod(factory)5539 def getValueOf_(self): return self.valueOf_5540 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5541 def export(self, outfile, level, namespace_='', name_='docTitleType', namespacedef_=''):5542 showIndent(outfile, level)5543 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5544 self.exportAttributes(outfile, level, namespace_, name_='docTitleType')5545 outfile.write('>')5546 self.exportChildren(outfile, level + 1, namespace_, name_)5547 outfile.write('</%s%s>\n' % (namespace_, name_))5548 def exportAttributes(self, outfile, level, namespace_='', name_='docTitleType'):5549 pass5550 def exportChildren(self, outfile, level, namespace_='', name_='docTitleType'):5551 if self.valueOf_.find('![CDATA')>-1:5552 value=quote_xml('%s' % self.valueOf_)5553 value=value.replace('![CDATA','<![CDATA')5554 value=value.replace(']]',']]>')5555 outfile.write(value)5556 else:5557 outfile.write(quote_xml('%s' % self.valueOf_))5558 def hasContent_(self):5559 if (5560 self.valueOf_ is not None5561 ):5562 return True5563 else:5564 return False5565 def exportLiteral(self, outfile, level, name_='docTitleType'):5566 level += 15567 self.exportLiteralAttributes(outfile, level, name_)5568 if self.hasContent_():5569 self.exportLiteralChildren(outfile, level, name_)5570 def exportLiteralAttributes(self, outfile, level, name_):5571 pass5572 def exportLiteralChildren(self, outfile, level, name_):5573 showIndent(outfile, level)5574 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5575 def build(self, node_):5576 attrs = node_.attributes5577 self.buildAttributes(attrs)5578 self.valueOf_ = ''5579 for child_ in node_.childNodes:5580 nodeName_ = child_.nodeName.split(':')[-1]5581 self.buildChildren(child_, nodeName_)5582 def buildAttributes(self, attrs):5583 pass5584 def buildChildren(self, child_, nodeName_):5585 if child_.nodeType == Node.TEXT_NODE:5586 obj_ = self.mixedclass_(MixedContainer.CategoryText,5587 MixedContainer.TypeNone, '', child_.nodeValue)5588 self.content_.append(obj_)5589 if child_.nodeType == Node.TEXT_NODE:5590 self.valueOf_ += child_.nodeValue5591 elif child_.nodeType == Node.CDATA_SECTION_NODE:5592 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5593# end class docTitleType5594class docParaType(GeneratedsSuper):5595 subclass = None5596 superclass = None5597 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5598 if mixedclass_ is None:5599 self.mixedclass_ = MixedContainer5600 else:5601 self.mixedclass_ = mixedclass_5602 if content_ is None:5603 self.content_ = []5604 else:5605 self.content_ = content_5606 def factory(*args_, **kwargs_):5607 if docParaType.subclass:5608 return docParaType.subclass(*args_, **kwargs_)5609 else:5610 return docParaType(*args_, **kwargs_)5611 factory = staticmethod(factory)5612 def getValueOf_(self): return self.valueOf_5613 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5614 def export(self, outfile, level, namespace_='', name_='docParaType', namespacedef_=''):5615 showIndent(outfile, level)5616 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5617 self.exportAttributes(outfile, level, namespace_, name_='docParaType')5618 outfile.write('>')5619 self.exportChildren(outfile, level + 1, namespace_, name_)5620 outfile.write('</%s%s>\n' % (namespace_, name_))5621 def exportAttributes(self, outfile, level, namespace_='', name_='docParaType'):5622 pass5623 def exportChildren(self, outfile, level, namespace_='', name_='docParaType'):5624 if self.valueOf_.find('![CDATA')>-1:5625 value=quote_xml('%s' % self.valueOf_)5626 value=value.replace('![CDATA','<![CDATA')5627 value=value.replace(']]',']]>')5628 outfile.write(value)5629 else:5630 outfile.write(quote_xml('%s' % self.valueOf_))5631 def hasContent_(self):5632 if (5633 self.valueOf_ is not None5634 ):5635 return True5636 else:5637 return False5638 def exportLiteral(self, outfile, level, name_='docParaType'):5639 level += 15640 self.exportLiteralAttributes(outfile, level, name_)5641 if self.hasContent_():5642 self.exportLiteralChildren(outfile, level, name_)