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_)5643 def exportLiteralAttributes(self, outfile, level, name_):5644 pass5645 def exportLiteralChildren(self, outfile, level, name_):5646 showIndent(outfile, level)5647 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5648 def build(self, node_):5649 attrs = node_.attributes5650 self.buildAttributes(attrs)5651 self.valueOf_ = ''5652 for child_ in node_.childNodes:5653 nodeName_ = child_.nodeName.split(':')[-1]5654 self.buildChildren(child_, nodeName_)5655 def buildAttributes(self, attrs):5656 pass5657 def buildChildren(self, child_, nodeName_):5658 if child_.nodeType == Node.TEXT_NODE:5659 obj_ = self.mixedclass_(MixedContainer.CategoryText,5660 MixedContainer.TypeNone, '', child_.nodeValue)5661 self.content_.append(obj_)5662 if child_.nodeType == Node.TEXT_NODE:5663 self.valueOf_ += child_.nodeValue5664 elif child_.nodeType == Node.CDATA_SECTION_NODE:5665 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5666# end class docParaType5667class docMarkupType(GeneratedsSuper):5668 subclass = None5669 superclass = None5670 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5671 if mixedclass_ is None:5672 self.mixedclass_ = MixedContainer5673 else:5674 self.mixedclass_ = mixedclass_5675 if content_ is None:5676 self.content_ = []5677 else:5678 self.content_ = content_5679 def factory(*args_, **kwargs_):5680 if docMarkupType.subclass:5681 return docMarkupType.subclass(*args_, **kwargs_)5682 else:5683 return docMarkupType(*args_, **kwargs_)5684 factory = staticmethod(factory)5685 def getValueOf_(self): return self.valueOf_5686 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5687 def export(self, outfile, level, namespace_='', name_='docMarkupType', namespacedef_=''):5688 showIndent(outfile, level)5689 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5690 self.exportAttributes(outfile, level, namespace_, name_='docMarkupType')5691 outfile.write('>')5692 self.exportChildren(outfile, level + 1, namespace_, name_)5693 outfile.write('</%s%s>\n' % (namespace_, name_))5694 def exportAttributes(self, outfile, level, namespace_='', name_='docMarkupType'):5695 pass5696 def exportChildren(self, outfile, level, namespace_='', name_='docMarkupType'):5697 if self.valueOf_.find('![CDATA')>-1:5698 value=quote_xml('%s' % self.valueOf_)5699 value=value.replace('![CDATA','<![CDATA')5700 value=value.replace(']]',']]>')5701 outfile.write(value)5702 else:5703 outfile.write(quote_xml('%s' % self.valueOf_))5704 def hasContent_(self):5705 if (5706 self.valueOf_ is not None5707 ):5708 return True5709 else:5710 return False5711 def exportLiteral(self, outfile, level, name_='docMarkupType'):5712 level += 15713 self.exportLiteralAttributes(outfile, level, name_)5714 if self.hasContent_():5715 self.exportLiteralChildren(outfile, level, name_)5716 def exportLiteralAttributes(self, outfile, level, name_):5717 pass5718 def exportLiteralChildren(self, outfile, level, name_):5719 showIndent(outfile, level)5720 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5721 def build(self, node_):5722 attrs = node_.attributes5723 self.buildAttributes(attrs)5724 self.valueOf_ = ''5725 for child_ in node_.childNodes:5726 nodeName_ = child_.nodeName.split(':')[-1]5727 self.buildChildren(child_, nodeName_)5728 def buildAttributes(self, attrs):5729 pass5730 def buildChildren(self, child_, nodeName_):5731 if child_.nodeType == Node.TEXT_NODE:5732 obj_ = self.mixedclass_(MixedContainer.CategoryText,5733 MixedContainer.TypeNone, '', child_.nodeValue)5734 self.content_.append(obj_)5735 if child_.nodeType == Node.TEXT_NODE:5736 self.valueOf_ += child_.nodeValue5737 elif child_.nodeType == Node.CDATA_SECTION_NODE:5738 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5739# end class docMarkupType5740class docURLLink(GeneratedsSuper):5741 subclass = None5742 superclass = None5743 def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):5744 self.url = url5745 if mixedclass_ is None:5746 self.mixedclass_ = MixedContainer5747 else:5748 self.mixedclass_ = mixedclass_5749 if content_ is None:5750 self.content_ = []5751 else:5752 self.content_ = content_5753 def factory(*args_, **kwargs_):5754 if docURLLink.subclass:5755 return docURLLink.subclass(*args_, **kwargs_)5756 else:5757 return docURLLink(*args_, **kwargs_)5758 factory = staticmethod(factory)5759 def get_url(self): return self.url5760 def set_url(self, url): self.url = url5761 def getValueOf_(self): return self.valueOf_5762 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5763 def export(self, outfile, level, namespace_='', name_='docURLLink', namespacedef_=''):5764 showIndent(outfile, level)5765 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5766 self.exportAttributes(outfile, level, namespace_, name_='docURLLink')5767 outfile.write('>')5768 self.exportChildren(outfile, level + 1, namespace_, name_)5769 outfile.write('</%s%s>\n' % (namespace_, name_))5770 def exportAttributes(self, outfile, level, namespace_='', name_='docURLLink'):5771 if self.url is not None:5772 outfile.write(' url=%s' % (self.format_string(quote_attrib(self.url).encode(ExternalEncoding), input_name='url'), ))5773 def exportChildren(self, outfile, level, namespace_='', name_='docURLLink'):5774 if self.valueOf_.find('![CDATA')>-1:5775 value=quote_xml('%s' % self.valueOf_)5776 value=value.replace('![CDATA','<![CDATA')5777 value=value.replace(']]',']]>')5778 outfile.write(value)5779 else:5780 outfile.write(quote_xml('%s' % self.valueOf_))5781 def hasContent_(self):5782 if (5783 self.valueOf_ is not None5784 ):5785 return True5786 else:5787 return False5788 def exportLiteral(self, outfile, level, name_='docURLLink'):5789 level += 15790 self.exportLiteralAttributes(outfile, level, name_)5791 if self.hasContent_():5792 self.exportLiteralChildren(outfile, level, name_)5793 def exportLiteralAttributes(self, outfile, level, name_):5794 if self.url is not None:5795 showIndent(outfile, level)5796 outfile.write('url = %s,\n' % (self.url,))5797 def exportLiteralChildren(self, outfile, level, name_):5798 showIndent(outfile, level)5799 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5800 def build(self, node_):5801 attrs = node_.attributes5802 self.buildAttributes(attrs)5803 self.valueOf_ = ''5804 for child_ in node_.childNodes:5805 nodeName_ = child_.nodeName.split(':')[-1]5806 self.buildChildren(child_, nodeName_)5807 def buildAttributes(self, attrs):5808 if attrs.get('url'):5809 self.url = attrs.get('url').value5810 def buildChildren(self, child_, nodeName_):5811 if child_.nodeType == Node.TEXT_NODE:5812 obj_ = self.mixedclass_(MixedContainer.CategoryText,5813 MixedContainer.TypeNone, '', child_.nodeValue)5814 self.content_.append(obj_)5815 if child_.nodeType == Node.TEXT_NODE:5816 self.valueOf_ += child_.nodeValue5817 elif child_.nodeType == Node.CDATA_SECTION_NODE:5818 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5819# end class docURLLink5820class docAnchorType(GeneratedsSuper):5821 subclass = None5822 superclass = None5823 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):5824 self.id = id5825 if mixedclass_ is None:5826 self.mixedclass_ = MixedContainer5827 else:5828 self.mixedclass_ = mixedclass_5829 if content_ is None:5830 self.content_ = []5831 else:5832 self.content_ = content_5833 def factory(*args_, **kwargs_):5834 if docAnchorType.subclass:5835 return docAnchorType.subclass(*args_, **kwargs_)5836 else:5837 return docAnchorType(*args_, **kwargs_)5838 factory = staticmethod(factory)5839 def get_id(self): return self.id5840 def set_id(self, id): self.id = id5841 def getValueOf_(self): return self.valueOf_5842 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5843 def export(self, outfile, level, namespace_='', name_='docAnchorType', namespacedef_=''):5844 showIndent(outfile, level)5845 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5846 self.exportAttributes(outfile, level, namespace_, name_='docAnchorType')5847 outfile.write('>')5848 self.exportChildren(outfile, level + 1, namespace_, name_)5849 outfile.write('</%s%s>\n' % (namespace_, name_))5850 def exportAttributes(self, outfile, level, namespace_='', name_='docAnchorType'):5851 if self.id is not None:5852 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))5853 def exportChildren(self, outfile, level, namespace_='', name_='docAnchorType'):5854 if self.valueOf_.find('![CDATA')>-1:5855 value=quote_xml('%s' % self.valueOf_)5856 value=value.replace('![CDATA','<![CDATA')5857 value=value.replace(']]',']]>')5858 outfile.write(value)5859 else:5860 outfile.write(quote_xml('%s' % self.valueOf_))5861 def hasContent_(self):5862 if (5863 self.valueOf_ is not None5864 ):5865 return True5866 else:5867 return False5868 def exportLiteral(self, outfile, level, name_='docAnchorType'):5869 level += 15870 self.exportLiteralAttributes(outfile, level, name_)5871 if self.hasContent_():5872 self.exportLiteralChildren(outfile, level, name_)5873 def exportLiteralAttributes(self, outfile, level, name_):5874 if self.id is not None:5875 showIndent(outfile, level)5876 outfile.write('id = %s,\n' % (self.id,))5877 def exportLiteralChildren(self, outfile, level, name_):5878 showIndent(outfile, level)5879 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5880 def build(self, node_):5881 attrs = node_.attributes5882 self.buildAttributes(attrs)5883 self.valueOf_ = ''5884 for child_ in node_.childNodes:5885 nodeName_ = child_.nodeName.split(':')[-1]5886 self.buildChildren(child_, nodeName_)5887 def buildAttributes(self, attrs):5888 if attrs.get('id'):5889 self.id = attrs.get('id').value5890 def buildChildren(self, child_, nodeName_):5891 if child_.nodeType == Node.TEXT_NODE:5892 obj_ = self.mixedclass_(MixedContainer.CategoryText,5893 MixedContainer.TypeNone, '', child_.nodeValue)5894 self.content_.append(obj_)5895 if child_.nodeType == Node.TEXT_NODE:5896 self.valueOf_ += child_.nodeValue5897 elif child_.nodeType == Node.CDATA_SECTION_NODE:5898 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5899# end class docAnchorType5900class docFormulaType(GeneratedsSuper):5901 subclass = None5902 superclass = None5903 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):5904 self.id = id5905 if mixedclass_ is None:5906 self.mixedclass_ = MixedContainer5907 else:5908 self.mixedclass_ = mixedclass_5909 if content_ is None:5910 self.content_ = []5911 else:5912 self.content_ = content_5913 def factory(*args_, **kwargs_):5914 if docFormulaType.subclass:5915 return docFormulaType.subclass(*args_, **kwargs_)5916 else:5917 return docFormulaType(*args_, **kwargs_)5918 factory = staticmethod(factory)5919 def get_id(self): return self.id5920 def set_id(self, id): self.id = id5921 def getValueOf_(self): return self.valueOf_5922 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5923 def export(self, outfile, level, namespace_='', name_='docFormulaType', namespacedef_=''):5924 showIndent(outfile, level)5925 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5926 self.exportAttributes(outfile, level, namespace_, name_='docFormulaType')5927 outfile.write('>')5928 self.exportChildren(outfile, level + 1, namespace_, name_)5929 outfile.write('</%s%s>\n' % (namespace_, name_))5930 def exportAttributes(self, outfile, level, namespace_='', name_='docFormulaType'):5931 if self.id is not None:5932 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))5933 def exportChildren(self, outfile, level, namespace_='', name_='docFormulaType'):5934 if self.valueOf_.find('![CDATA')>-1:5935 value=quote_xml('%s' % self.valueOf_)5936 value=value.replace('![CDATA','<![CDATA')5937 value=value.replace(']]',']]>')5938 outfile.write(value)5939 else:5940 outfile.write(quote_xml('%s' % self.valueOf_))5941 def hasContent_(self):5942 if (5943 self.valueOf_ is not None5944 ):5945 return True5946 else:5947 return False5948 def exportLiteral(self, outfile, level, name_='docFormulaType'):5949 level += 15950 self.exportLiteralAttributes(outfile, level, name_)5951 if self.hasContent_():5952 self.exportLiteralChildren(outfile, level, name_)5953 def exportLiteralAttributes(self, outfile, level, name_):5954 if self.id is not None:5955 showIndent(outfile, level)5956 outfile.write('id = %s,\n' % (self.id,))5957 def exportLiteralChildren(self, outfile, level, name_):5958 showIndent(outfile, level)5959 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5960 def build(self, node_):5961 attrs = node_.attributes5962 self.buildAttributes(attrs)5963 self.valueOf_ = ''5964 for child_ in node_.childNodes:5965 nodeName_ = child_.nodeName.split(':')[-1]5966 self.buildChildren(child_, nodeName_)5967 def buildAttributes(self, attrs):5968 if attrs.get('id'):5969 self.id = attrs.get('id').value5970 def buildChildren(self, child_, nodeName_):5971 if child_.nodeType == Node.TEXT_NODE:5972 obj_ = self.mixedclass_(MixedContainer.CategoryText,5973 MixedContainer.TypeNone, '', child_.nodeValue)5974 self.content_.append(obj_)5975 if child_.nodeType == Node.TEXT_NODE:5976 self.valueOf_ += child_.nodeValue5977 elif child_.nodeType == Node.CDATA_SECTION_NODE:5978 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5979# end class docFormulaType5980class docIndexEntryType(GeneratedsSuper):5981 subclass = None5982 superclass = None5983 def __init__(self, primaryie=None, secondaryie=None):5984 self.primaryie = primaryie5985 self.secondaryie = secondaryie5986 def factory(*args_, **kwargs_):5987 if docIndexEntryType.subclass:5988 return docIndexEntryType.subclass(*args_, **kwargs_)5989 else:5990 return docIndexEntryType(*args_, **kwargs_)5991 factory = staticmethod(factory)5992 def get_primaryie(self): return self.primaryie5993 def set_primaryie(self, primaryie): self.primaryie = primaryie5994 def get_secondaryie(self): return self.secondaryie5995 def set_secondaryie(self, secondaryie): self.secondaryie = secondaryie5996 def export(self, outfile, level, namespace_='', name_='docIndexEntryType', namespacedef_=''):5997 showIndent(outfile, level)5998 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5999 self.exportAttributes(outfile, level, namespace_, name_='docIndexEntryType')6000 if self.hasContent_():6001 outfile.write('>\n')6002 self.exportChildren(outfile, level + 1, namespace_, name_)6003 showIndent(outfile, level)6004 outfile.write('</%s%s>\n' % (namespace_, name_))6005 else:6006 outfile.write(' />\n')6007 def exportAttributes(self, outfile, level, namespace_='', name_='docIndexEntryType'):6008 pass6009 def exportChildren(self, outfile, level, namespace_='', name_='docIndexEntryType'):6010 if self.primaryie is not None:6011 showIndent(outfile, level)6012 outfile.write('<%sprimaryie>%s</%sprimaryie>\n' % (namespace_, self.format_string(quote_xml(self.primaryie).encode(ExternalEncoding), input_name='primaryie'), namespace_))6013 if self.secondaryie is not None:6014 showIndent(outfile, level)6015 outfile.write('<%ssecondaryie>%s</%ssecondaryie>\n' % (namespace_, self.format_string(quote_xml(self.secondaryie).encode(ExternalEncoding), input_name='secondaryie'), namespace_))6016 def hasContent_(self):6017 if (6018 self.primaryie is not None or6019 self.secondaryie is not None6020 ):6021 return True6022 else:6023 return False6024 def exportLiteral(self, outfile, level, name_='docIndexEntryType'):6025 level += 16026 self.exportLiteralAttributes(outfile, level, name_)6027 if self.hasContent_():6028 self.exportLiteralChildren(outfile, level, name_)6029 def exportLiteralAttributes(self, outfile, level, name_):6030 pass6031 def exportLiteralChildren(self, outfile, level, name_):6032 showIndent(outfile, level)6033 outfile.write('primaryie=%s,\n' % quote_python(self.primaryie).encode(ExternalEncoding))6034 showIndent(outfile, level)6035 outfile.write('secondaryie=%s,\n' % quote_python(self.secondaryie).encode(ExternalEncoding))6036 def build(self, node_):6037 attrs = node_.attributes6038 self.buildAttributes(attrs)6039 for child_ in node_.childNodes:6040 nodeName_ = child_.nodeName.split(':')[-1]6041 self.buildChildren(child_, nodeName_)6042 def buildAttributes(self, attrs):6043 pass6044 def buildChildren(self, child_, nodeName_):6045 if child_.nodeType == Node.ELEMENT_NODE and \6046 nodeName_ == 'primaryie':6047 primaryie_ = ''6048 for text__content_ in child_.childNodes:6049 primaryie_ += text__content_.nodeValue6050 self.primaryie = primaryie_6051 elif child_.nodeType == Node.ELEMENT_NODE and \6052 nodeName_ == 'secondaryie':6053 secondaryie_ = ''6054 for text__content_ in child_.childNodes:6055 secondaryie_ += text__content_.nodeValue6056 self.secondaryie = secondaryie_6057# end class docIndexEntryType6058class docListType(GeneratedsSuper):6059 subclass = None6060 superclass = None6061 def __init__(self, listitem=None):6062 if listitem is None:6063 self.listitem = []6064 else:6065 self.listitem = listitem6066 def factory(*args_, **kwargs_):6067 if docListType.subclass:6068 return docListType.subclass(*args_, **kwargs_)6069 else:6070 return docListType(*args_, **kwargs_)6071 factory = staticmethod(factory)6072 def get_listitem(self): return self.listitem6073 def set_listitem(self, listitem): self.listitem = listitem6074 def add_listitem(self, value): self.listitem.append(value)6075 def insert_listitem(self, index, value): self.listitem[index] = value6076 def export(self, outfile, level, namespace_='', name_='docListType', namespacedef_=''):6077 showIndent(outfile, level)6078 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6079 self.exportAttributes(outfile, level, namespace_, name_='docListType')6080 if self.hasContent_():6081 outfile.write('>\n')6082 self.exportChildren(outfile, level + 1, namespace_, name_)6083 showIndent(outfile, level)6084 outfile.write('</%s%s>\n' % (namespace_, name_))6085 else:6086 outfile.write(' />\n')6087 def exportAttributes(self, outfile, level, namespace_='', name_='docListType'):6088 pass6089 def exportChildren(self, outfile, level, namespace_='', name_='docListType'):6090 for listitem_ in self.listitem:6091 listitem_.export(outfile, level, namespace_, name_='listitem')6092 def hasContent_(self):6093 if (6094 self.listitem is not None6095 ):6096 return True6097 else:6098 return False6099 def exportLiteral(self, outfile, level, name_='docListType'):6100 level += 16101 self.exportLiteralAttributes(outfile, level, name_)6102 if self.hasContent_():6103 self.exportLiteralChildren(outfile, level, name_)6104 def exportLiteralAttributes(self, outfile, level, name_):6105 pass6106 def exportLiteralChildren(self, outfile, level, name_):6107 showIndent(outfile, level)6108 outfile.write('listitem=[\n')6109 level += 16110 for listitem in self.listitem:6111 showIndent(outfile, level)6112 outfile.write('model_.listitem(\n')6113 listitem.exportLiteral(outfile, level, name_='listitem')6114 showIndent(outfile, level)6115 outfile.write('),\n')6116 level -= 16117 showIndent(outfile, level)6118 outfile.write('],\n')6119 def build(self, node_):6120 attrs = node_.attributes6121 self.buildAttributes(attrs)6122 for child_ in node_.childNodes:6123 nodeName_ = child_.nodeName.split(':')[-1]6124 self.buildChildren(child_, nodeName_)6125 def buildAttributes(self, attrs):6126 pass6127 def buildChildren(self, child_, nodeName_):6128 if child_.nodeType == Node.ELEMENT_NODE and \6129 nodeName_ == 'listitem':6130 obj_ = docListItemType.factory()6131 obj_.build(child_)6132 self.listitem.append(obj_)6133# end class docListType6134class docListItemType(GeneratedsSuper):6135 subclass = None6136 superclass = None6137 def __init__(self, para=None):6138 if para is None:6139 self.para = []6140 else:6141 self.para = para6142 def factory(*args_, **kwargs_):6143 if docListItemType.subclass:6144 return docListItemType.subclass(*args_, **kwargs_)6145 else:6146 return docListItemType(*args_, **kwargs_)6147 factory = staticmethod(factory)6148 def get_para(self): return self.para6149 def set_para(self, para): self.para = para6150 def add_para(self, value): self.para.append(value)6151 def insert_para(self, index, value): self.para[index] = value6152 def export(self, outfile, level, namespace_='', name_='docListItemType', namespacedef_=''):6153 showIndent(outfile, level)6154 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6155 self.exportAttributes(outfile, level, namespace_, name_='docListItemType')6156 if self.hasContent_():6157 outfile.write('>\n')6158 self.exportChildren(outfile, level + 1, namespace_, name_)6159 showIndent(outfile, level)6160 outfile.write('</%s%s>\n' % (namespace_, name_))6161 else:6162 outfile.write(' />\n')6163 def exportAttributes(self, outfile, level, namespace_='', name_='docListItemType'):6164 pass6165 def exportChildren(self, outfile, level, namespace_='', name_='docListItemType'):6166 for para_ in self.para:6167 para_.export(outfile, level, namespace_, name_='para')6168 def hasContent_(self):6169 if (6170 self.para is not None6171 ):6172 return True6173 else:6174 return False6175 def exportLiteral(self, outfile, level, name_='docListItemType'):6176 level += 16177 self.exportLiteralAttributes(outfile, level, name_)6178 if self.hasContent_():6179 self.exportLiteralChildren(outfile, level, name_)6180 def exportLiteralAttributes(self, outfile, level, name_):6181 pass6182 def exportLiteralChildren(self, outfile, level, name_):6183 showIndent(outfile, level)6184 outfile.write('para=[\n')6185 level += 16186 for para in self.para:6187 showIndent(outfile, level)6188 outfile.write('model_.para(\n')6189 para.exportLiteral(outfile, level, name_='para')6190 showIndent(outfile, level)6191 outfile.write('),\n')6192 level -= 16193 showIndent(outfile, level)6194 outfile.write('],\n')6195 def build(self, node_):6196 attrs = node_.attributes6197 self.buildAttributes(attrs)6198 for child_ in node_.childNodes:6199 nodeName_ = child_.nodeName.split(':')[-1]6200 self.buildChildren(child_, nodeName_)6201 def buildAttributes(self, attrs):6202 pass6203 def buildChildren(self, child_, nodeName_):6204 if child_.nodeType == Node.ELEMENT_NODE and \6205 nodeName_ == 'para':6206 obj_ = docParaType.factory()6207 obj_.build(child_)6208 self.para.append(obj_)6209# end class docListItemType6210class docSimpleSectType(GeneratedsSuper):6211 subclass = None6212 superclass = None6213 def __init__(self, kind=None, title=None, para=None):6214 self.kind = kind6215 self.title = title6216 if para is None:6217 self.para = []6218 else:6219 self.para = para6220 def factory(*args_, **kwargs_):6221 if docSimpleSectType.subclass:6222 return docSimpleSectType.subclass(*args_, **kwargs_)6223 else:6224 return docSimpleSectType(*args_, **kwargs_)6225 factory = staticmethod(factory)6226 def get_title(self): return self.title6227 def set_title(self, title): self.title = title6228 def get_para(self): return self.para6229 def set_para(self, para): self.para = para6230 def add_para(self, value): self.para.append(value)6231 def insert_para(self, index, value): self.para[index] = value6232 def get_kind(self): return self.kind6233 def set_kind(self, kind): self.kind = kind6234 def export(self, outfile, level, namespace_='', name_='docSimpleSectType', namespacedef_=''):6235 showIndent(outfile, level)6236 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6237 self.exportAttributes(outfile, level, namespace_, name_='docSimpleSectType')6238 if self.hasContent_():6239 outfile.write('>\n')6240 self.exportChildren(outfile, level + 1, namespace_, name_)6241 showIndent(outfile, level)6242 outfile.write('</%s%s>\n' % (namespace_, name_))6243 else:6244 outfile.write(' />\n')6245 def exportAttributes(self, outfile, level, namespace_='', name_='docSimpleSectType'):6246 if self.kind is not None:6247 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))6248 def exportChildren(self, outfile, level, namespace_='', name_='docSimpleSectType'):6249 if self.title:6250 self.title.export(outfile, level, namespace_, name_='title')6251 for para_ in self.para:6252 para_.export(outfile, level, namespace_, name_='para')6253 def hasContent_(self):6254 if (6255 self.title is not None or6256 self.para is not None6257 ):6258 return True6259 else:6260 return False6261 def exportLiteral(self, outfile, level, name_='docSimpleSectType'):6262 level += 16263 self.exportLiteralAttributes(outfile, level, name_)6264 if self.hasContent_():6265 self.exportLiteralChildren(outfile, level, name_)6266 def exportLiteralAttributes(self, outfile, level, name_):6267 if self.kind is not None:6268 showIndent(outfile, level)6269 outfile.write('kind = "%s",\n' % (self.kind,))6270 def exportLiteralChildren(self, outfile, level, name_):6271 if self.title:6272 showIndent(outfile, level)6273 outfile.write('title=model_.docTitleType(\n')6274 self.title.exportLiteral(outfile, level, name_='title')6275 showIndent(outfile, level)6276 outfile.write('),\n')6277 showIndent(outfile, level)6278 outfile.write('para=[\n')6279 level += 16280 for para in self.para:6281 showIndent(outfile, level)6282 outfile.write('model_.para(\n')6283 para.exportLiteral(outfile, level, name_='para')6284 showIndent(outfile, level)6285 outfile.write('),\n')6286 level -= 16287 showIndent(outfile, level)6288 outfile.write('],\n')6289 def build(self, node_):6290 attrs = node_.attributes6291 self.buildAttributes(attrs)6292 for child_ in node_.childNodes:6293 nodeName_ = child_.nodeName.split(':')[-1]6294 self.buildChildren(child_, nodeName_)6295 def buildAttributes(self, attrs):6296 if attrs.get('kind'):6297 self.kind = attrs.get('kind').value6298 def buildChildren(self, child_, nodeName_):6299 if child_.nodeType == Node.ELEMENT_NODE and \6300 nodeName_ == 'title':6301 obj_ = docTitleType.factory()6302 obj_.build(child_)6303 self.set_title(obj_)6304 elif child_.nodeType == Node.ELEMENT_NODE and \6305 nodeName_ == 'para':6306 obj_ = docParaType.factory()6307 obj_.build(child_)6308 self.para.append(obj_)6309# end class docSimpleSectType6310class docVarListEntryType(GeneratedsSuper):6311 subclass = None6312 superclass = None6313 def __init__(self, term=None):6314 self.term = term6315 def factory(*args_, **kwargs_):6316 if docVarListEntryType.subclass:6317 return docVarListEntryType.subclass(*args_, **kwargs_)6318 else:6319 return docVarListEntryType(*args_, **kwargs_)6320 factory = staticmethod(factory)6321 def get_term(self): return self.term6322 def set_term(self, term): self.term = term6323 def export(self, outfile, level, namespace_='', name_='docVarListEntryType', namespacedef_=''):6324 showIndent(outfile, level)6325 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6326 self.exportAttributes(outfile, level, namespace_, name_='docVarListEntryType')6327 if self.hasContent_():6328 outfile.write('>\n')6329 self.exportChildren(outfile, level + 1, namespace_, name_)6330 showIndent(outfile, level)6331 outfile.write('</%s%s>\n' % (namespace_, name_))6332 else:6333 outfile.write(' />\n')6334 def exportAttributes(self, outfile, level, namespace_='', name_='docVarListEntryType'):6335 pass6336 def exportChildren(self, outfile, level, namespace_='', name_='docVarListEntryType'):6337 if self.term:6338 self.term.export(outfile, level, namespace_, name_='term', )6339 def hasContent_(self):6340 if (6341 self.term is not None6342 ):6343 return True6344 else:6345 return False6346 def exportLiteral(self, outfile, level, name_='docVarListEntryType'):6347 level += 16348 self.exportLiteralAttributes(outfile, level, name_)6349 if self.hasContent_():6350 self.exportLiteralChildren(outfile, level, name_)6351 def exportLiteralAttributes(self, outfile, level, name_):6352 pass6353 def exportLiteralChildren(self, outfile, level, name_):6354 if self.term:6355 showIndent(outfile, level)6356 outfile.write('term=model_.docTitleType(\n')6357 self.term.exportLiteral(outfile, level, name_='term')6358 showIndent(outfile, level)6359 outfile.write('),\n')6360 def build(self, node_):6361 attrs = node_.attributes6362 self.buildAttributes(attrs)6363 for child_ in node_.childNodes:6364 nodeName_ = child_.nodeName.split(':')[-1]6365 self.buildChildren(child_, nodeName_)6366 def buildAttributes(self, attrs):6367 pass6368 def buildChildren(self, child_, nodeName_):6369 if child_.nodeType == Node.ELEMENT_NODE and \6370 nodeName_ == 'term':6371 obj_ = docTitleType.factory()6372 obj_.build(child_)6373 self.set_term(obj_)6374# end class docVarListEntryType6375class docVariableListType(GeneratedsSuper):6376 subclass = None6377 superclass = None6378 def __init__(self, valueOf_=''):6379 self.valueOf_ = valueOf_6380 def factory(*args_, **kwargs_):6381 if docVariableListType.subclass:6382 return docVariableListType.subclass(*args_, **kwargs_)6383 else:6384 return docVariableListType(*args_, **kwargs_)6385 factory = staticmethod(factory)6386 def getValueOf_(self): return self.valueOf_6387 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_6388 def export(self, outfile, level, namespace_='', name_='docVariableListType', namespacedef_=''):6389 showIndent(outfile, level)6390 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6391 self.exportAttributes(outfile, level, namespace_, name_='docVariableListType')6392 if self.hasContent_():6393 outfile.write('>\n')6394 self.exportChildren(outfile, level + 1, namespace_, name_)6395 showIndent(outfile, level)6396 outfile.write('</%s%s>\n' % (namespace_, name_))6397 else:6398 outfile.write(' />\n')6399 def exportAttributes(self, outfile, level, namespace_='', name_='docVariableListType'):6400 pass6401 def exportChildren(self, outfile, level, namespace_='', name_='docVariableListType'):6402 if self.valueOf_.find('![CDATA')>-1:6403 value=quote_xml('%s' % self.valueOf_)6404 value=value.replace('![CDATA','<![CDATA')6405 value=value.replace(']]',']]>')6406 outfile.write(value)6407 else:6408 outfile.write(quote_xml('%s' % self.valueOf_))6409 def hasContent_(self):6410 if (6411 self.valueOf_ is not None6412 ):6413 return True6414 else:6415 return False6416 def exportLiteral(self, outfile, level, name_='docVariableListType'):6417 level += 16418 self.exportLiteralAttributes(outfile, level, name_)6419 if self.hasContent_():6420 self.exportLiteralChildren(outfile, level, name_)6421 def exportLiteralAttributes(self, outfile, level, name_):6422 pass6423 def exportLiteralChildren(self, outfile, level, name_):6424 showIndent(outfile, level)6425 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))6426 def build(self, node_):6427 attrs = node_.attributes6428 self.buildAttributes(attrs)6429 self.valueOf_ = ''6430 for child_ in node_.childNodes:6431 nodeName_ = child_.nodeName.split(':')[-1]6432 self.buildChildren(child_, nodeName_)6433 def buildAttributes(self, attrs):6434 pass6435 def buildChildren(self, child_, nodeName_):6436 if child_.nodeType == Node.TEXT_NODE:6437 self.valueOf_ += child_.nodeValue6438 elif child_.nodeType == Node.CDATA_SECTION_NODE:6439 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'6440# end class docVariableListType6441class docRefTextType(GeneratedsSuper):6442 subclass = None6443 superclass = None6444 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):6445 self.refid = refid6446 self.kindref = kindref6447 self.external = external6448 if mixedclass_ is None:6449 self.mixedclass_ = MixedContainer6450 else:6451 self.mixedclass_ = mixedclass_6452 if content_ is None:6453 self.content_ = []6454 else:6455 self.content_ = content_6456 def factory(*args_, **kwargs_):6457 if docRefTextType.subclass:6458 return docRefTextType.subclass(*args_, **kwargs_)6459 else:6460 return docRefTextType(*args_, **kwargs_)6461 factory = staticmethod(factory)6462 def get_refid(self): return self.refid6463 def set_refid(self, refid): self.refid = refid6464 def get_kindref(self): return self.kindref6465 def set_kindref(self, kindref): self.kindref = kindref6466 def get_external(self): return self.external6467 def set_external(self, external): self.external = external6468 def getValueOf_(self): return self.valueOf_6469 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_6470 def export(self, outfile, level, namespace_='', name_='docRefTextType', namespacedef_=''):6471 showIndent(outfile, level)6472 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6473 self.exportAttributes(outfile, level, namespace_, name_='docRefTextType')6474 outfile.write('>')6475 self.exportChildren(outfile, level + 1, namespace_, name_)6476 outfile.write('</%s%s>\n' % (namespace_, name_))6477 def exportAttributes(self, outfile, level, namespace_='', name_='docRefTextType'):6478 if self.refid is not None:6479 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))6480 if self.kindref is not None:6481 outfile.write(' kindref=%s' % (quote_attrib(self.kindref), ))6482 if self.external is not None:6483 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))6484 def exportChildren(self, outfile, level, namespace_='', name_='docRefTextType'):6485 if self.valueOf_.find('![CDATA')>-1:6486 value=quote_xml('%s' % self.valueOf_)6487 value=value.replace('![CDATA','<![CDATA')6488 value=value.replace(']]',']]>')6489 outfile.write(value)6490 else:6491 outfile.write(quote_xml('%s' % self.valueOf_))6492 def hasContent_(self):6493 if (6494 self.valueOf_ is not None6495 ):6496 return True6497 else:6498 return False6499 def exportLiteral(self, outfile, level, name_='docRefTextType'):6500 level += 16501 self.exportLiteralAttributes(outfile, level, name_)6502 if self.hasContent_():6503 self.exportLiteralChildren(outfile, level, name_)6504 def exportLiteralAttributes(self, outfile, level, name_):6505 if self.refid is not None:6506 showIndent(outfile, level)6507 outfile.write('refid = %s,\n' % (self.refid,))6508 if self.kindref is not None:6509 showIndent(outfile, level)6510 outfile.write('kindref = "%s",\n' % (self.kindref,))6511 if self.external is not None:6512 showIndent(outfile, level)6513 outfile.write('external = %s,\n' % (self.external,))6514 def exportLiteralChildren(self, outfile, level, name_):6515 showIndent(outfile, level)6516 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))6517 def build(self, node_):6518 attrs = node_.attributes6519 self.buildAttributes(attrs)6520 self.valueOf_ = ''6521 for child_ in node_.childNodes:6522 nodeName_ = child_.nodeName.split(':')[-1]6523 self.buildChildren(child_, nodeName_)6524 def buildAttributes(self, attrs):6525 if attrs.get('refid'):6526 self.refid = attrs.get('refid').value6527 if attrs.get('kindref'):6528 self.kindref = attrs.get('kindref').value6529 if attrs.get('external'):6530 self.external = attrs.get('external').value6531 def buildChildren(self, child_, nodeName_):6532 if child_.nodeType == Node.TEXT_NODE:6533 obj_ = self.mixedclass_(MixedContainer.CategoryText,6534 MixedContainer.TypeNone, '', child_.nodeValue)6535 self.content_.append(obj_)6536 if child_.nodeType == Node.TEXT_NODE:6537 self.valueOf_ += child_.nodeValue6538 elif child_.nodeType == Node.CDATA_SECTION_NODE:6539 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'6540# end class docRefTextType6541class docTableType(GeneratedsSuper):6542 subclass = None6543 superclass = None6544 def __init__(self, rows=None, cols=None, row=None, caption=None):6545 self.rows = rows6546 self.cols = cols6547 if row is None:6548 self.row = []6549 else:6550 self.row = row6551 self.caption = caption6552 def factory(*args_, **kwargs_):6553 if docTableType.subclass:6554 return docTableType.subclass(*args_, **kwargs_)6555 else:6556 return docTableType(*args_, **kwargs_)6557 factory = staticmethod(factory)6558 def get_row(self): return self.row6559 def set_row(self, row): self.row = row6560 def add_row(self, value): self.row.append(value)6561 def insert_row(self, index, value): self.row[index] = value6562 def get_caption(self): return self.caption6563 def set_caption(self, caption): self.caption = caption6564 def get_rows(self): return self.rows6565 def set_rows(self, rows): self.rows = rows6566 def get_cols(self): return self.cols6567 def set_cols(self, cols): self.cols = cols6568 def export(self, outfile, level, namespace_='', name_='docTableType', namespacedef_=''):6569 showIndent(outfile, level)6570 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6571 self.exportAttributes(outfile, level, namespace_, name_='docTableType')6572 if self.hasContent_():6573 outfile.write('>\n')6574 self.exportChildren(outfile, level + 1, namespace_, name_)6575 showIndent(outfile, level)6576 outfile.write('</%s%s>\n' % (namespace_, name_))6577 else:6578 outfile.write(' />\n')6579 def exportAttributes(self, outfile, level, namespace_='', name_='docTableType'):6580 if self.rows is not None:6581 outfile.write(' rows="%s"' % self.format_integer(self.rows, input_name='rows'))6582 if self.cols is not None:6583 outfile.write(' cols="%s"' % self.format_integer(self.cols, input_name='cols'))6584 def exportChildren(self, outfile, level, namespace_='', name_='docTableType'):6585 for row_ in self.row:6586 row_.export(outfile, level, namespace_, name_='row')6587 if self.caption:6588 self.caption.export(outfile, level, namespace_, name_='caption')6589 def hasContent_(self):6590 if (6591 self.row is not None or6592 self.caption is not None6593 ):6594 return True6595 else:6596 return False6597 def exportLiteral(self, outfile, level, name_='docTableType'):6598 level += 16599 self.exportLiteralAttributes(outfile, level, name_)6600 if self.hasContent_():6601 self.exportLiteralChildren(outfile, level, name_)6602 def exportLiteralAttributes(self, outfile, level, name_):6603 if self.rows is not None:6604 showIndent(outfile, level)6605 outfile.write('rows = %s,\n' % (self.rows,))6606 if self.cols is not None:6607 showIndent(outfile, level)6608 outfile.write('cols = %s,\n' % (self.cols,))6609 def exportLiteralChildren(self, outfile, level, name_):6610 showIndent(outfile, level)6611 outfile.write('row=[\n')6612 level += 16613 for row in self.row:6614 showIndent(outfile, level)6615 outfile.write('model_.row(\n')6616 row.exportLiteral(outfile, level, name_='row')6617 showIndent(outfile, level)6618 outfile.write('),\n')6619 level -= 16620 showIndent(outfile, level)6621 outfile.write('],\n')6622 if self.caption:6623 showIndent(outfile, level)6624 outfile.write('caption=model_.docCaptionType(\n')6625 self.caption.exportLiteral(outfile, level, name_='caption')6626 showIndent(outfile, level)6627 outfile.write('),\n')6628 def build(self, node_):6629 attrs = node_.attributes6630 self.buildAttributes(attrs)6631 for child_ in node_.childNodes:6632 nodeName_ = child_.nodeName.split(':')[-1]6633 self.buildChildren(child_, nodeName_)6634 def buildAttributes(self, attrs):6635 if attrs.get('rows'):6636 try:6637 self.rows = int(attrs.get('rows').value)6638 except ValueError, exp:6639 raise ValueError('Bad integer attribute (rows): %s' % exp)6640 if attrs.get('cols'):6641 try:6642 self.cols = int(attrs.get('cols').value)6643 except ValueError, exp:6644 raise ValueError('Bad integer attribute (cols): %s' % exp)6645 def buildChildren(self, child_, nodeName_):6646 if child_.nodeType == Node.ELEMENT_NODE and \6647 nodeName_ == 'row':6648 obj_ = docRowType.factory()6649 obj_.build(child_)6650 self.row.append(obj_)6651 elif child_.nodeType == Node.ELEMENT_NODE and \6652 nodeName_ == 'caption':6653 obj_ = docCaptionType.factory()6654 obj_.build(child_)6655 self.set_caption(obj_)6656# end class docTableType6657class docRowType(GeneratedsSuper):6658 subclass = None6659 superclass = None6660 def __init__(self, entry=None):6661 if entry is None:6662 self.entry = []6663 else:6664 self.entry = entry6665 def factory(*args_, **kwargs_):6666 if docRowType.subclass:6667 return docRowType.subclass(*args_, **kwargs_)6668 else:6669 return docRowType(*args_, **kwargs_)6670 factory = staticmethod(factory)6671 def get_entry(self): return self.entry6672 def set_entry(self, entry): self.entry = entry6673 def add_entry(self, value): self.entry.append(value)6674 def insert_entry(self, index, value): self.entry[index] = value6675 def export(self, outfile, level, namespace_='', name_='docRowType', namespacedef_=''):6676 showIndent(outfile, level)6677 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6678 self.exportAttributes(outfile, level, namespace_, name_='docRowType')6679 if self.hasContent_():6680 outfile.write('>\n')6681 self.exportChildren(outfile, level + 1, namespace_, name_)6682 showIndent(outfile, level)6683 outfile.write('</%s%s>\n' % (namespace_, name_))6684 else:6685 outfile.write(' />\n')6686 def exportAttributes(self, outfile, level, namespace_='', name_='docRowType'):6687 pass6688 def exportChildren(self, outfile, level, namespace_='', name_='docRowType'):6689 for entry_ in self.entry:6690 entry_.export(outfile, level, namespace_, name_='entry')6691 def hasContent_(self):6692 if (6693 self.entry is not None6694 ):6695 return True6696 else:6697 return False6698 def exportLiteral(self, outfile, level, name_='docRowType'):6699 level += 16700 self.exportLiteralAttributes(outfile, level, name_)6701 if self.hasContent_():6702 self.exportLiteralChildren(outfile, level, name_)6703 def exportLiteralAttributes(self, outfile, level, name_):6704 pass6705 def exportLiteralChildren(self, outfile, level, name_):6706 showIndent(outfile, level)6707 outfile.write('entry=[\n')6708 level += 16709 for entry in self.entry:6710 showIndent(outfile, level)6711 outfile.write('model_.entry(\n')6712 entry.exportLiteral(outfile, level, name_='entry')6713 showIndent(outfile, level)6714 outfile.write('),\n')6715 level -= 16716 showIndent(outfile, level)6717 outfile.write('],\n')6718 def build(self, node_):6719 attrs = node_.attributes6720 self.buildAttributes(attrs)6721 for child_ in node_.childNodes:6722 nodeName_ = child_.nodeName.split(':')[-1]6723 self.buildChildren(child_, nodeName_)6724 def buildAttributes(self, attrs):6725 pass6726 def buildChildren(self, child_, nodeName_):6727 if child_.nodeType == Node.ELEMENT_NODE and \6728 nodeName_ == 'entry':6729 obj_ = docEntryType.factory()6730 obj_.build(child_)6731 self.entry.append(obj_)6732# end class docRowType6733class docEntryType(GeneratedsSuper):6734 subclass = None6735 superclass = None6736 def __init__(self, thead=None, para=None):6737 self.thead = thead6738 if para is None:6739 self.para = []6740 else:6741 self.para = para6742 def factory(*args_, **kwargs_):6743 if docEntryType.subclass:6744 return docEntryType.subclass(*args_, **kwargs_)6745 else:6746 return docEntryType(*args_, **kwargs_)6747 factory = staticmethod(factory)6748 def get_para(self): return self.para6749 def set_para(self, para): self.para = para6750 def add_para(self, value): self.para.append(value)6751 def insert_para(self, index, value): self.para[index] = value6752 def get_thead(self): return self.thead6753 def set_thead(self, thead): self.thead = thead6754 def export(self, outfile, level, namespace_='', name_='docEntryType', namespacedef_=''):6755 showIndent(outfile, level)6756 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6757 self.exportAttributes(outfile, level, namespace_, name_='docEntryType')6758 if self.hasContent_():6759 outfile.write('>\n')6760 self.exportChildren(outfile, level + 1, namespace_, name_)6761 showIndent(outfile, level)6762 outfile.write('</%s%s>\n' % (namespace_, name_))6763 else:6764 outfile.write(' />\n')6765 def exportAttributes(self, outfile, level, namespace_='', name_='docEntryType'):6766 if self.thead is not None:6767 outfile.write(' thead=%s' % (quote_attrib(self.thead), ))6768 def exportChildren(self, outfile, level, namespace_='', name_='docEntryType'):6769 for para_ in self.para:6770 para_.export(outfile, level, namespace_, name_='para')6771 def hasContent_(self):6772 if (6773 self.para is not None6774 ):6775 return True6776 else:6777 return False6778 def exportLiteral(self, outfile, level, name_='docEntryType'):6779 level += 16780 self.exportLiteralAttributes(outfile, level, name_)6781 if self.hasContent_():6782 self.exportLiteralChildren(outfile, level, name_)6783 def exportLiteralAttributes(self, outfile, level, name_):6784 if self.thead is not None:6785 showIndent(outfile, level)6786 outfile.write('thead = "%s",\n' % (self.thead,))6787 def exportLiteralChildren(self, outfile, level, name_):6788 showIndent(outfile, level)6789 outfile.write('para=[\n')6790 level += 16791 for para in self.para:6792 showIndent(outfile, level)6793 outfile.write('model_.para(\n')6794 para.exportLiteral(outfile, level, name_='para')6795 showIndent(outfile, level)6796 outfile.write('),\n')6797 level -= 16798 showIndent(outfile, level)6799 outfile.write('],\n')6800 def build(self, node_):6801 attrs = node_.attributes6802 self.buildAttributes(attrs)6803 for child_ in node_.childNodes:6804 nodeName_ = child_.nodeName.split(':')[-1]6805 self.buildChildren(child_, nodeName_)6806 def buildAttributes(self, attrs):6807 if attrs.get('thead'):6808 self.thead = attrs.get('thead').value6809 def buildChildren(self, child_, nodeName_):6810 if child_.nodeType == Node.ELEMENT_NODE and \6811 nodeName_ == 'para':6812 obj_ = docParaType.factory()6813 obj_.build(child_)6814 self.para.append(obj_)6815# end class docEntryType6816class docCaptionType(GeneratedsSuper):6817 subclass = None6818 superclass = None6819 def __init__(self, valueOf_='', mixedclass_=None, content_=None):6820 if mixedclass_ is None:6821 self.mixedclass_ = MixedContainer6822 else:6823 self.mixedclass_ = mixedclass_6824 if content_ is None:6825 self.content_ = []6826 else:6827 self.content_ = content_6828 def factory(*args_, **kwargs_):6829 if docCaptionType.subclass:6830 return docCaptionType.subclass(*args_, **kwargs_)6831 else:6832 return docCaptionType(*args_, **kwargs_)6833 factory = staticmethod(factory)6834 def getValueOf_(self): return self.valueOf_6835 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_6836 def export(self, outfile, level, namespace_='', name_='docCaptionType', namespacedef_=''):6837 showIndent(outfile, level)6838 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6839 self.exportAttributes(outfile, level, namespace_, name_='docCaptionType')6840 outfile.write('>')6841 self.exportChildren(outfile, level + 1, namespace_, name_)6842 outfile.write('</%s%s>\n' % (namespace_, name_))6843 def exportAttributes(self, outfile, level, namespace_='', name_='docCaptionType'):6844 pass6845 def exportChildren(self, outfile, level, namespace_='', name_='docCaptionType'):6846 if self.valueOf_.find('![CDATA')>-1:6847 value=quote_xml('%s' % self.valueOf_)6848 value=value.replace('![CDATA','<![CDATA')6849 value=value.replace(']]',']]>')6850 outfile.write(value)6851 else:6852 outfile.write(quote_xml('%s' % self.valueOf_))6853 def hasContent_(self):6854 if (6855 self.valueOf_ is not None6856 ):6857 return True6858 else:6859 return False6860 def exportLiteral(self, outfile, level, name_='docCaptionType'):6861 level += 16862 self.exportLiteralAttributes(outfile, level, name_)6863 if self.hasContent_():6864 self.exportLiteralChildren(outfile, level, name_)6865 def exportLiteralAttributes(self, outfile, level, name_):6866 pass6867 def exportLiteralChildren(self, outfile, level, name_):6868 showIndent(outfile, level)6869 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))6870 def build(self, node_):6871 attrs = node_.attributes6872 self.buildAttributes(attrs)6873 self.valueOf_ = ''6874 for child_ in node_.childNodes:6875 nodeName_ = child_.nodeName.split(':')[-1]6876 self.buildChildren(child_, nodeName_)6877 def buildAttributes(self, attrs):6878 pass6879 def buildChildren(self, child_, nodeName_):6880 if child_.nodeType == Node.TEXT_NODE:6881 obj_ = self.mixedclass_(MixedContainer.CategoryText,6882 MixedContainer.TypeNone, '', child_.nodeValue)6883 self.content_.append(obj_)6884 if child_.nodeType == Node.TEXT_NODE:6885 self.valueOf_ += child_.nodeValue6886 elif child_.nodeType == Node.CDATA_SECTION_NODE:6887 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'6888# end class docCaptionType6889class docHeadingType(GeneratedsSuper):6890 subclass = None6891 superclass = None6892 def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None):6893 self.level = level6894 if mixedclass_ is None:6895 self.mixedclass_ = MixedContainer6896 else:6897 self.mixedclass_ = mixedclass_6898 if content_ is None:6899 self.content_ = []6900 else:6901 self.content_ = content_6902 def factory(*args_, **kwargs_):6903 if docHeadingType.subclass:6904 return docHeadingType.subclass(*args_, **kwargs_)6905 else:6906 return docHeadingType(*args_, **kwargs_)6907 factory = staticmethod(factory)6908 def get_level(self): return self.level6909 def set_level(self, level): self.level = level6910 def getValueOf_(self): return self.valueOf_6911 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_6912 def export(self, outfile, level, namespace_='', name_='docHeadingType', namespacedef_=''):6913 showIndent(outfile, level)6914 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))6915 self.exportAttributes(outfile, level, namespace_, name_='docHeadingType')6916 outfile.write('>')6917 self.exportChildren(outfile, level + 1, namespace_, name_)6918 outfile.write('</%s%s>\n' % (namespace_, name_))6919 def exportAttributes(self, outfile, level, namespace_='', name_='docHeadingType'):6920 if self.level is not None:6921 outfile.write(' level="%s"' % self.format_integer(self.level, input_name='level'))6922 def exportChildren(self, outfile, level, namespace_='', name_='docHeadingType'):6923 if self.valueOf_.find('![CDATA')>-1:6924 value=quote_xml('%s' % self.valueOf_)6925 value=value.replace('![CDATA','<![CDATA')6926 value=value.replace(']]',']]>')6927 outfile.write(value)6928 else:6929 outfile.write(quote_xml('%s' % self.valueOf_))6930 def hasContent_(self):6931 if (6932 self.valueOf_ is not None6933 ):6934 return True6935 else:6936 return False6937 def exportLiteral(self, outfile, level, name_='docHeadingType'):6938 level += 16939 self.exportLiteralAttributes(outfile, level, name_)6940 if self.hasContent_():6941 self.exportLiteralChildren(outfile, level, name_)6942 def exportLiteralAttributes(self, outfile, level, name_):6943 if self.level is not None:6944 showIndent(outfile, level)6945 outfile.write('level = %s,\n' % (self.level,))6946 def exportLiteralChildren(self, outfile, level, name_):6947 showIndent(outfile, level)6948 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))6949 def build(self, node_):6950 attrs = node_.attributes6951 self.buildAttributes(attrs)6952 self.valueOf_ = ''6953 for child_ in node_.childNodes:6954 nodeName_ = child_.nodeName.split(':')[-1]6955 self.buildChildren(child_, nodeName_)6956 def buildAttributes(self, attrs):6957 if attrs.get('level'):6958 try:6959 self.level = int(attrs.get('level').value)6960 except ValueError, exp:6961 raise ValueError('Bad integer attribute (level): %s' % exp)6962 def buildChildren(self, child_, nodeName_):6963 if child_.nodeType == Node.TEXT_NODE:6964 obj_ = self.mixedclass_(MixedContainer.CategoryText,6965 MixedContainer.TypeNone, '', child_.nodeValue)6966 self.content_.append(obj_)6967 if child_.nodeType == Node.TEXT_NODE:6968 self.valueOf_ += child_.nodeValue6969 elif child_.nodeType == Node.CDATA_SECTION_NODE:6970 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'6971# end class docHeadingType6972class docImageType(GeneratedsSuper):6973 subclass = None6974 superclass = None6975 def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None):6976 self.width = width6977 self.type_ = type_6978 self.name = name6979 self.height = height6980 if mixedclass_ is None:6981 self.mixedclass_ = MixedContainer6982 else:6983 self.mixedclass_ = mixedclass_6984 if content_ is None:6985 self.content_ = []6986 else:6987 self.content_ = content_6988 def factory(*args_, **kwargs_):6989 if docImageType.subclass:6990 return docImageType.subclass(*args_, **kwargs_)6991 else:6992 return docImageType(*args_, **kwargs_)6993 factory = staticmethod(factory)6994 def get_width(self): return self.width6995 def set_width(self, width): self.width = width6996 def get_type(self): return self.type_6997 def set_type(self, type_): self.type_ = type_6998 def get_name(self): return self.name6999 def set_name(self, name): self.name = name7000 def get_height(self): return self.height7001 def set_height(self, height): self.height = height7002 def getValueOf_(self): return self.valueOf_7003 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_7004 def export(self, outfile, level, namespace_='', name_='docImageType', namespacedef_=''):7005 showIndent(outfile, level)7006 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7007 self.exportAttributes(outfile, level, namespace_, name_='docImageType')7008 outfile.write('>')7009 self.exportChildren(outfile, level + 1, namespace_, name_)7010 outfile.write('</%s%s>\n' % (namespace_, name_))7011 def exportAttributes(self, outfile, level, namespace_='', name_='docImageType'):7012 if self.width is not None:7013 outfile.write(' width=%s' % (self.format_string(quote_attrib(self.width).encode(ExternalEncoding), input_name='width'), ))7014 if self.type_ is not None:7015 outfile.write(' type=%s' % (quote_attrib(self.type_), ))7016 if self.name is not None:7017 outfile.write(' name=%s' % (self.format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))7018 if self.height is not None:7019 outfile.write(' height=%s' % (self.format_string(quote_attrib(self.height).encode(ExternalEncoding), input_name='height'), ))7020 def exportChildren(self, outfile, level, namespace_='', name_='docImageType'):7021 if self.valueOf_.find('![CDATA')>-1:7022 value=quote_xml('%s' % self.valueOf_)7023 value=value.replace('![CDATA','<![CDATA')7024 value=value.replace(']]',']]>')7025 outfile.write(value)7026 else:7027 outfile.write(quote_xml('%s' % self.valueOf_))7028 def hasContent_(self):7029 if (7030 self.valueOf_ is not None7031 ):7032 return True7033 else:7034 return False7035 def exportLiteral(self, outfile, level, name_='docImageType'):7036 level += 17037 self.exportLiteralAttributes(outfile, level, name_)7038 if self.hasContent_():7039 self.exportLiteralChildren(outfile, level, name_)7040 def exportLiteralAttributes(self, outfile, level, name_):7041 if self.width is not None:7042 showIndent(outfile, level)7043 outfile.write('width = %s,\n' % (self.width,))7044 if self.type_ is not None:7045 showIndent(outfile, level)7046 outfile.write('type_ = "%s",\n' % (self.type_,))7047 if self.name is not None:7048 showIndent(outfile, level)7049 outfile.write('name = %s,\n' % (self.name,))7050 if self.height is not None:7051 showIndent(outfile, level)7052 outfile.write('height = %s,\n' % (self.height,))7053 def exportLiteralChildren(self, outfile, level, name_):7054 showIndent(outfile, level)7055 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))7056 def build(self, node_):7057 attrs = node_.attributes7058 self.buildAttributes(attrs)7059 self.valueOf_ = ''7060 for child_ in node_.childNodes:7061 nodeName_ = child_.nodeName.split(':')[-1]7062 self.buildChildren(child_, nodeName_)7063 def buildAttributes(self, attrs):7064 if attrs.get('width'):7065 self.width = attrs.get('width').value7066 if attrs.get('type'):7067 self.type_ = attrs.get('type').value7068 if attrs.get('name'):7069 self.name = attrs.get('name').value7070 if attrs.get('height'):7071 self.height = attrs.get('height').value7072 def buildChildren(self, child_, nodeName_):7073 if child_.nodeType == Node.TEXT_NODE:7074 obj_ = self.mixedclass_(MixedContainer.CategoryText,7075 MixedContainer.TypeNone, '', child_.nodeValue)7076 self.content_.append(obj_)7077 if child_.nodeType == Node.TEXT_NODE:7078 self.valueOf_ += child_.nodeValue7079 elif child_.nodeType == Node.CDATA_SECTION_NODE:7080 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'7081# end class docImageType7082class docDotFileType(GeneratedsSuper):7083 subclass = None7084 superclass = None7085 def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None):7086 self.name = name7087 if mixedclass_ is None:7088 self.mixedclass_ = MixedContainer7089 else:7090 self.mixedclass_ = mixedclass_7091 if content_ is None:7092 self.content_ = []7093 else:7094 self.content_ = content_7095 def factory(*args_, **kwargs_):7096 if docDotFileType.subclass:7097 return docDotFileType.subclass(*args_, **kwargs_)7098 else:7099 return docDotFileType(*args_, **kwargs_)7100 factory = staticmethod(factory)7101 def get_name(self): return self.name7102 def set_name(self, name): self.name = name7103 def getValueOf_(self): return self.valueOf_7104 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_7105 def export(self, outfile, level, namespace_='', name_='docDotFileType', namespacedef_=''):7106 showIndent(outfile, level)7107 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7108 self.exportAttributes(outfile, level, namespace_, name_='docDotFileType')7109 outfile.write('>')7110 self.exportChildren(outfile, level + 1, namespace_, name_)7111 outfile.write('</%s%s>\n' % (namespace_, name_))7112 def exportAttributes(self, outfile, level, namespace_='', name_='docDotFileType'):7113 if self.name is not None:7114 outfile.write(' name=%s' % (self.format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))7115 def exportChildren(self, outfile, level, namespace_='', name_='docDotFileType'):7116 if self.valueOf_.find('![CDATA')>-1:7117 value=quote_xml('%s' % self.valueOf_)7118 value=value.replace('![CDATA','<![CDATA')7119 value=value.replace(']]',']]>')7120 outfile.write(value)7121 else:7122 outfile.write(quote_xml('%s' % self.valueOf_))7123 def hasContent_(self):7124 if (7125 self.valueOf_ is not None7126 ):7127 return True7128 else:7129 return False7130 def exportLiteral(self, outfile, level, name_='docDotFileType'):7131 level += 17132 self.exportLiteralAttributes(outfile, level, name_)7133 if self.hasContent_():7134 self.exportLiteralChildren(outfile, level, name_)7135 def exportLiteralAttributes(self, outfile, level, name_):7136 if self.name is not None:7137 showIndent(outfile, level)7138 outfile.write('name = %s,\n' % (self.name,))7139 def exportLiteralChildren(self, outfile, level, name_):7140 showIndent(outfile, level)7141 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))7142 def build(self, node_):7143 attrs = node_.attributes7144 self.buildAttributes(attrs)7145 self.valueOf_ = ''7146 for child_ in node_.childNodes:7147 nodeName_ = child_.nodeName.split(':')[-1]7148 self.buildChildren(child_, nodeName_)7149 def buildAttributes(self, attrs):7150 if attrs.get('name'):7151 self.name = attrs.get('name').value7152 def buildChildren(self, child_, nodeName_):7153 if child_.nodeType == Node.TEXT_NODE:7154 obj_ = self.mixedclass_(MixedContainer.CategoryText,7155 MixedContainer.TypeNone, '', child_.nodeValue)7156 self.content_.append(obj_)7157 if child_.nodeType == Node.TEXT_NODE:7158 self.valueOf_ += child_.nodeValue7159 elif child_.nodeType == Node.CDATA_SECTION_NODE:7160 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'7161# end class docDotFileType7162class docTocItemType(GeneratedsSuper):7163 subclass = None7164 superclass = None7165 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):7166 self.id = id7167 if mixedclass_ is None:7168 self.mixedclass_ = MixedContainer7169 else:7170 self.mixedclass_ = mixedclass_7171 if content_ is None:7172 self.content_ = []7173 else:7174 self.content_ = content_7175 def factory(*args_, **kwargs_):7176 if docTocItemType.subclass:7177 return docTocItemType.subclass(*args_, **kwargs_)7178 else:7179 return docTocItemType(*args_, **kwargs_)7180 factory = staticmethod(factory)7181 def get_id(self): return self.id7182 def set_id(self, id): self.id = id7183 def getValueOf_(self): return self.valueOf_7184 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_7185 def export(self, outfile, level, namespace_='', name_='docTocItemType', namespacedef_=''):7186 showIndent(outfile, level)7187 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7188 self.exportAttributes(outfile, level, namespace_, name_='docTocItemType')7189 outfile.write('>')7190 self.exportChildren(outfile, level + 1, namespace_, name_)7191 outfile.write('</%s%s>\n' % (namespace_, name_))7192 def exportAttributes(self, outfile, level, namespace_='', name_='docTocItemType'):7193 if self.id is not None:7194 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))7195 def exportChildren(self, outfile, level, namespace_='', name_='docTocItemType'):7196 if self.valueOf_.find('![CDATA')>-1:7197 value=quote_xml('%s' % self.valueOf_)7198 value=value.replace('![CDATA','<![CDATA')7199 value=value.replace(']]',']]>')7200 outfile.write(value)7201 else:7202 outfile.write(quote_xml('%s' % self.valueOf_))7203 def hasContent_(self):7204 if (7205 self.valueOf_ is not None7206 ):7207 return True7208 else:7209 return False7210 def exportLiteral(self, outfile, level, name_='docTocItemType'):7211 level += 17212 self.exportLiteralAttributes(outfile, level, name_)7213 if self.hasContent_():7214 self.exportLiteralChildren(outfile, level, name_)7215 def exportLiteralAttributes(self, outfile, level, name_):7216 if self.id is not None:7217 showIndent(outfile, level)7218 outfile.write('id = %s,\n' % (self.id,))7219 def exportLiteralChildren(self, outfile, level, name_):7220 showIndent(outfile, level)7221 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))7222 def build(self, node_):7223 attrs = node_.attributes7224 self.buildAttributes(attrs)7225 self.valueOf_ = ''7226 for child_ in node_.childNodes:7227 nodeName_ = child_.nodeName.split(':')[-1]7228 self.buildChildren(child_, nodeName_)7229 def buildAttributes(self, attrs):7230 if attrs.get('id'):7231 self.id = attrs.get('id').value7232 def buildChildren(self, child_, nodeName_):7233 if child_.nodeType == Node.TEXT_NODE:7234 obj_ = self.mixedclass_(MixedContainer.CategoryText,7235 MixedContainer.TypeNone, '', child_.nodeValue)7236 self.content_.append(obj_)7237 if child_.nodeType == Node.TEXT_NODE:7238 self.valueOf_ += child_.nodeValue7239 elif child_.nodeType == Node.CDATA_SECTION_NODE:7240 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'7241# end class docTocItemType7242class docTocListType(GeneratedsSuper):7243 subclass = None7244 superclass = None7245 def __init__(self, tocitem=None):7246 if tocitem is None:7247 self.tocitem = []7248 else:7249 self.tocitem = tocitem7250 def factory(*args_, **kwargs_):7251 if docTocListType.subclass:7252 return docTocListType.subclass(*args_, **kwargs_)7253 else:7254 return docTocListType(*args_, **kwargs_)7255 factory = staticmethod(factory)7256 def get_tocitem(self): return self.tocitem7257 def set_tocitem(self, tocitem): self.tocitem = tocitem7258 def add_tocitem(self, value): self.tocitem.append(value)7259 def insert_tocitem(self, index, value): self.tocitem[index] = value7260 def export(self, outfile, level, namespace_='', name_='docTocListType', namespacedef_=''):7261 showIndent(outfile, level)7262 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7263 self.exportAttributes(outfile, level, namespace_, name_='docTocListType')7264 if self.hasContent_():7265 outfile.write('>\n')7266 self.exportChildren(outfile, level + 1, namespace_, name_)7267 showIndent(outfile, level)7268 outfile.write('</%s%s>\n' % (namespace_, name_))7269 else:7270 outfile.write(' />\n')7271 def exportAttributes(self, outfile, level, namespace_='', name_='docTocListType'):7272 pass7273 def exportChildren(self, outfile, level, namespace_='', name_='docTocListType'):7274 for tocitem_ in self.tocitem:7275 tocitem_.export(outfile, level, namespace_, name_='tocitem')7276 def hasContent_(self):7277 if (7278 self.tocitem is not None7279 ):7280 return True7281 else:7282 return False7283 def exportLiteral(self, outfile, level, name_='docTocListType'):7284 level += 17285 self.exportLiteralAttributes(outfile, level, name_)7286 if self.hasContent_():7287 self.exportLiteralChildren(outfile, level, name_)7288 def exportLiteralAttributes(self, outfile, level, name_):7289 pass7290 def exportLiteralChildren(self, outfile, level, name_):7291 showIndent(outfile, level)7292 outfile.write('tocitem=[\n')7293 level += 17294 for tocitem in self.tocitem:7295 showIndent(outfile, level)7296 outfile.write('model_.tocitem(\n')7297 tocitem.exportLiteral(outfile, level, name_='tocitem')7298 showIndent(outfile, level)7299 outfile.write('),\n')7300 level -= 17301 showIndent(outfile, level)7302 outfile.write('],\n')7303 def build(self, node_):7304 attrs = node_.attributes7305 self.buildAttributes(attrs)7306 for child_ in node_.childNodes:7307 nodeName_ = child_.nodeName.split(':')[-1]7308 self.buildChildren(child_, nodeName_)7309 def buildAttributes(self, attrs):7310 pass7311 def buildChildren(self, child_, nodeName_):7312 if child_.nodeType == Node.ELEMENT_NODE and \7313 nodeName_ == 'tocitem':7314 obj_ = docTocItemType.factory()7315 obj_.build(child_)7316 self.tocitem.append(obj_)7317# end class docTocListType7318class docLanguageType(GeneratedsSuper):7319 subclass = None7320 superclass = None7321 def __init__(self, langid=None, para=None):7322 self.langid = langid7323 if para is None:7324 self.para = []7325 else:7326 self.para = para7327 def factory(*args_, **kwargs_):7328 if docLanguageType.subclass:7329 return docLanguageType.subclass(*args_, **kwargs_)7330 else:7331 return docLanguageType(*args_, **kwargs_)7332 factory = staticmethod(factory)7333 def get_para(self): return self.para7334 def set_para(self, para): self.para = para7335 def add_para(self, value): self.para.append(value)7336 def insert_para(self, index, value): self.para[index] = value7337 def get_langid(self): return self.langid7338 def set_langid(self, langid): self.langid = langid7339 def export(self, outfile, level, namespace_='', name_='docLanguageType', namespacedef_=''):7340 showIndent(outfile, level)7341 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7342 self.exportAttributes(outfile, level, namespace_, name_='docLanguageType')7343 if self.hasContent_():7344 outfile.write('>\n')7345 self.exportChildren(outfile, level + 1, namespace_, name_)7346 showIndent(outfile, level)7347 outfile.write('</%s%s>\n' % (namespace_, name_))7348 else:7349 outfile.write(' />\n')7350 def exportAttributes(self, outfile, level, namespace_='', name_='docLanguageType'):7351 if self.langid is not None:7352 outfile.write(' langid=%s' % (self.format_string(quote_attrib(self.langid).encode(ExternalEncoding), input_name='langid'), ))7353 def exportChildren(self, outfile, level, namespace_='', name_='docLanguageType'):7354 for para_ in self.para:7355 para_.export(outfile, level, namespace_, name_='para')7356 def hasContent_(self):7357 if (7358 self.para is not None7359 ):7360 return True7361 else:7362 return False7363 def exportLiteral(self, outfile, level, name_='docLanguageType'):7364 level += 17365 self.exportLiteralAttributes(outfile, level, name_)7366 if self.hasContent_():7367 self.exportLiteralChildren(outfile, level, name_)7368 def exportLiteralAttributes(self, outfile, level, name_):7369 if self.langid is not None:7370 showIndent(outfile, level)7371 outfile.write('langid = %s,\n' % (self.langid,))7372 def exportLiteralChildren(self, outfile, level, name_):7373 showIndent(outfile, level)7374 outfile.write('para=[\n')7375 level += 17376 for para in self.para:7377 showIndent(outfile, level)7378 outfile.write('model_.para(\n')7379 para.exportLiteral(outfile, level, name_='para')7380 showIndent(outfile, level)7381 outfile.write('),\n')7382 level -= 17383 showIndent(outfile, level)7384 outfile.write('],\n')7385 def build(self, node_):7386 attrs = node_.attributes7387 self.buildAttributes(attrs)7388 for child_ in node_.childNodes:7389 nodeName_ = child_.nodeName.split(':')[-1]7390 self.buildChildren(child_, nodeName_)7391 def buildAttributes(self, attrs):7392 if attrs.get('langid'):7393 self.langid = attrs.get('langid').value7394 def buildChildren(self, child_, nodeName_):7395 if child_.nodeType == Node.ELEMENT_NODE and \7396 nodeName_ == 'para':7397 obj_ = docParaType.factory()7398 obj_.build(child_)7399 self.para.append(obj_)7400# end class docLanguageType7401class docParamListType(GeneratedsSuper):7402 subclass = None7403 superclass = None7404 def __init__(self, kind=None, parameteritem=None):7405 self.kind = kind7406 if parameteritem is None:7407 self.parameteritem = []7408 else:7409 self.parameteritem = parameteritem7410 def factory(*args_, **kwargs_):7411 if docParamListType.subclass:7412 return docParamListType.subclass(*args_, **kwargs_)7413 else:7414 return docParamListType(*args_, **kwargs_)7415 factory = staticmethod(factory)7416 def get_parameteritem(self): return self.parameteritem7417 def set_parameteritem(self, parameteritem): self.parameteritem = parameteritem7418 def add_parameteritem(self, value): self.parameteritem.append(value)7419 def insert_parameteritem(self, index, value): self.parameteritem[index] = value7420 def get_kind(self): return self.kind7421 def set_kind(self, kind): self.kind = kind7422 def export(self, outfile, level, namespace_='', name_='docParamListType', namespacedef_=''):7423 showIndent(outfile, level)7424 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7425 self.exportAttributes(outfile, level, namespace_, name_='docParamListType')7426 if self.hasContent_():7427 outfile.write('>\n')7428 self.exportChildren(outfile, level + 1, namespace_, name_)7429 showIndent(outfile, level)7430 outfile.write('</%s%s>\n' % (namespace_, name_))7431 else:7432 outfile.write(' />\n')7433 def exportAttributes(self, outfile, level, namespace_='', name_='docParamListType'):7434 if self.kind is not None:7435 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))7436 def exportChildren(self, outfile, level, namespace_='', name_='docParamListType'):7437 for parameteritem_ in self.parameteritem:7438 parameteritem_.export(outfile, level, namespace_, name_='parameteritem')7439 def hasContent_(self):7440 if (7441 self.parameteritem is not None7442 ):7443 return True7444 else:7445 return False7446 def exportLiteral(self, outfile, level, name_='docParamListType'):7447 level += 17448 self.exportLiteralAttributes(outfile, level, name_)7449 if self.hasContent_():7450 self.exportLiteralChildren(outfile, level, name_)7451 def exportLiteralAttributes(self, outfile, level, name_):7452 if self.kind is not None:7453 showIndent(outfile, level)7454 outfile.write('kind = "%s",\n' % (self.kind,))7455 def exportLiteralChildren(self, outfile, level, name_):7456 showIndent(outfile, level)7457 outfile.write('parameteritem=[\n')7458 level += 17459 for parameteritem in self.parameteritem:7460 showIndent(outfile, level)7461 outfile.write('model_.parameteritem(\n')7462 parameteritem.exportLiteral(outfile, level, name_='parameteritem')7463 showIndent(outfile, level)7464 outfile.write('),\n')7465 level -= 17466 showIndent(outfile, level)7467 outfile.write('],\n')7468 def build(self, node_):7469 attrs = node_.attributes7470 self.buildAttributes(attrs)7471 for child_ in node_.childNodes:7472 nodeName_ = child_.nodeName.split(':')[-1]7473 self.buildChildren(child_, nodeName_)7474 def buildAttributes(self, attrs):7475 if attrs.get('kind'):7476 self.kind = attrs.get('kind').value7477 def buildChildren(self, child_, nodeName_):7478 if child_.nodeType == Node.ELEMENT_NODE and \7479 nodeName_ == 'parameteritem':7480 obj_ = docParamListItem.factory()7481 obj_.build(child_)7482 self.parameteritem.append(obj_)7483# end class docParamListType7484class docParamListItem(GeneratedsSuper):7485 subclass = None7486 superclass = None7487 def __init__(self, parameternamelist=None, parameterdescription=None):7488 if parameternamelist is None:7489 self.parameternamelist = []7490 else:7491 self.parameternamelist = parameternamelist7492 self.parameterdescription = parameterdescription7493 def factory(*args_, **kwargs_):7494 if docParamListItem.subclass:7495 return docParamListItem.subclass(*args_, **kwargs_)7496 else:7497 return docParamListItem(*args_, **kwargs_)7498 factory = staticmethod(factory)7499 def get_parameternamelist(self): return self.parameternamelist7500 def set_parameternamelist(self, parameternamelist): self.parameternamelist = parameternamelist7501 def add_parameternamelist(self, value): self.parameternamelist.append(value)7502 def insert_parameternamelist(self, index, value): self.parameternamelist[index] = value7503 def get_parameterdescription(self): return self.parameterdescription7504 def set_parameterdescription(self, parameterdescription): self.parameterdescription = parameterdescription7505 def export(self, outfile, level, namespace_='', name_='docParamListItem', namespacedef_=''):7506 showIndent(outfile, level)7507 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7508 self.exportAttributes(outfile, level, namespace_, name_='docParamListItem')7509 if self.hasContent_():7510 outfile.write('>\n')7511 self.exportChildren(outfile, level + 1, namespace_, name_)7512 showIndent(outfile, level)7513 outfile.write('</%s%s>\n' % (namespace_, name_))7514 else:7515 outfile.write(' />\n')7516 def exportAttributes(self, outfile, level, namespace_='', name_='docParamListItem'):7517 pass7518 def exportChildren(self, outfile, level, namespace_='', name_='docParamListItem'):7519 for parameternamelist_ in self.parameternamelist:7520 parameternamelist_.export(outfile, level, namespace_, name_='parameternamelist')7521 if self.parameterdescription:7522 self.parameterdescription.export(outfile, level, namespace_, name_='parameterdescription', )7523 def hasContent_(self):7524 if (7525 self.parameternamelist is not None or7526 self.parameterdescription is not None7527 ):7528 return True7529 else:7530 return False7531 def exportLiteral(self, outfile, level, name_='docParamListItem'):7532 level += 17533 self.exportLiteralAttributes(outfile, level, name_)7534 if self.hasContent_():7535 self.exportLiteralChildren(outfile, level, name_)7536 def exportLiteralAttributes(self, outfile, level, name_):7537 pass7538 def exportLiteralChildren(self, outfile, level, name_):7539 showIndent(outfile, level)7540 outfile.write('parameternamelist=[\n')7541 level += 17542 for parameternamelist in self.parameternamelist:7543 showIndent(outfile, level)7544 outfile.write('model_.parameternamelist(\n')7545 parameternamelist.exportLiteral(outfile, level, name_='parameternamelist')7546 showIndent(outfile, level)7547 outfile.write('),\n')7548 level -= 17549 showIndent(outfile, level)7550 outfile.write('],\n')7551 if self.parameterdescription:7552 showIndent(outfile, level)7553 outfile.write('parameterdescription=model_.descriptionType(\n')7554 self.parameterdescription.exportLiteral(outfile, level, name_='parameterdescription')7555 showIndent(outfile, level)7556 outfile.write('),\n')7557 def build(self, node_):7558 attrs = node_.attributes7559 self.buildAttributes(attrs)7560 for child_ in node_.childNodes:7561 nodeName_ = child_.nodeName.split(':')[-1]7562 self.buildChildren(child_, nodeName_)7563 def buildAttributes(self, attrs):7564 pass7565 def buildChildren(self, child_, nodeName_):7566 if child_.nodeType == Node.ELEMENT_NODE and \7567 nodeName_ == 'parameternamelist':7568 obj_ = docParamNameList.factory()7569 obj_.build(child_)7570 self.parameternamelist.append(obj_)7571 elif child_.nodeType == Node.ELEMENT_NODE and \7572 nodeName_ == 'parameterdescription':7573 obj_ = descriptionType.factory()7574 obj_.build(child_)7575 self.set_parameterdescription(obj_)7576# end class docParamListItem7577class docParamNameList(GeneratedsSuper):7578 subclass = None7579 superclass = None7580 def __init__(self, parametername=None):7581 if parametername is None:7582 self.parametername = []7583 else:7584 self.parametername = parametername7585 def factory(*args_, **kwargs_):7586 if docParamNameList.subclass:7587 return docParamNameList.subclass(*args_, **kwargs_)7588 else:7589 return docParamNameList(*args_, **kwargs_)7590 factory = staticmethod(factory)7591 def get_parametername(self): return self.parametername7592 def set_parametername(self, parametername): self.parametername = parametername7593 def add_parametername(self, value): self.parametername.append(value)7594 def insert_parametername(self, index, value): self.parametername[index] = value7595 def export(self, outfile, level, namespace_='', name_='docParamNameList', namespacedef_=''):7596 showIndent(outfile, level)7597 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7598 self.exportAttributes(outfile, level, namespace_, name_='docParamNameList')7599 if self.hasContent_():7600 outfile.write('>\n')7601 self.exportChildren(outfile, level + 1, namespace_, name_)7602 showIndent(outfile, level)7603 outfile.write('</%s%s>\n' % (namespace_, name_))7604 else:7605 outfile.write(' />\n')7606 def exportAttributes(self, outfile, level, namespace_='', name_='docParamNameList'):7607 pass7608 def exportChildren(self, outfile, level, namespace_='', name_='docParamNameList'):7609 for parametername_ in self.parametername:7610 parametername_.export(outfile, level, namespace_, name_='parametername')7611 def hasContent_(self):7612 if (7613 self.parametername is not None7614 ):7615 return True7616 else:7617 return False7618 def exportLiteral(self, outfile, level, name_='docParamNameList'):7619 level += 17620 self.exportLiteralAttributes(outfile, level, name_)7621 if self.hasContent_():7622 self.exportLiteralChildren(outfile, level, name_)7623 def exportLiteralAttributes(self, outfile, level, name_):7624 pass7625 def exportLiteralChildren(self, outfile, level, name_):7626 showIndent(outfile, level)7627 outfile.write('parametername=[\n')7628 level += 17629 for parametername in self.parametername:7630 showIndent(outfile, level)7631 outfile.write('model_.parametername(\n')7632 parametername.exportLiteral(outfile, level, name_='parametername')7633 showIndent(outfile, level)7634 outfile.write('),\n')7635 level -= 17636 showIndent(outfile, level)7637 outfile.write('],\n')7638 def build(self, node_):7639 attrs = node_.attributes7640 self.buildAttributes(attrs)7641 for child_ in node_.childNodes:7642 nodeName_ = child_.nodeName.split(':')[-1]7643 self.buildChildren(child_, nodeName_)7644 def buildAttributes(self, attrs):7645 pass7646 def buildChildren(self, child_, nodeName_):7647 if child_.nodeType == Node.ELEMENT_NODE and \7648 nodeName_ == 'parametername':7649 obj_ = docParamName.factory()7650 obj_.build(child_)7651 self.parametername.append(obj_)7652# end class docParamNameList7653class docParamName(GeneratedsSuper):7654 subclass = None7655 superclass = None7656 def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):7657 self.direction = direction7658 if mixedclass_ is None:7659 self.mixedclass_ = MixedContainer7660 else:7661 self.mixedclass_ = mixedclass_7662 if content_ is None:7663 self.content_ = []7664 else:7665 self.content_ = content_7666 def factory(*args_, **kwargs_):7667 if docParamName.subclass:7668 return docParamName.subclass(*args_, **kwargs_)7669 else:7670 return docParamName(*args_, **kwargs_)7671 factory = staticmethod(factory)7672 def get_ref(self): return self.ref7673 def set_ref(self, ref): self.ref = ref7674 def get_direction(self): return self.direction7675 def set_direction(self, direction): self.direction = direction7676 def export(self, outfile, level, namespace_='', name_='docParamName', namespacedef_=''):7677 showIndent(outfile, level)7678 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7679 self.exportAttributes(outfile, level, namespace_, name_='docParamName')7680 outfile.write('>')7681 self.exportChildren(outfile, level + 1, namespace_, name_)7682 outfile.write('</%s%s>\n' % (namespace_, name_))7683 def exportAttributes(self, outfile, level, namespace_='', name_='docParamName'):7684 if self.direction is not None:7685 outfile.write(' direction=%s' % (quote_attrib(self.direction), ))7686 def exportChildren(self, outfile, level, namespace_='', name_='docParamName'):7687 for item_ in self.content_:7688 item_.export(outfile, level, item_.name, namespace_)7689 def hasContent_(self):7690 if (7691 self.ref is not None7692 ):7693 return True7694 else:7695 return False7696 def exportLiteral(self, outfile, level, name_='docParamName'):7697 level += 17698 self.exportLiteralAttributes(outfile, level, name_)7699 if self.hasContent_():7700 self.exportLiteralChildren(outfile, level, name_)7701 def exportLiteralAttributes(self, outfile, level, name_):7702 if self.direction is not None:7703 showIndent(outfile, level)7704 outfile.write('direction = "%s",\n' % (self.direction,))7705 def exportLiteralChildren(self, outfile, level, name_):7706 showIndent(outfile, level)7707 outfile.write('content_ = [\n')7708 for item_ in self.content_:7709 item_.exportLiteral(outfile, level, name_)7710 showIndent(outfile, level)7711 outfile.write('],\n')7712 def build(self, node_):7713 attrs = node_.attributes7714 self.buildAttributes(attrs)7715 for child_ in node_.childNodes:7716 nodeName_ = child_.nodeName.split(':')[-1]7717 self.buildChildren(child_, nodeName_)7718 def buildAttributes(self, attrs):7719 if attrs.get('direction'):7720 self.direction = attrs.get('direction').value7721 def buildChildren(self, child_, nodeName_):7722 if child_.nodeType == Node.ELEMENT_NODE and \7723 nodeName_ == 'ref':7724 childobj_ = docRefTextType.factory()7725 childobj_.build(child_)7726 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,7727 MixedContainer.TypeNone, 'ref', childobj_)7728 self.content_.append(obj_)7729 elif child_.nodeType == Node.TEXT_NODE:7730 obj_ = self.mixedclass_(MixedContainer.CategoryText,7731 MixedContainer.TypeNone, '', child_.nodeValue)7732 self.content_.append(obj_)7733# end class docParamName7734class docXRefSectType(GeneratedsSuper):7735 subclass = None7736 superclass = None7737 def __init__(self, id=None, xreftitle=None, xrefdescription=None):7738 self.id = id7739 if xreftitle is None:7740 self.xreftitle = []7741 else:7742 self.xreftitle = xreftitle7743 self.xrefdescription = xrefdescription7744 def factory(*args_, **kwargs_):7745 if docXRefSectType.subclass:7746 return docXRefSectType.subclass(*args_, **kwargs_)7747 else:7748 return docXRefSectType(*args_, **kwargs_)7749 factory = staticmethod(factory)7750 def get_xreftitle(self): return self.xreftitle7751 def set_xreftitle(self, xreftitle): self.xreftitle = xreftitle7752 def add_xreftitle(self, value): self.xreftitle.append(value)7753 def insert_xreftitle(self, index, value): self.xreftitle[index] = value7754 def get_xrefdescription(self): return self.xrefdescription7755 def set_xrefdescription(self, xrefdescription): self.xrefdescription = xrefdescription7756 def get_id(self): return self.id7757 def set_id(self, id): self.id = id7758 def export(self, outfile, level, namespace_='', name_='docXRefSectType', namespacedef_=''):7759 showIndent(outfile, level)7760 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7761 self.exportAttributes(outfile, level, namespace_, name_='docXRefSectType')7762 if self.hasContent_():7763 outfile.write('>\n')7764 self.exportChildren(outfile, level + 1, namespace_, name_)7765 showIndent(outfile, level)7766 outfile.write('</%s%s>\n' % (namespace_, name_))7767 else:7768 outfile.write(' />\n')7769 def exportAttributes(self, outfile, level, namespace_='', name_='docXRefSectType'):7770 if self.id is not None:7771 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))7772 def exportChildren(self, outfile, level, namespace_='', name_='docXRefSectType'):7773 for xreftitle_ in self.xreftitle:7774 showIndent(outfile, level)7775 outfile.write('<%sxreftitle>%s</%sxreftitle>\n' % (namespace_, self.format_string(quote_xml(xreftitle_).encode(ExternalEncoding), input_name='xreftitle'), namespace_))7776 if self.xrefdescription:7777 self.xrefdescription.export(outfile, level, namespace_, name_='xrefdescription', )7778 def hasContent_(self):7779 if (7780 self.xreftitle is not None or7781 self.xrefdescription is not None7782 ):7783 return True7784 else:7785 return False7786 def exportLiteral(self, outfile, level, name_='docXRefSectType'):7787 level += 17788 self.exportLiteralAttributes(outfile, level, name_)7789 if self.hasContent_():7790 self.exportLiteralChildren(outfile, level, name_)7791 def exportLiteralAttributes(self, outfile, level, name_):7792 if self.id is not None:7793 showIndent(outfile, level)7794 outfile.write('id = %s,\n' % (self.id,))7795 def exportLiteralChildren(self, outfile, level, name_):7796 showIndent(outfile, level)7797 outfile.write('xreftitle=[\n')7798 level += 17799 for xreftitle in self.xreftitle:7800 showIndent(outfile, level)7801 outfile.write('%s,\n' % quote_python(xreftitle).encode(ExternalEncoding))7802 level -= 17803 showIndent(outfile, level)7804 outfile.write('],\n')7805 if self.xrefdescription:7806 showIndent(outfile, level)7807 outfile.write('xrefdescription=model_.descriptionType(\n')7808 self.xrefdescription.exportLiteral(outfile, level, name_='xrefdescription')7809 showIndent(outfile, level)7810 outfile.write('),\n')7811 def build(self, node_):7812 attrs = node_.attributes7813 self.buildAttributes(attrs)7814 for child_ in node_.childNodes:7815 nodeName_ = child_.nodeName.split(':')[-1]7816 self.buildChildren(child_, nodeName_)7817 def buildAttributes(self, attrs):7818 if attrs.get('id'):7819 self.id = attrs.get('id').value7820 def buildChildren(self, child_, nodeName_):7821 if child_.nodeType == Node.ELEMENT_NODE and \7822 nodeName_ == 'xreftitle':7823 xreftitle_ = ''7824 for text__content_ in child_.childNodes:7825 xreftitle_ += text__content_.nodeValue7826 self.xreftitle.append(xreftitle_)7827 elif child_.nodeType == Node.ELEMENT_NODE and \7828 nodeName_ == 'xrefdescription':7829 obj_ = descriptionType.factory()7830 obj_.build(child_)7831 self.set_xrefdescription(obj_)7832# end class docXRefSectType7833class docCopyType(GeneratedsSuper):7834 subclass = None7835 superclass = None7836 def __init__(self, link=None, para=None, sect1=None, internal=None):7837 self.link = link7838 if para is None:7839 self.para = []7840 else:7841 self.para = para7842 if sect1 is None:7843 self.sect1 = []7844 else:7845 self.sect1 = sect17846 self.internal = internal7847 def factory(*args_, **kwargs_):7848 if docCopyType.subclass:7849 return docCopyType.subclass(*args_, **kwargs_)7850 else:7851 return docCopyType(*args_, **kwargs_)7852 factory = staticmethod(factory)7853 def get_para(self): return self.para7854 def set_para(self, para): self.para = para7855 def add_para(self, value): self.para.append(value)7856 def insert_para(self, index, value): self.para[index] = value7857 def get_sect1(self): return self.sect17858 def set_sect1(self, sect1): self.sect1 = sect17859 def add_sect1(self, value): self.sect1.append(value)7860 def insert_sect1(self, index, value): self.sect1[index] = value7861 def get_internal(self): return self.internal7862 def set_internal(self, internal): self.internal = internal7863 def get_link(self): return self.link7864 def set_link(self, link): self.link = link7865 def export(self, outfile, level, namespace_='', name_='docCopyType', namespacedef_=''):7866 showIndent(outfile, level)7867 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7868 self.exportAttributes(outfile, level, namespace_, name_='docCopyType')7869 if self.hasContent_():7870 outfile.write('>\n')7871 self.exportChildren(outfile, level + 1, namespace_, name_)7872 showIndent(outfile, level)7873 outfile.write('</%s%s>\n' % (namespace_, name_))7874 else:7875 outfile.write(' />\n')7876 def exportAttributes(self, outfile, level, namespace_='', name_='docCopyType'):7877 if self.link is not None:7878 outfile.write(' link=%s' % (self.format_string(quote_attrib(self.link).encode(ExternalEncoding), input_name='link'), ))7879 def exportChildren(self, outfile, level, namespace_='', name_='docCopyType'):7880 for para_ in self.para:7881 para_.export(outfile, level, namespace_, name_='para')7882 for sect1_ in self.sect1:7883 sect1_.export(outfile, level, namespace_, name_='sect1')7884 if self.internal:7885 self.internal.export(outfile, level, namespace_, name_='internal')7886 def hasContent_(self):7887 if (7888 self.para is not None or7889 self.sect1 is not None or7890 self.internal is not None7891 ):7892 return True7893 else:7894 return False7895 def exportLiteral(self, outfile, level, name_='docCopyType'):7896 level += 17897 self.exportLiteralAttributes(outfile, level, name_)7898 if self.hasContent_():7899 self.exportLiteralChildren(outfile, level, name_)7900 def exportLiteralAttributes(self, outfile, level, name_):7901 if self.link is not None:7902 showIndent(outfile, level)7903 outfile.write('link = %s,\n' % (self.link,))7904 def exportLiteralChildren(self, outfile, level, name_):7905 showIndent(outfile, level)7906 outfile.write('para=[\n')7907 level += 17908 for para in self.para:7909 showIndent(outfile, level)7910 outfile.write('model_.para(\n')7911 para.exportLiteral(outfile, level, name_='para')7912 showIndent(outfile, level)7913 outfile.write('),\n')7914 level -= 17915 showIndent(outfile, level)7916 outfile.write('],\n')7917 showIndent(outfile, level)7918 outfile.write('sect1=[\n')7919 level += 17920 for sect1 in self.sect1:7921 showIndent(outfile, level)7922 outfile.write('model_.sect1(\n')7923 sect1.exportLiteral(outfile, level, name_='sect1')7924 showIndent(outfile, level)7925 outfile.write('),\n')7926 level -= 17927 showIndent(outfile, level)7928 outfile.write('],\n')7929 if self.internal:7930 showIndent(outfile, level)7931 outfile.write('internal=model_.docInternalType(\n')7932 self.internal.exportLiteral(outfile, level, name_='internal')7933 showIndent(outfile, level)7934 outfile.write('),\n')7935 def build(self, node_):7936 attrs = node_.attributes7937 self.buildAttributes(attrs)7938 for child_ in node_.childNodes:7939 nodeName_ = child_.nodeName.split(':')[-1]7940 self.buildChildren(child_, nodeName_)7941 def buildAttributes(self, attrs):7942 if attrs.get('link'):7943 self.link = attrs.get('link').value7944 def buildChildren(self, child_, nodeName_):7945 if child_.nodeType == Node.ELEMENT_NODE and \7946 nodeName_ == 'para':7947 obj_ = docParaType.factory()7948 obj_.build(child_)7949 self.para.append(obj_)7950 elif child_.nodeType == Node.ELEMENT_NODE and \7951 nodeName_ == 'sect1':7952 obj_ = docSect1Type.factory()7953 obj_.build(child_)7954 self.sect1.append(obj_)7955 elif child_.nodeType == Node.ELEMENT_NODE and \7956 nodeName_ == 'internal':7957 obj_ = docInternalType.factory()7958 obj_.build(child_)7959 self.set_internal(obj_)7960# end class docCopyType7961class docCharType(GeneratedsSuper):7962 subclass = None7963 superclass = None7964 def __init__(self, char=None, valueOf_=''):7965 self.char = char7966 self.valueOf_ = valueOf_7967 def factory(*args_, **kwargs_):7968 if docCharType.subclass:7969 return docCharType.subclass(*args_, **kwargs_)7970 else:7971 return docCharType(*args_, **kwargs_)7972 factory = staticmethod(factory)7973 def get_char(self): return self.char7974 def set_char(self, char): self.char = char7975 def getValueOf_(self): return self.valueOf_7976 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_7977 def export(self, outfile, level, namespace_='', name_='docCharType', namespacedef_=''):7978 showIndent(outfile, level)7979 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))7980 self.exportAttributes(outfile, level, namespace_, name_='docCharType')7981 if self.hasContent_():7982 outfile.write('>\n')7983 self.exportChildren(outfile, level + 1, namespace_, name_)7984 showIndent(outfile, level)7985 outfile.write('</%s%s>\n' % (namespace_, name_))7986 else:7987 outfile.write(' />\n')7988 def exportAttributes(self, outfile, level, namespace_='', name_='docCharType'):7989 if self.char is not None:7990 outfile.write(' char=%s' % (quote_attrib(self.char), ))7991 def exportChildren(self, outfile, level, namespace_='', name_='docCharType'):7992 if self.valueOf_.find('![CDATA')>-1:7993 value=quote_xml('%s' % self.valueOf_)7994 value=value.replace('![CDATA','<![CDATA')7995 value=value.replace(']]',']]>')7996 outfile.write(value)7997 else:7998 outfile.write(quote_xml('%s' % self.valueOf_))7999 def hasContent_(self):8000 if (8001 self.valueOf_ is not None8002 ):8003 return True8004 else:8005 return False8006 def exportLiteral(self, outfile, level, name_='docCharType'):8007 level += 18008 self.exportLiteralAttributes(outfile, level, name_)8009 if self.hasContent_():8010 self.exportLiteralChildren(outfile, level, name_)8011 def exportLiteralAttributes(self, outfile, level, name_):8012 if self.char is not None:8013 showIndent(outfile, level)8014 outfile.write('char = "%s",\n' % (self.char,))8015 def exportLiteralChildren(self, outfile, level, name_):8016 showIndent(outfile, level)8017 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))8018 def build(self, node_):8019 attrs = node_.attributes8020 self.buildAttributes(attrs)8021 self.valueOf_ = ''8022 for child_ in node_.childNodes:8023 nodeName_ = child_.nodeName.split(':')[-1]8024 self.buildChildren(child_, nodeName_)8025 def buildAttributes(self, attrs):8026 if attrs.get('char'):8027 self.char = attrs.get('char').value8028 def buildChildren(self, child_, nodeName_):8029 if child_.nodeType == Node.TEXT_NODE:8030 self.valueOf_ += child_.nodeValue8031 elif child_.nodeType == Node.CDATA_SECTION_NODE:8032 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'8033# end class docCharType8034class docEmptyType(GeneratedsSuper):8035 subclass = None8036 superclass = None8037 def __init__(self, valueOf_=''):8038 self.valueOf_ = valueOf_8039 def factory(*args_, **kwargs_):8040 if docEmptyType.subclass:8041 return docEmptyType.subclass(*args_, **kwargs_)8042 else:8043 return docEmptyType(*args_, **kwargs_)8044 factory = staticmethod(factory)8045 def getValueOf_(self): return self.valueOf_8046 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_8047 def export(self, outfile, level, namespace_='', name_='docEmptyType', namespacedef_=''):8048 showIndent(outfile, level)8049 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))8050 self.exportAttributes(outfile, level, namespace_, name_='docEmptyType')8051 if self.hasContent_():8052 outfile.write('>\n')8053 self.exportChildren(outfile, level + 1, namespace_, name_)8054 showIndent(outfile, level)8055 outfile.write('</%s%s>\n' % (namespace_, name_))8056 else:8057 outfile.write(' />\n')8058 def exportAttributes(self, outfile, level, namespace_='', name_='docEmptyType'):8059 pass8060 def exportChildren(self, outfile, level, namespace_='', name_='docEmptyType'):8061 if self.valueOf_.find('![CDATA')>-1:8062 value=quote_xml('%s' % self.valueOf_)8063 value=value.replace('![CDATA','<![CDATA')8064 value=value.replace(']]',']]>')8065 outfile.write(value)8066 else:8067 outfile.write(quote_xml('%s' % self.valueOf_))8068 def hasContent_(self):8069 if (8070 self.valueOf_ is not None8071 ):8072 return True8073 else:8074 return False8075 def exportLiteral(self, outfile, level, name_='docEmptyType'):8076 level += 18077 self.exportLiteralAttributes(outfile, level, name_)8078 if self.hasContent_():8079 self.exportLiteralChildren(outfile, level, name_)8080 def exportLiteralAttributes(self, outfile, level, name_):8081 pass8082 def exportLiteralChildren(self, outfile, level, name_):8083 showIndent(outfile, level)8084 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))8085 def build(self, node_):8086 attrs = node_.attributes8087 self.buildAttributes(attrs)8088 self.valueOf_ = ''8089 for child_ in node_.childNodes:8090 nodeName_ = child_.nodeName.split(':')[-1]8091 self.buildChildren(child_, nodeName_)8092 def buildAttributes(self, attrs):8093 pass8094 def buildChildren(self, child_, nodeName_):8095 if child_.nodeType == Node.TEXT_NODE:8096 self.valueOf_ += child_.nodeValue8097 elif child_.nodeType == Node.CDATA_SECTION_NODE:...

Full Screen

Full Screen

xml_output.py

Source:xml_output.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('model_.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('model_.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('model_.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_chain(self): return self.data_type158 def get_data_type(self):159 if isinstance(self.data_type, list):160 if len(self.data_type) > 0:161 return self.data_type[-1]162 else:163 return 'xs:string'164 else:165 return self.data_type166 def set_container(self, container): self.container = container167 def get_container(self): return self.container168def _cast(typ, value):169 if typ is None or value is None:170 return value171 return typ(value)172#173# Data representation classes.174#175class urls(GeneratedsSuper):176 subclass = None177 superclass = None178 def __init__(self, clientInfo=None, url=None):179 if clientInfo is None:180 self.clientInfo = []181 else:182 self.clientInfo = clientInfo183 if url is None:184 self.url = []185 else:186 self.url = url187 def factory(*args_, **kwargs_):188 if urls.subclass:189 return urls.subclass(*args_, **kwargs_)190 else:191 return urls(*args_, **kwargs_)192 factory = staticmethod(factory)193 def get_clientInfo(self): return self.clientInfo194 def set_clientInfo(self, clientInfo): self.clientInfo = clientInfo195 def add_clientInfo(self, value): self.clientInfo.append(value)196 def insert_clientInfo(self, index, value): self.clientInfo[index] = value197 def get_url(self): return self.url198 def set_url(self, url): self.url = url199 def add_url(self, value): self.url.append(value)200 def insert_url(self, index, value): self.url[index] = value201 def export(self, outfile, level, namespace_='', name_='urls', namespacedef_=''):202 showIndent(outfile, level)203 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))204 self.exportAttributes(outfile, level, namespace_, name_='urls')205 if self.hasContent_():206 outfile.write('>\n')207 self.exportChildren(outfile, level + 1, namespace_, name_)208 showIndent(outfile, level)209 outfile.write('</%s%s>\n' % (namespace_, name_))210 else:211 outfile.write('/>\n')212 def exportAttributes(self, outfile, level, namespace_='', name_='urls'):213 pass214 def exportChildren(self, outfile, level, namespace_='', name_='urls'):215 for clientInfo_ in self.clientInfo:216 clientInfo_.export(outfile, level, namespace_, name_='clientInfo')217 for url_ in self.url:218 url_.export(outfile, level, namespace_, name_='url')219 def hasContent_(self):220 if (221 self.clientInfo or222 self.url223 ):224 return True225 else:226 return False227 def exportLiteral(self, outfile, level, name_='urls'):228 level += 1229 self.exportLiteralAttributes(outfile, level, name_)230 if self.hasContent_():231 self.exportLiteralChildren(outfile, level, name_)232 def exportLiteralAttributes(self, outfile, level, name_):233 pass234 def exportLiteralChildren(self, outfile, level, name_):235 showIndent(outfile, level)236 outfile.write('clientInfo=[\n')237 level += 1238 for clientInfo_ in self.clientInfo:239 showIndent(outfile, level)240 outfile.write('model_.clientInfo(\n')241 clientInfo_.exportLiteral(outfile, level)242 showIndent(outfile, level)243 outfile.write('),\n')244 level -= 1245 showIndent(outfile, level)246 outfile.write('],\n')247 showIndent(outfile, level)248 outfile.write('url=[\n')249 level += 1250 for url_ in self.url:251 showIndent(outfile, level)252 outfile.write('model_.url(\n')253 url_.exportLiteral(outfile, level)254 showIndent(outfile, level)255 outfile.write('),\n')256 level -= 1257 showIndent(outfile, level)258 outfile.write('],\n')259 def build(self, node_):260 attrs = node_.attributes261 self.buildAttributes(attrs)262 for child_ in node_.childNodes:263 nodeName_ = child_.nodeName.split(':')[-1]264 self.buildChildren(child_, nodeName_)265 def buildAttributes(self, attrs):266 pass267 def buildChildren(self, child_, nodeName_):268 if child_.nodeType == Node.ELEMENT_NODE and \269 nodeName_ == 'clientInfo':270 obj_ = clientInfo.factory()271 obj_.build(child_)272 self.clientInfo.append(obj_)273 elif child_.nodeType == Node.ELEMENT_NODE and \274 nodeName_ == 'url':275 obj_ = url.factory()276 obj_.build(child_)277 self.url.append(obj_)278# end class urls279class clientInfo(GeneratedsSuper):280 subclass = None281 superclass = None282 def __init__(self, version=None, ipAddress=None, commandLine=None, startTime=None, endTime=None):283 if version is None:284 self.version = []285 else:286 self.version = version287 if ipAddress is None:288 self.ipAddress = []289 else:290 self.ipAddress = ipAddress291 if commandLine is None:292 self.commandLine = []293 else:294 self.commandLine = commandLine295 if startTime is None:296 self.startTime = []297 else:298 self.startTime = startTime299 if endTime is None:300 self.endTime = []301 else:302 self.endTime = endTime303 def factory(*args_, **kwargs_):304 if clientInfo.subclass:305 return clientInfo.subclass(*args_, **kwargs_)306 else:307 return clientInfo(*args_, **kwargs_)308 factory = staticmethod(factory)309 def get_version(self): return self.version310 def set_version(self, version): self.version = version311 def add_version(self, value): self.version.append(value)312 def insert_version(self, index, value): self.version[index] = value313 def get_ipAddress(self): return self.ipAddress314 def set_ipAddress(self, ipAddress): self.ipAddress = ipAddress315 def add_ipAddress(self, value): self.ipAddress.append(value)316 def insert_ipAddress(self, index, value): self.ipAddress[index] = value317 def get_commandLine(self): return self.commandLine318 def set_commandLine(self, commandLine): self.commandLine = commandLine319 def add_commandLine(self, value): self.commandLine.append(value)320 def insert_commandLine(self, index, value): self.commandLine[index] = value321 def get_startTime(self): return self.startTime322 def set_startTime(self, startTime): self.startTime = startTime323 def add_startTime(self, value): self.startTime.append(value)324 def insert_startTime(self, index, value): self.startTime[index] = value325 def get_endTime(self): return self.endTime326 def set_endTime(self, endTime): self.endTime = endTime327 def add_endTime(self, value): self.endTime.append(value)328 def insert_endTime(self, index, value): self.endTime[index] = value329 def export(self, outfile, level, namespace_='', name_='clientInfo', namespacedef_=''):330 showIndent(outfile, level)331 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))332 self.exportAttributes(outfile, level, namespace_, name_='clientInfo')333 if self.hasContent_():334 outfile.write('>\n')335 self.exportChildren(outfile, level + 1, namespace_, name_)336 showIndent(outfile, level)337 outfile.write('</%s%s>\n' % (namespace_, name_))338 else:339 outfile.write('/>\n')340 def exportAttributes(self, outfile, level, namespace_='', name_='clientInfo'):341 pass342 def exportChildren(self, outfile, level, namespace_='', name_='clientInfo'):343 for version_ in self.version:344 showIndent(outfile, level)345 outfile.write('<%sversion>%s</%sversion>\n' % (namespace_, self.format_string(quote_xml(version_).encode(ExternalEncoding), input_name='version'), namespace_))346 for ipAddress_ in self.ipAddress:347 showIndent(outfile, level)348 outfile.write('<%sipAddress>%s</%sipAddress>\n' % (namespace_, self.format_string(quote_xml(ipAddress_).encode(ExternalEncoding), input_name='ipAddress'), namespace_))349 for commandLine_ in self.commandLine:350 showIndent(outfile, level)351 outfile.write('<%scommandLine>%s</%scommandLine>\n' % (namespace_, self.format_string(quote_xml(commandLine_).encode(ExternalEncoding), input_name='commandLine'), namespace_))352 for startTime_ in self.startTime:353 showIndent(outfile, level)354 outfile.write('<%sstartTime>%s</%sstartTime>\n' % (namespace_, self.format_string(quote_xml(startTime_).encode(ExternalEncoding), input_name='startTime'), namespace_))355 for endTime_ in self.endTime:356 showIndent(outfile, level)357 outfile.write('<%sendTime>%s</%sendTime>\n' % (namespace_, self.format_string(quote_xml(endTime_).encode(ExternalEncoding), input_name='endTime'), namespace_))358 def hasContent_(self):359 if (360 self.version or361 self.ipAddress or362 self.commandLine or363 self.startTime or364 self.endTime365 ):366 return True367 else:368 return False369 def exportLiteral(self, outfile, level, name_='clientInfo'):370 level += 1371 self.exportLiteralAttributes(outfile, level, name_)372 if self.hasContent_():373 self.exportLiteralChildren(outfile, level, name_)374 def exportLiteralAttributes(self, outfile, level, name_):375 pass376 def exportLiteralChildren(self, outfile, level, name_):377 showIndent(outfile, level)378 outfile.write('version=[\n')379 level += 1380 for version_ in self.version:381 showIndent(outfile, level)382 outfile.write('%s,\n' % quote_python(version_).encode(ExternalEncoding))383 level -= 1384 showIndent(outfile, level)385 outfile.write('],\n')386 showIndent(outfile, level)387 outfile.write('ipAddress=[\n')388 level += 1389 for ipAddress_ in self.ipAddress:390 showIndent(outfile, level)391 outfile.write('model_.xs_string(\n')392 ipAddress_.exportLiteral(outfile, level, name_='xs:string')393 showIndent(outfile, level)394 outfile.write('),\n')395 level -= 1396 showIndent(outfile, level)397 outfile.write('],\n')398 showIndent(outfile, level)399 outfile.write('commandLine=[\n')400 level += 1401 for commandLine_ in self.commandLine:402 showIndent(outfile, level)403 outfile.write('%s,\n' % quote_python(commandLine_).encode(ExternalEncoding))404 level -= 1405 showIndent(outfile, level)406 outfile.write('],\n')407 showIndent(outfile, level)408 outfile.write('startTime=[\n')409 level += 1410 for startTime_ in self.startTime:411 showIndent(outfile, level)412 outfile.write('%s,\n' % quote_python(startTime_).encode(ExternalEncoding))413 level -= 1414 showIndent(outfile, level)415 outfile.write('],\n')416 showIndent(outfile, level)417 outfile.write('endTime=[\n')418 level += 1419 for endTime_ in self.endTime:420 showIndent(outfile, level)421 outfile.write('%s,\n' % quote_python(endTime_).encode(ExternalEncoding))422 level -= 1423 showIndent(outfile, level)424 outfile.write('],\n')425 def build(self, node_):426 attrs = node_.attributes427 self.buildAttributes(attrs)428 for child_ in node_.childNodes:429 nodeName_ = child_.nodeName.split(':')[-1]430 self.buildChildren(child_, nodeName_)431 def buildAttributes(self, attrs):432 pass433 def buildChildren(self, child_, nodeName_):434 if child_.nodeType == Node.ELEMENT_NODE and \435 nodeName_ == 'version':436 version_ = ''437 for text__content_ in child_.childNodes:438 version_ += text__content_.nodeValue439 self.version.append(version_)440 elif child_.nodeType == Node.ELEMENT_NODE and \441 nodeName_ == 'ipAddress':442 ipAddress_ = ''443 for text__content_ in child_.childNodes:444 ipAddress_ += text__content_.nodeValue445 self.ipAddress.append(ipAddress_)446 elif child_.nodeType == Node.ELEMENT_NODE and \447 nodeName_ == 'commandLine':448 commandLine_ = ''449 for text__content_ in child_.childNodes:450 commandLine_ += text__content_.nodeValue451 self.commandLine.append(commandLine_)452 elif child_.nodeType == Node.ELEMENT_NODE and \453 nodeName_ == 'startTime':454 startTime_ = ''455 for text__content_ in child_.childNodes:456 startTime_ += text__content_.nodeValue457 self.startTime.append(startTime_)458 elif child_.nodeType == Node.ELEMENT_NODE and \459 nodeName_ == 'endTime':460 endTime_ = ''461 for text__content_ in child_.childNodes:462 endTime_ += text__content_.nodeValue463 self.endTime.append(endTime_)464# end class clientInfo465class url(GeneratedsSuper):466 subclass = None467 superclass = None468 def __init__(self, id=None, urlString=None, referrer=None, httpStatus=None, httpRedirectedTo=None, serverHeaders=None, requestHeaders=None, error=None, disposition=None, output=None, dnsResolution=None, contents=None, outgoingLinks=None, kit=None, exploits=None, classifications=None):469 self.id = _cast(None, id)470 if urlString is None:471 self.urlString = []472 else:473 self.urlString = urlString474 if referrer is None:475 self.referrer = []476 else:477 self.referrer = referrer478 if httpStatus is None:479 self.httpStatus = []480 else:481 self.httpStatus = httpStatus482 if httpRedirectedTo is None:483 self.httpRedirectedTo = []484 else:485 self.httpRedirectedTo = httpRedirectedTo486 if serverHeaders is None:487 self.serverHeaders = []488 else:489 self.serverHeaders = serverHeaders490 if requestHeaders is None:491 self.requestHeaders = []492 else:493 self.requestHeaders = requestHeaders494 if error is None:495 self.error = []496 else:497 self.error = error498 if disposition is None:499 self.disposition = []500 else:501 self.disposition = disposition502 if output is None:503 self.output = []504 else:505 self.output = output506 if dnsResolution is None:507 self.dnsResolution = []508 else:509 self.dnsResolution = dnsResolution510 if contents is None:511 self.contents = []512 else:513 self.contents = contents514 if outgoingLinks is None:515 self.outgoingLinks = []516 else:517 self.outgoingLinks = outgoingLinks518 if kit is None:519 self.kit = []520 else:521 self.kit = kit522 if exploits is None:523 self.exploits = []524 else:525 self.exploits = exploits526 if classifications is None:527 self.classifications = []528 else:529 self.classifications = classifications530 def factory(*args_, **kwargs_):531 if url.subclass:532 return url.subclass(*args_, **kwargs_)533 else:534 return url(*args_, **kwargs_)535 factory = staticmethod(factory)536 def get_urlString(self): return self.urlString537 def set_urlString(self, urlString): self.urlString = urlString538 def add_urlString(self, value): self.urlString.append(value)539 def insert_urlString(self, index, value): self.urlString[index] = value540 def get_referrer(self): return self.referrer541 def set_referrer(self, referrer): self.referrer = referrer542 def add_referrer(self, value): self.referrer.append(value)543 def insert_referrer(self, index, value): self.referrer[index] = value544 def get_httpStatus(self): return self.httpStatus545 def set_httpStatus(self, httpStatus): self.httpStatus = httpStatus546 def add_httpStatus(self, value): self.httpStatus.append(value)547 def insert_httpStatus(self, index, value): self.httpStatus[index] = value548 def get_httpRedirectedTo(self): return self.httpRedirectedTo549 def set_httpRedirectedTo(self, httpRedirectedTo): self.httpRedirectedTo = httpRedirectedTo550 def add_httpRedirectedTo(self, value): self.httpRedirectedTo.append(value)551 def insert_httpRedirectedTo(self, index, value): self.httpRedirectedTo[index] = value552 def get_serverHeaders(self): return self.serverHeaders553 def set_serverHeaders(self, serverHeaders): self.serverHeaders = serverHeaders554 def add_serverHeaders(self, value): self.serverHeaders.append(value)555 def insert_serverHeaders(self, index, value): self.serverHeaders[index] = value556 def get_requestHeaders(self): return self.requestHeaders557 def set_requestHeaders(self, requestHeaders): self.requestHeaders = requestHeaders558 def add_requestHeaders(self, value): self.requestHeaders.append(value)559 def insert_requestHeaders(self, index, value): self.requestHeaders[index] = value560 def get_error(self): return self.error561 def set_error(self, error): self.error = error562 def add_error(self, value): self.error.append(value)563 def insert_error(self, index, value): self.error[index] = value564 def get_disposition(self): return self.disposition565 def set_disposition(self, disposition): self.disposition = disposition566 def add_disposition(self, value): self.disposition.append(value)567 def insert_disposition(self, index, value): self.disposition[index] = value568 def validate_disposition(self, value):569 # validate type disposition570 pass571 def get_output(self): return self.output572 def set_output(self, output): self.output = output573 def add_output(self, value): self.output.append(value)574 def insert_output(self, index, value): self.output[index] = value575 def get_dnsResolution(self): return self.dnsResolution576 def set_dnsResolution(self, dnsResolution): self.dnsResolution = dnsResolution577 def add_dnsResolution(self, value): self.dnsResolution.append(value)578 def insert_dnsResolution(self, index, value): self.dnsResolution[index] = value579 def get_contents(self): return self.contents580 def set_contents(self, contents): self.contents = contents581 def add_contents(self, value): self.contents.append(value)582 def insert_contents(self, index, value): self.contents[index] = value583 def get_outgoingLinks(self): return self.outgoingLinks584 def set_outgoingLinks(self, outgoingLinks): self.outgoingLinks = outgoingLinks585 def add_outgoingLinks(self, value): self.outgoingLinks.append(value)586 def insert_outgoingLinks(self, index, value): self.outgoingLinks[index] = value587 def get_kit(self): return self.kit588 def set_kit(self, kit): self.kit = kit589 def add_kit(self, value): self.kit.append(value)590 def insert_kit(self, index, value): self.kit[index] = value591 def get_exploits(self): return self.exploits592 def set_exploits(self, exploits): self.exploits = exploits593 def add_exploits(self, value): self.exploits.append(value)594 def insert_exploits(self, index, value): self.exploits[index] = value595 def get_classifications(self): return self.classifications596 def set_classifications(self, classifications): self.classifications = classifications597 def add_classifications(self, value): self.classifications.append(value)598 def insert_classifications(self, index, value): self.classifications[index] = value599 def get_id(self): return self.id600 def set_id(self, id): self.id = id601 def export(self, outfile, level, namespace_='', name_='url', namespacedef_=''):602 showIndent(outfile, level)603 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))604 self.exportAttributes(outfile, level, namespace_, name_='url')605 if self.hasContent_():606 outfile.write('>\n')607 self.exportChildren(outfile, level + 1, namespace_, name_)608 showIndent(outfile, level)609 outfile.write('</%s%s>\n' % (namespace_, name_))610 else:611 outfile.write('/>\n')612 def exportAttributes(self, outfile, level, namespace_='', name_='url'):613 if self.id is not None:614 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))615 def exportChildren(self, outfile, level, namespace_='', name_='url'):616 for urlString_ in self.urlString:617 showIndent(outfile, level)618 outfile.write('<%surlString>%s</%surlString>\n' % (namespace_, self.format_string(quote_xml(urlString_).encode(ExternalEncoding), input_name='urlString'), namespace_))619 for referrer_ in self.referrer:620 showIndent(outfile, level)621 outfile.write('<%sreferrer>%s</%sreferrer>\n' % (namespace_, self.format_string(quote_xml(referrer_).encode(ExternalEncoding), input_name='referrer'), namespace_))622 for httpStatus_ in self.httpStatus:623 showIndent(outfile, level)624 outfile.write('<%shttpStatus>%s</%shttpStatus>\n' % (namespace_, self.format_float(httpStatus_, input_name='httpStatus'), namespace_))625 for httpRedirectedTo_ in self.httpRedirectedTo:626 showIndent(outfile, level)627 outfile.write('<%shttpRedirectedTo>%s</%shttpRedirectedTo>\n' % (namespace_, self.format_string(quote_xml(httpRedirectedTo_).encode(ExternalEncoding), input_name='httpRedirectedTo'), namespace_))628 for serverHeaders_ in self.serverHeaders:629 showIndent(outfile, level)630 outfile.write('<%sserverHeaders>%s</%sserverHeaders>\n' % (namespace_, self.format_string(quote_xml(serverHeaders_).encode(ExternalEncoding), input_name='serverHeaders'), namespace_))631 for requestHeaders_ in self.requestHeaders:632 showIndent(outfile, level)633 outfile.write('<%srequestHeaders>%s</%srequestHeaders>\n' % (namespace_, self.format_string(quote_xml(requestHeaders_).encode(ExternalEncoding), input_name='requestHeaders'), namespace_))634 for error_ in self.error:635 showIndent(outfile, level)636 outfile.write('<%serror>%s</%serror>\n' % (namespace_, self.format_string(quote_xml(error_).encode(ExternalEncoding), input_name='error'), namespace_))637 for disposition_ in self.disposition:638 showIndent(outfile, level)639 outfile.write('<%sdisposition>%s</%sdisposition>\n' % (namespace_, self.format_string(quote_xml(disposition_).encode(ExternalEncoding), input_name='disposition'), namespace_))640 for output_ in self.output:641 showIndent(outfile, level)642 outfile.write('<%soutput>%s</%soutput>\n' % (namespace_, self.format_string(quote_xml(output_).encode(ExternalEncoding), input_name='output'), namespace_))643 for dnsResolution_ in self.dnsResolution:644 dnsResolution_.export(outfile, level, namespace_, name_='dnsResolution')645 for contents_ in self.contents:646 contents_.export(outfile, level, namespace_, name_='contents')647 for outgoingLinks_ in self.outgoingLinks:648 outgoingLinks_.export(outfile, level, namespace_, name_='outgoingLinks')649 for kit_ in self.kit:650 kit_.export(outfile, level, namespace_, name_='kit')651 for exploits_ in self.exploits:652 exploits_.export(outfile, level, namespace_, name_='exploits')653 for classifications_ in self.classifications:654 classifications_.export(outfile, level, namespace_, name_='classifications')655 def hasContent_(self):656 if (657 self.urlString or658 self.referrer or659 self.httpStatus or660 self.httpRedirectedTo or661 self.serverHeaders or662 self.requestHeaders or663 self.error or664 self.disposition or665 self.output or666 self.dnsResolution or667 self.contents or668 self.outgoingLinks or669 self.kit or670 self.exploits or671 self.classifications672 ):673 return True674 else:675 return False676 def exportLiteral(self, outfile, level, name_='url'):677 level += 1678 self.exportLiteralAttributes(outfile, level, name_)679 if self.hasContent_():680 self.exportLiteralChildren(outfile, level, name_)681 def exportLiteralAttributes(self, outfile, level, name_):682 if self.id is not None:683 showIndent(outfile, level)684 outfile.write('id = "%s",\n' % (self.id,))685 def exportLiteralChildren(self, outfile, level, name_):686 showIndent(outfile, level)687 outfile.write('urlString=[\n')688 level += 1689 for urlString_ in self.urlString:690 showIndent(outfile, level)691 outfile.write('%s,\n' % quote_python(urlString_).encode(ExternalEncoding))692 level -= 1693 showIndent(outfile, level)694 outfile.write('],\n')695 showIndent(outfile, level)696 outfile.write('referrer=[\n')697 level += 1698 for referrer_ in self.referrer:699 showIndent(outfile, level)700 outfile.write('%s,\n' % quote_python(referrer_).encode(ExternalEncoding))701 level -= 1702 showIndent(outfile, level)703 outfile.write('],\n')704 showIndent(outfile, level)705 outfile.write('httpStatus=[\n')706 level += 1707 for httpStatus_ in self.httpStatus:708 showIndent(outfile, level)709 outfile.write('%f,\n' % httpStatus)710 level -= 1711 showIndent(outfile, level)712 outfile.write('],\n')713 showIndent(outfile, level)714 outfile.write('httpRedirectedTo=[\n')715 level += 1716 for httpRedirectedTo_ in self.httpRedirectedTo:717 showIndent(outfile, level)718 outfile.write('%s,\n' % quote_python(httpRedirectedTo_).encode(ExternalEncoding))719 level -= 1720 showIndent(outfile, level)721 outfile.write('],\n')722 showIndent(outfile, level)723 outfile.write('serverHeaders=[\n')724 level += 1725 for serverHeaders_ in self.serverHeaders:726 showIndent(outfile, level)727 outfile.write('%s,\n' % quote_python(serverHeaders_).encode(ExternalEncoding))728 level -= 1729 showIndent(outfile, level)730 outfile.write('],\n')731 showIndent(outfile, level)732 outfile.write('requestHeaders=[\n')733 level += 1734 for requestHeaders_ in self.requestHeaders:735 showIndent(outfile, level)736 outfile.write('%s,\n' % quote_python(requestHeaders_).encode(ExternalEncoding))737 level -= 1738 showIndent(outfile, level)739 outfile.write('],\n')740 showIndent(outfile, level)741 outfile.write('error=[\n')742 level += 1743 for error_ in self.error:744 showIndent(outfile, level)745 outfile.write('%s,\n' % quote_python(error_).encode(ExternalEncoding))746 level -= 1747 showIndent(outfile, level)748 outfile.write('],\n')749 showIndent(outfile, level)750 outfile.write('disposition=[\n')751 level += 1752 for disposition_ in self.disposition:753 showIndent(outfile, level)754 outfile.write('%s,\n' % quote_python(disposition_).encode(ExternalEncoding))755 level -= 1756 showIndent(outfile, level)757 outfile.write('],\n')758 showIndent(outfile, level)759 outfile.write('output=[\n')760 level += 1761 for output_ in self.output:762 showIndent(outfile, level)763 outfile.write('%s,\n' % quote_python(output_).encode(ExternalEncoding))764 level -= 1765 showIndent(outfile, level)766 outfile.write('],\n')767 showIndent(outfile, level)768 outfile.write('dnsResolution=[\n')769 level += 1770 for dnsResolution_ in self.dnsResolution:771 showIndent(outfile, level)772 outfile.write('model_.dnsResolution(\n')773 dnsResolution_.exportLiteral(outfile, level)774 showIndent(outfile, level)775 outfile.write('),\n')776 level -= 1777 showIndent(outfile, level)778 outfile.write('],\n')779 showIndent(outfile, level)780 outfile.write('contents=[\n')781 level += 1782 for contents_ in self.contents:783 showIndent(outfile, level)784 outfile.write('model_.contents(\n')785 contents_.exportLiteral(outfile, level)786 showIndent(outfile, level)787 outfile.write('),\n')788 level -= 1789 showIndent(outfile, level)790 outfile.write('],\n')791 showIndent(outfile, level)792 outfile.write('outgoingLinks=[\n')793 level += 1794 for outgoingLinks_ in self.outgoingLinks:795 showIndent(outfile, level)796 outfile.write('model_.outgoingLinks(\n')797 outgoingLinks_.exportLiteral(outfile, level)798 showIndent(outfile, level)799 outfile.write('),\n')800 level -= 1801 showIndent(outfile, level)802 outfile.write('],\n')803 showIndent(outfile, level)804 outfile.write('kit=[\n')805 level += 1806 for kit_ in self.kit:807 showIndent(outfile, level)808 outfile.write('model_.kit(\n')809 kit_.exportLiteral(outfile, level)810 showIndent(outfile, level)811 outfile.write('),\n')812 level -= 1813 showIndent(outfile, level)814 outfile.write('],\n')815 showIndent(outfile, level)816 outfile.write('exploits=[\n')817 level += 1818 for exploits_ in self.exploits:819 showIndent(outfile, level)820 outfile.write('model_.exploits(\n')821 exploits_.exportLiteral(outfile, level)822 showIndent(outfile, level)823 outfile.write('),\n')824 level -= 1825 showIndent(outfile, level)826 outfile.write('],\n')827 showIndent(outfile, level)828 outfile.write('classifications=[\n')829 level += 1830 for classifications_ in self.classifications:831 showIndent(outfile, level)832 outfile.write('model_.classifications(\n')833 classifications_.exportLiteral(outfile, level)834 showIndent(outfile, level)835 outfile.write('),\n')836 level -= 1837 showIndent(outfile, level)838 outfile.write('],\n')839 def build(self, node_):840 attrs = node_.attributes841 self.buildAttributes(attrs)842 for child_ in node_.childNodes:843 nodeName_ = child_.nodeName.split(':')[-1]844 self.buildChildren(child_, nodeName_)845 def buildAttributes(self, attrs):846 if attrs.get('id'):847 self.id = attrs.get('id').value848 def buildChildren(self, child_, nodeName_):849 if child_.nodeType == Node.ELEMENT_NODE and \850 nodeName_ == 'urlString':851 urlString_ = ''852 for text__content_ in child_.childNodes:853 urlString_ += text__content_.nodeValue854 self.urlString.append(urlString_)855 elif child_.nodeType == Node.ELEMENT_NODE and \856 nodeName_ == 'referrer':857 referrer_ = ''858 for text__content_ in child_.childNodes:859 referrer_ += text__content_.nodeValue860 self.referrer.append(referrer_)861 elif child_.nodeType == Node.ELEMENT_NODE and \862 nodeName_ == 'httpStatus':863 if child_.firstChild:864 sval_ = child_.firstChild.nodeValue865 try:866 fval_ = float(sval_)867 except ValueError, exp:868 raise ValueError('requires float or double (httpStatus): %s' %exp)869 self.httpStatus.append(fval_)870 elif child_.nodeType == Node.ELEMENT_NODE and \871 nodeName_ == 'httpRedirectedTo':872 httpRedirectedTo_ = ''873 for text__content_ in child_.childNodes:874 httpRedirectedTo_ += text__content_.nodeValue875 self.httpRedirectedTo.append(httpRedirectedTo_)876 elif child_.nodeType == Node.ELEMENT_NODE and \877 nodeName_ == 'serverHeaders':878 serverHeaders_ = ''879 for text__content_ in child_.childNodes:880 serverHeaders_ += text__content_.nodeValue881 self.serverHeaders.append(serverHeaders_)882 elif child_.nodeType == Node.ELEMENT_NODE and \883 nodeName_ == 'requestHeaders':884 requestHeaders_ = ''885 for text__content_ in child_.childNodes:886 requestHeaders_ += text__content_.nodeValue887 self.requestHeaders.append(requestHeaders_)888 elif child_.nodeType == Node.ELEMENT_NODE and \889 nodeName_ == 'error':890 error_ = ''891 for text__content_ in child_.childNodes:892 error_ += text__content_.nodeValue893 self.error.append(error_)894 elif child_.nodeType == Node.ELEMENT_NODE and \895 nodeName_ == 'disposition':896 disposition_ = ''897 for text__content_ in child_.childNodes:898 disposition_ += text__content_.nodeValue899 self.disposition.append(disposition_)900 self.validate_disposition(self.disposition) # validate type disposition901 elif child_.nodeType == Node.ELEMENT_NODE and \902 nodeName_ == 'output':903 output_ = ''904 for text__content_ in child_.childNodes:905 output_ += text__content_.nodeValue906 self.output.append(output_)907 elif child_.nodeType == Node.ELEMENT_NODE and \908 nodeName_ == 'dnsResolution':909 obj_ = dnsResolution.factory()910 obj_.build(child_)911 self.dnsResolution.append(obj_)912 elif child_.nodeType == Node.ELEMENT_NODE and \913 nodeName_ == 'contents':914 obj_ = contents.factory()915 obj_.build(child_)916 self.contents.append(obj_)917 elif child_.nodeType == Node.ELEMENT_NODE and \918 nodeName_ == 'outgoingLinks':919 obj_ = outgoingLinks.factory()920 obj_.build(child_)921 self.outgoingLinks.append(obj_)922 elif child_.nodeType == Node.ELEMENT_NODE and \923 nodeName_ == 'kit':924 obj_ = kit.factory()925 obj_.build(child_)926 self.kit.append(obj_)927 elif child_.nodeType == Node.ELEMENT_NODE and \928 nodeName_ == 'exploits':929 obj_ = exploits.factory()930 obj_.build(child_)931 self.exploits.append(obj_)932 elif child_.nodeType == Node.ELEMENT_NODE and \933 nodeName_ == 'classifications':934 obj_ = classifications.factory()935 obj_.build(child_)936 self.classifications.append(obj_)937# end class url938class disposition(GeneratedsSuper):939 subclass = None940 superclass = None941 def __init__(self, valueOf_=''):942 self.valueOf_ = valueOf_943 def factory(*args_, **kwargs_):944 if disposition.subclass:945 return disposition.subclass(*args_, **kwargs_)946 else:947 return disposition(*args_, **kwargs_)948 factory = staticmethod(factory)949 def getValueOf_(self): return self.valueOf_950 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_951 def export(self, outfile, level, namespace_='', name_='disposition', namespacedef_=''):952 showIndent(outfile, level)953 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))954 self.exportAttributes(outfile, level, namespace_, name_='disposition')955 if self.hasContent_():956 outfile.write('>')957 self.exportChildren(outfile, level + 1, namespace_, name_)958 outfile.write('</%s%s>\n' % (namespace_, name_))959 else:960 outfile.write('/>\n')961 def exportAttributes(self, outfile, level, namespace_='', name_='disposition'):962 pass963 def exportChildren(self, outfile, level, namespace_='', name_='disposition'):964 if self.valueOf_.find('![CDATA') > -1:965 value=quote_xml('%s' % self.valueOf_)966 value=value.replace('![CDATA','<![CDATA')967 value=value.replace(']]',']]>')968 outfile.write(value)969 else:970 outfile.write(quote_xml('%s' % self.valueOf_))971 def hasContent_(self):972 if (973 self.valueOf_974 ):975 return True976 else:977 return False978 def exportLiteral(self, outfile, level, name_='disposition'):979 level += 1980 self.exportLiteralAttributes(outfile, level, name_)981 if self.hasContent_():982 self.exportLiteralChildren(outfile, level, name_)983 def exportLiteralAttributes(self, outfile, level, name_):984 pass985 def exportLiteralChildren(self, outfile, level, name_):986 showIndent(outfile, level)987 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))988 def build(self, node_):989 attrs = node_.attributes990 self.buildAttributes(attrs)991 self.valueOf_ = ''992 for child_ in node_.childNodes:993 nodeName_ = child_.nodeName.split(':')[-1]994 self.buildChildren(child_, nodeName_)995 def buildAttributes(self, attrs):996 pass997 def buildChildren(self, child_, nodeName_):998 if child_.nodeType == Node.TEXT_NODE:999 self.valueOf_ += child_.nodeValue1000 elif child_.nodeType == Node.CDATA_SECTION_NODE:1001 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1002# end class disposition1003class dnsResolution(GeneratedsSuper):1004 subclass = None1005 superclass = None1006 def __init__(self, hostname=None, resolvesTo=None):1007 if hostname is None:1008 self.hostname = []1009 else:1010 self.hostname = hostname1011 if resolvesTo is None:1012 self.resolvesTo = []1013 else:1014 self.resolvesTo = resolvesTo1015 def factory(*args_, **kwargs_):1016 if dnsResolution.subclass:1017 return dnsResolution.subclass(*args_, **kwargs_)1018 else:1019 return dnsResolution(*args_, **kwargs_)1020 factory = staticmethod(factory)1021 def get_hostname(self): return self.hostname1022 def set_hostname(self, hostname): self.hostname = hostname1023 def add_hostname(self, value): self.hostname.append(value)1024 def insert_hostname(self, index, value): self.hostname[index] = value1025 def get_resolvesTo(self): return self.resolvesTo1026 def set_resolvesTo(self, resolvesTo): self.resolvesTo = resolvesTo1027 def add_resolvesTo(self, value): self.resolvesTo.append(value)1028 def insert_resolvesTo(self, index, value): self.resolvesTo[index] = value1029 def export(self, outfile, level, namespace_='', name_='dnsResolution', namespacedef_=''):1030 showIndent(outfile, level)1031 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1032 self.exportAttributes(outfile, level, namespace_, name_='dnsResolution')1033 if self.hasContent_():1034 outfile.write('>\n')1035 self.exportChildren(outfile, level + 1, namespace_, name_)1036 showIndent(outfile, level)1037 outfile.write('</%s%s>\n' % (namespace_, name_))1038 else:1039 outfile.write('/>\n')1040 def exportAttributes(self, outfile, level, namespace_='', name_='dnsResolution'):1041 pass1042 def exportChildren(self, outfile, level, namespace_='', name_='dnsResolution'):1043 for hostname_ in self.hostname:1044 showIndent(outfile, level)1045 outfile.write('<%shostname>%s</%shostname>\n' % (namespace_, self.format_string(quote_xml(hostname_).encode(ExternalEncoding), input_name='hostname'), namespace_))1046 for resolvesTo_ in self.resolvesTo:1047 resolvesTo_.export(outfile, level, namespace_, name_='resolvesTo')1048 def hasContent_(self):1049 if (1050 self.hostname or1051 self.resolvesTo1052 ):1053 return True1054 else:1055 return False1056 def exportLiteral(self, outfile, level, name_='dnsResolution'):1057 level += 11058 self.exportLiteralAttributes(outfile, level, name_)1059 if self.hasContent_():1060 self.exportLiteralChildren(outfile, level, name_)1061 def exportLiteralAttributes(self, outfile, level, name_):1062 pass1063 def exportLiteralChildren(self, outfile, level, name_):1064 showIndent(outfile, level)1065 outfile.write('hostname=[\n')1066 level += 11067 for hostname_ in self.hostname:1068 showIndent(outfile, level)1069 outfile.write('%s,\n' % quote_python(hostname_).encode(ExternalEncoding))1070 level -= 11071 showIndent(outfile, level)1072 outfile.write('],\n')1073 showIndent(outfile, level)1074 outfile.write('resolvesTo=[\n')1075 level += 11076 for resolvesTo_ in self.resolvesTo:1077 showIndent(outfile, level)1078 outfile.write('model_.resolvesTo(\n')1079 resolvesTo_.exportLiteral(outfile, level)1080 showIndent(outfile, level)1081 outfile.write('),\n')1082 level -= 11083 showIndent(outfile, level)1084 outfile.write('],\n')1085 def build(self, node_):1086 attrs = node_.attributes1087 self.buildAttributes(attrs)1088 for child_ in node_.childNodes:1089 nodeName_ = child_.nodeName.split(':')[-1]1090 self.buildChildren(child_, nodeName_)1091 def buildAttributes(self, attrs):1092 pass1093 def buildChildren(self, child_, nodeName_):1094 if child_.nodeType == Node.ELEMENT_NODE and \1095 nodeName_ == 'hostname':1096 hostname_ = ''1097 for text__content_ in child_.childNodes:1098 hostname_ += text__content_.nodeValue1099 self.hostname.append(hostname_)1100 elif child_.nodeType == Node.ELEMENT_NODE and \1101 nodeName_ == 'resolvesTo':1102 obj_ = resolvesTo.factory()1103 obj_.build(child_)1104 self.resolvesTo.append(obj_)1105# end class dnsResolution1106class resolvesTo(GeneratedsSuper):1107 subclass = None1108 superclass = None1109 def __init__(self, ipAddress=None, cname=None):1110 if ipAddress is None:1111 self.ipAddress = []1112 else:1113 self.ipAddress = ipAddress1114 if cname is None:1115 self.cname = []1116 else:1117 self.cname = cname1118 def factory(*args_, **kwargs_):1119 if resolvesTo.subclass:1120 return resolvesTo.subclass(*args_, **kwargs_)1121 else:1122 return resolvesTo(*args_, **kwargs_)1123 factory = staticmethod(factory)1124 def get_ipAddress(self): return self.ipAddress1125 def set_ipAddress(self, ipAddress): self.ipAddress = ipAddress1126 def add_ipAddress(self, value): self.ipAddress.append(value)1127 def insert_ipAddress(self, index, value): self.ipAddress[index] = value1128 def get_cname(self): return self.cname1129 def set_cname(self, cname): self.cname = cname1130 def add_cname(self, value): self.cname.append(value)1131 def insert_cname(self, index, value): self.cname[index] = value1132 def export(self, outfile, level, namespace_='', name_='resolvesTo', namespacedef_=''):1133 showIndent(outfile, level)1134 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1135 self.exportAttributes(outfile, level, namespace_, name_='resolvesTo')1136 if self.hasContent_():1137 outfile.write('>\n')1138 self.exportChildren(outfile, level + 1, namespace_, name_)1139 showIndent(outfile, level)1140 outfile.write('</%s%s>\n' % (namespace_, name_))1141 else:1142 outfile.write('/>\n')1143 def exportAttributes(self, outfile, level, namespace_='', name_='resolvesTo'):1144 pass1145 def exportChildren(self, outfile, level, namespace_='', name_='resolvesTo'):1146 for ipAddress_ in self.ipAddress:1147 ipAddress_.export(outfile, level, namespace_, name_='ipAddress')1148 for cname_ in self.cname:1149 cname_.export(outfile, level, namespace_, name_='cname')1150 def hasContent_(self):1151 if (1152 self.ipAddress or1153 self.cname1154 ):1155 return True1156 else:1157 return False1158 def exportLiteral(self, outfile, level, name_='resolvesTo'):1159 level += 11160 self.exportLiteralAttributes(outfile, level, name_)1161 if self.hasContent_():1162 self.exportLiteralChildren(outfile, level, name_)1163 def exportLiteralAttributes(self, outfile, level, name_):1164 pass1165 def exportLiteralChildren(self, outfile, level, name_):1166 showIndent(outfile, level)1167 outfile.write('ipAddress=[\n')1168 level += 11169 for ipAddress_ in self.ipAddress:1170 showIndent(outfile, level)1171 outfile.write('model_.ipAddress(\n')1172 ipAddress_.exportLiteral(outfile, level)1173 showIndent(outfile, level)1174 outfile.write('),\n')1175 level -= 11176 showIndent(outfile, level)1177 outfile.write('],\n')1178 showIndent(outfile, level)1179 outfile.write('cname=[\n')1180 level += 11181 for cname_ in self.cname:1182 showIndent(outfile, level)1183 outfile.write('model_.cname(\n')1184 cname_.exportLiteral(outfile, level)1185 showIndent(outfile, level)1186 outfile.write('),\n')1187 level -= 11188 showIndent(outfile, level)1189 outfile.write('],\n')1190 def build(self, node_):1191 attrs = node_.attributes1192 self.buildAttributes(attrs)1193 for child_ in node_.childNodes:1194 nodeName_ = child_.nodeName.split(':')[-1]1195 self.buildChildren(child_, nodeName_)1196 def buildAttributes(self, attrs):1197 pass1198 def buildChildren(self, child_, nodeName_):1199 if child_.nodeType == Node.ELEMENT_NODE and \1200 nodeName_ == 'ipAddress':1201 obj_ = ipAddress.factory()1202 obj_.build(child_)1203 self.ipAddress.append(obj_)1204 elif child_.nodeType == Node.ELEMENT_NODE and \1205 nodeName_ == 'cname':1206 obj_ = cname.factory()1207 obj_.build(child_)1208 self.cname.append(obj_)1209# end class resolvesTo1210class ipAddress(GeneratedsSuper):1211 subclass = None1212 superclass = None1213 def __init__(self, timestamp=None, family=None, valueOf_=''):1214 self.timestamp = _cast(None, timestamp)1215 self.family = _cast(None, family)1216 self.valueOf_ = valueOf_1217 def factory(*args_, **kwargs_):1218 if ipAddress.subclass:1219 return ipAddress.subclass(*args_, **kwargs_)1220 else:1221 return ipAddress(*args_, **kwargs_)1222 factory = staticmethod(factory)1223 def get_timestamp(self): return self.timestamp1224 def set_timestamp(self, timestamp): self.timestamp = timestamp1225 def get_family(self): return self.family1226 def set_family(self, family): self.family = family1227 def getValueOf_(self): return self.valueOf_1228 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1229 def export(self, outfile, level, namespace_='', name_='ipAddress', namespacedef_=''):1230 showIndent(outfile, level)1231 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1232 self.exportAttributes(outfile, level, namespace_, name_='ipAddress')1233 if self.hasContent_():1234 outfile.write('>')1235 self.exportChildren(outfile, level + 1, namespace_, name_)1236 outfile.write('</%s%s>\n' % (namespace_, name_))1237 else:1238 outfile.write('/>\n')1239 def exportAttributes(self, outfile, level, namespace_='', name_='ipAddress'):1240 if self.timestamp is not None:1241 outfile.write(' timestamp=%s' % (self.format_string(quote_attrib(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), ))1242 if self.family is not None:1243 outfile.write(' family=%s' % (self.format_string(quote_attrib(self.family).encode(ExternalEncoding), input_name='family'), ))1244 def exportChildren(self, outfile, level, namespace_='', name_='ipAddress'):1245 if self.valueOf_.find('![CDATA') > -1:1246 value=quote_xml('%s' % self.valueOf_)1247 value=value.replace('![CDATA','<![CDATA')1248 value=value.replace(']]',']]>')1249 outfile.write(value)1250 else:1251 outfile.write(quote_xml('%s' % self.valueOf_))1252 def hasContent_(self):1253 if (1254 self.valueOf_1255 ):1256 return True1257 else:1258 return False1259 def exportLiteral(self, outfile, level, name_='ipAddress'):1260 level += 11261 self.exportLiteralAttributes(outfile, level, name_)1262 if self.hasContent_():1263 self.exportLiteralChildren(outfile, level, name_)1264 def exportLiteralAttributes(self, outfile, level, name_):1265 if self.timestamp is not None:1266 showIndent(outfile, level)1267 outfile.write('timestamp = "%s",\n' % (self.timestamp,))1268 if self.family is not None:1269 showIndent(outfile, level)1270 outfile.write('family = "%s",\n' % (self.family,))1271 def exportLiteralChildren(self, outfile, level, name_):1272 showIndent(outfile, level)1273 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1274 def build(self, node_):1275 attrs = node_.attributes1276 self.buildAttributes(attrs)1277 self.valueOf_ = ''1278 for child_ in node_.childNodes:1279 nodeName_ = child_.nodeName.split(':')[-1]1280 self.buildChildren(child_, nodeName_)1281 def buildAttributes(self, attrs):1282 if attrs.get('timestamp'):1283 self.timestamp = attrs.get('timestamp').value1284 if attrs.get('family'):1285 self.family = attrs.get('family').value1286 def buildChildren(self, child_, nodeName_):1287 if child_.nodeType == Node.TEXT_NODE:1288 self.valueOf_ += child_.nodeValue1289 elif child_.nodeType == Node.CDATA_SECTION_NODE:1290 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1291# end class ipAddress1292class cname(GeneratedsSuper):1293 subclass = None1294 superclass = None1295 def __init__(self, timestamp=None, valueOf_=''):1296 self.timestamp = _cast(None, timestamp)1297 self.valueOf_ = valueOf_1298 def factory(*args_, **kwargs_):1299 if cname.subclass:1300 return cname.subclass(*args_, **kwargs_)1301 else:1302 return cname(*args_, **kwargs_)1303 factory = staticmethod(factory)1304 def get_timestamp(self): return self.timestamp1305 def set_timestamp(self, timestamp): self.timestamp = timestamp1306 def getValueOf_(self): return self.valueOf_1307 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1308 def export(self, outfile, level, namespace_='', name_='cname', namespacedef_=''):1309 showIndent(outfile, level)1310 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1311 self.exportAttributes(outfile, level, namespace_, name_='cname')1312 if self.hasContent_():1313 outfile.write('>')1314 self.exportChildren(outfile, level + 1, namespace_, name_)1315 outfile.write('</%s%s>\n' % (namespace_, name_))1316 else:1317 outfile.write('/>\n')1318 def exportAttributes(self, outfile, level, namespace_='', name_='cname'):1319 if self.timestamp is not None:1320 outfile.write(' timestamp=%s' % (self.format_string(quote_attrib(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), ))1321 def exportChildren(self, outfile, level, namespace_='', name_='cname'):1322 if self.valueOf_.find('![CDATA') > -1:1323 value=quote_xml('%s' % self.valueOf_)1324 value=value.replace('![CDATA','<![CDATA')1325 value=value.replace(']]',']]>')1326 outfile.write(value)1327 else:1328 outfile.write(quote_xml('%s' % self.valueOf_))1329 def hasContent_(self):1330 if (1331 self.valueOf_1332 ):1333 return True1334 else:1335 return False1336 def exportLiteral(self, outfile, level, name_='cname'):1337 level += 11338 self.exportLiteralAttributes(outfile, level, name_)1339 if self.hasContent_():1340 self.exportLiteralChildren(outfile, level, name_)1341 def exportLiteralAttributes(self, outfile, level, name_):1342 if self.timestamp is not None:1343 showIndent(outfile, level)1344 outfile.write('timestamp = "%s",\n' % (self.timestamp,))1345 def exportLiteralChildren(self, outfile, level, name_):1346 showIndent(outfile, level)1347 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1348 def build(self, node_):1349 attrs = node_.attributes1350 self.buildAttributes(attrs)1351 self.valueOf_ = ''1352 for child_ in node_.childNodes:1353 nodeName_ = child_.nodeName.split(':')[-1]1354 self.buildChildren(child_, nodeName_)1355 def buildAttributes(self, attrs):1356 if attrs.get('timestamp'):1357 self.timestamp = attrs.get('timestamp').value1358 def buildChildren(self, child_, nodeName_):1359 if child_.nodeType == Node.TEXT_NODE:1360 self.valueOf_ += child_.nodeValue1361 elif child_.nodeType == Node.CDATA_SECTION_NODE:1362 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1363# end class cname1364class contents(GeneratedsSuper):1365 subclass = None1366 superclass = None1367 def __init__(self, content=None, content_type=None, content_length=None, hashes=None):1368 if content is None:1369 self.content = []1370 else:1371 self.content = content1372 if content_type is None:1373 self.content_type = []1374 else:1375 self.content_type = content_type1376 if content_length is None:1377 self.content_length = []1378 else:1379 self.content_length = content_length1380 if hashes is None:1381 self.hashes = []1382 else:1383 self.hashes = hashes1384 def factory(*args_, **kwargs_):1385 if contents.subclass:1386 return contents.subclass(*args_, **kwargs_)1387 else:1388 return contents(*args_, **kwargs_)1389 factory = staticmethod(factory)1390 def get_content(self): return self.content1391 def set_content(self, content): self.content = content1392 def add_content(self, value): self.content.append(value)1393 def insert_content(self, index, value): self.content[index] = value1394 def get_content_type(self): return self.content_type1395 def set_content_type(self, content_type): self.content_type = content_type1396 def add_content_type(self, value): self.content_type.append(value)1397 def insert_content_type(self, index, value): self.content_type[index] = value1398 def get_content_length(self): return self.content_length1399 def set_content_length(self, content_length): self.content_length = content_length1400 def add_content_length(self, value): self.content_length.append(value)1401 def insert_content_length(self, index, value): self.content_length[index] = value1402 def get_hashes(self): return self.hashes1403 def set_hashes(self, hashes): self.hashes = hashes1404 def add_hashes(self, value): self.hashes.append(value)1405 def insert_hashes(self, index, value): self.hashes[index] = value1406 def export(self, outfile, level, namespace_='', name_='contents', namespacedef_=''):1407 showIndent(outfile, level)1408 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1409 self.exportAttributes(outfile, level, namespace_, name_='contents')1410 if self.hasContent_():1411 outfile.write('>\n')1412 self.exportChildren(outfile, level + 1, namespace_, name_)1413 showIndent(outfile, level)1414 outfile.write('</%s%s>\n' % (namespace_, name_))1415 else:1416 outfile.write('/>\n')1417 def exportAttributes(self, outfile, level, namespace_='', name_='contents'):1418 pass1419 def exportChildren(self, outfile, level, namespace_='', name_='contents'):1420 for content_ in self.content:1421 showIndent(outfile, level)1422 outfile.write('<%scontent>%s</%scontent>\n' % (namespace_, self.format_string(quote_xml(content_).encode(ExternalEncoding), input_name='content'), namespace_))1423 for content_type_ in self.content_type:1424 showIndent(outfile, level)1425 outfile.write('<%scontent_type>%s</%scontent_type>\n' % (namespace_, self.format_string(quote_xml(content_type_).encode(ExternalEncoding), input_name='content_type'), namespace_))1426 for content_length_ in self.content_length:1427 content_length_.export(outfile, level, namespace_, name_='content_length')1428 for hashes_ in self.hashes:1429 hashes_.export(outfile, level, namespace_, name_='hashes')1430 def hasContent_(self):1431 if (1432 self.content or1433 self.content_type or1434 self.content_length or1435 self.hashes1436 ):1437 return True1438 else:1439 return False1440 def exportLiteral(self, outfile, level, name_='contents'):1441 level += 11442 self.exportLiteralAttributes(outfile, level, name_)1443 if self.hasContent_():1444 self.exportLiteralChildren(outfile, level, name_)1445 def exportLiteralAttributes(self, outfile, level, name_):1446 pass1447 def exportLiteralChildren(self, outfile, level, name_):1448 showIndent(outfile, level)1449 outfile.write('content=[\n')1450 level += 11451 for content_ in self.content:1452 showIndent(outfile, level)1453 outfile.write('%s,\n' % quote_python(content_).encode(ExternalEncoding))1454 level -= 11455 showIndent(outfile, level)1456 outfile.write('],\n')1457 showIndent(outfile, level)1458 outfile.write('content_type=[\n')1459 level += 11460 for content_type_ in self.content_type:1461 showIndent(outfile, level)1462 outfile.write('%s,\n' % quote_python(content_type_).encode(ExternalEncoding))1463 level -= 11464 showIndent(outfile, level)1465 outfile.write('],\n')1466 showIndent(outfile, level)1467 outfile.write('content_length=[\n')1468 level += 11469 for content_length_ in self.content_length:1470 showIndent(outfile, level)1471 outfile.write('model_.content_length(\n')1472 content_length_.exportLiteral(outfile, level, name_='content-length')1473 showIndent(outfile, level)1474 outfile.write('),\n')1475 level -= 11476 showIndent(outfile, level)1477 outfile.write('],\n')1478 showIndent(outfile, level)1479 outfile.write('hashes=[\n')1480 level += 11481 for hashes_ in self.hashes:1482 showIndent(outfile, level)1483 outfile.write('model_.hashes(\n')1484 hashes_.exportLiteral(outfile, level)1485 showIndent(outfile, level)1486 outfile.write('),\n')1487 level -= 11488 showIndent(outfile, level)1489 outfile.write('],\n')1490 def build(self, node_):1491 attrs = node_.attributes1492 self.buildAttributes(attrs)1493 for child_ in node_.childNodes:1494 nodeName_ = child_.nodeName.split(':')[-1]1495 self.buildChildren(child_, nodeName_)1496 def buildAttributes(self, attrs):1497 pass1498 def buildChildren(self, child_, nodeName_):1499 if child_.nodeType == Node.ELEMENT_NODE and \1500 nodeName_ == 'content':1501 content_ = ''1502 for text__content_ in child_.childNodes:1503 content_ += text__content_.nodeValue1504 self.content.append(content_)1505 elif child_.nodeType == Node.ELEMENT_NODE and \1506 nodeName_ == 'content-type':1507 content_type_ = ''1508 for text__content_ in child_.childNodes:1509 content_type_ += text__content_.nodeValue1510 self.content_type.append(content_type_)1511 elif child_.nodeType == Node.ELEMENT_NODE and \1512 nodeName_ == 'content-length':1513 obj_ = content_length.factory()1514 obj_.build(child_)1515 self.content_length.append(obj_)1516 elif child_.nodeType == Node.ELEMENT_NODE and \1517 nodeName_ == 'hashes':1518 obj_ = hashes.factory()1519 obj_.build(child_)1520 self.hashes.append(obj_)1521# end class contents1522class content_length(GeneratedsSuper):1523 subclass = None1524 superclass = None1525 def __init__(self, units=None, valueOf_=''):1526 self.units = _cast(None, units)1527 self.valueOf_ = valueOf_1528 def factory(*args_, **kwargs_):1529 if content_length.subclass:1530 return content_length.subclass(*args_, **kwargs_)1531 else:1532 return content_length(*args_, **kwargs_)1533 factory = staticmethod(factory)1534 def get_units(self): return self.units1535 def set_units(self, units): self.units = units1536 def getValueOf_(self): return self.valueOf_1537 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1538 def export(self, outfile, level, namespace_='', name_='content-length', namespacedef_=''):1539 showIndent(outfile, level)1540 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1541 self.exportAttributes(outfile, level, namespace_, name_='content-length')1542 if self.hasContent_():1543 outfile.write('>')1544 self.exportChildren(outfile, level + 1, namespace_, name_)1545 outfile.write('</%s%s>\n' % (namespace_, name_))1546 else:1547 outfile.write('/>\n')1548 def exportAttributes(self, outfile, level, namespace_='', name_='content-length'):1549 if self.units is not None:1550 outfile.write(' units=%s' % (self.format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))1551 def exportChildren(self, outfile, level, namespace_='', name_='content-length'):1552 if self.valueOf_.find('![CDATA') > -1:1553 value=quote_xml('%s' % self.valueOf_)1554 value=value.replace('![CDATA','<![CDATA')1555 value=value.replace(']]',']]>')1556 outfile.write(value)1557 else:1558 outfile.write(quote_xml('%s' % self.valueOf_))1559 def hasContent_(self):1560 if (1561 self.valueOf_1562 ):1563 return True1564 else:1565 return False1566 def exportLiteral(self, outfile, level, name_='content-length'):1567 level += 11568 self.exportLiteralAttributes(outfile, level, name_)1569 if self.hasContent_():1570 self.exportLiteralChildren(outfile, level, name_)1571 def exportLiteralAttributes(self, outfile, level, name_):1572 if self.units is not None:1573 showIndent(outfile, level)1574 outfile.write('units = "%s",\n' % (self.units,))1575 def exportLiteralChildren(self, outfile, level, name_):1576 showIndent(outfile, level)1577 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1578 def build(self, node_):1579 attrs = node_.attributes1580 self.buildAttributes(attrs)1581 self.valueOf_ = ''1582 for child_ in node_.childNodes:1583 nodeName_ = child_.nodeName.split(':')[-1]1584 self.buildChildren(child_, nodeName_)1585 def buildAttributes(self, attrs):1586 if attrs.get('units'):1587 self.units = attrs.get('units').value1588 def buildChildren(self, child_, nodeName_):1589 if child_.nodeType == Node.TEXT_NODE:1590 self.valueOf_ += child_.nodeValue1591 elif child_.nodeType == Node.CDATA_SECTION_NODE:1592 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1593# end class content_length1594class hashes(GeneratedsSuper):1595 subclass = None1596 superclass = None1597 def __init__(self, hash=None):1598 if hash is None:1599 self.hash = []1600 else:1601 self.hash = hash1602 def factory(*args_, **kwargs_):1603 if hashes.subclass:1604 return hashes.subclass(*args_, **kwargs_)1605 else:1606 return hashes(*args_, **kwargs_)1607 factory = staticmethod(factory)1608 def get_hash(self): return self.hash1609 def set_hash(self, hash): self.hash = hash1610 def add_hash(self, value): self.hash.append(value)1611 def insert_hash(self, index, value): self.hash[index] = value1612 def export(self, outfile, level, namespace_='', name_='hashes', namespacedef_=''):1613 showIndent(outfile, level)1614 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1615 self.exportAttributes(outfile, level, namespace_, name_='hashes')1616 if self.hasContent_():1617 outfile.write('>\n')1618 self.exportChildren(outfile, level + 1, namespace_, name_)1619 showIndent(outfile, level)1620 outfile.write('</%s%s>\n' % (namespace_, name_))1621 else:1622 outfile.write('/>\n')1623 def exportAttributes(self, outfile, level, namespace_='', name_='hashes'):1624 pass1625 def exportChildren(self, outfile, level, namespace_='', name_='hashes'):1626 for hash_ in self.hash:1627 hash_.export(outfile, level, namespace_, name_='hash')1628 def hasContent_(self):1629 if (1630 self.hash1631 ):1632 return True1633 else:1634 return False1635 def exportLiteral(self, outfile, level, name_='hashes'):1636 level += 11637 self.exportLiteralAttributes(outfile, level, name_)1638 if self.hasContent_():1639 self.exportLiteralChildren(outfile, level, name_)1640 def exportLiteralAttributes(self, outfile, level, name_):1641 pass1642 def exportLiteralChildren(self, outfile, level, name_):1643 showIndent(outfile, level)1644 outfile.write('hash=[\n')1645 level += 11646 for hash_ in self.hash:1647 showIndent(outfile, level)1648 outfile.write('model_.hash(\n')1649 hash_.exportLiteral(outfile, level)1650 showIndent(outfile, level)1651 outfile.write('),\n')1652 level -= 11653 showIndent(outfile, level)1654 outfile.write('],\n')1655 def build(self, node_):1656 attrs = node_.attributes1657 self.buildAttributes(attrs)1658 for child_ in node_.childNodes:1659 nodeName_ = child_.nodeName.split(':')[-1]1660 self.buildChildren(child_, nodeName_)1661 def buildAttributes(self, attrs):1662 pass1663 def buildChildren(self, child_, nodeName_):1664 if child_.nodeType == Node.ELEMENT_NODE and \1665 nodeName_ == 'hash':1666 obj_ = hash.factory()1667 obj_.build(child_)1668 self.hash.append(obj_)1669# end class hashes1670class hash(GeneratedsSuper):1671 subclass = None1672 superclass = None1673 def __init__(self, algorithm=None, valueOf_=''):1674 self.algorithm = _cast(None, algorithm)1675 self.valueOf_ = valueOf_1676 def factory(*args_, **kwargs_):1677 if hash.subclass:1678 return hash.subclass(*args_, **kwargs_)1679 else:1680 return hash(*args_, **kwargs_)1681 factory = staticmethod(factory)1682 def get_algorithm(self): return self.algorithm1683 def set_algorithm(self, algorithm): self.algorithm = algorithm1684 def getValueOf_(self): return self.valueOf_1685 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1686 def export(self, outfile, level, namespace_='', name_='hash', namespacedef_=''):1687 showIndent(outfile, level)1688 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1689 self.exportAttributes(outfile, level, namespace_, name_='hash')1690 if self.hasContent_():1691 outfile.write('>')1692 self.exportChildren(outfile, level + 1, namespace_, name_)1693 outfile.write('</%s%s>\n' % (namespace_, name_))1694 else:1695 outfile.write('/>\n')1696 def exportAttributes(self, outfile, level, namespace_='', name_='hash'):1697 if self.algorithm is not None:1698 outfile.write(' algorithm=%s' % (quote_attrib(self.algorithm), ))1699 def exportChildren(self, outfile, level, namespace_='', name_='hash'):1700 if self.valueOf_.find('![CDATA') > -1:1701 value=quote_xml('%s' % self.valueOf_)1702 value=value.replace('![CDATA','<![CDATA')1703 value=value.replace(']]',']]>')1704 outfile.write(value)1705 else:1706 outfile.write(quote_xml('%s' % self.valueOf_))1707 def hasContent_(self):1708 if (1709 self.valueOf_1710 ):1711 return True1712 else:1713 return False1714 def exportLiteral(self, outfile, level, name_='hash'):1715 level += 11716 self.exportLiteralAttributes(outfile, level, name_)1717 if self.hasContent_():1718 self.exportLiteralChildren(outfile, level, name_)1719 def exportLiteralAttributes(self, outfile, level, name_):1720 if self.algorithm is not None:1721 showIndent(outfile, level)1722 outfile.write('algorithm = %s,\n' % (self.algorithm,))1723 def exportLiteralChildren(self, outfile, level, name_):1724 showIndent(outfile, level)1725 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1726 def build(self, node_):1727 attrs = node_.attributes1728 self.buildAttributes(attrs)1729 self.valueOf_ = ''1730 for child_ in node_.childNodes:1731 nodeName_ = child_.nodeName.split(':')[-1]1732 self.buildChildren(child_, nodeName_)1733 def buildAttributes(self, attrs):1734 if attrs.get('algorithm'):1735 self.algorithm = attrs.get('algorithm').value1736 def buildChildren(self, child_, nodeName_):1737 if child_.nodeType == Node.TEXT_NODE:1738 self.valueOf_ += child_.nodeValue1739 elif child_.nodeType == Node.CDATA_SECTION_NODE:1740 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1741# end class hash1742class outgoingLinks(GeneratedsSuper):1743 subclass = None1744 superclass = None1745 def __init__(self, link=None):1746 if link is None:1747 self.link = []1748 else:1749 self.link = link1750 def factory(*args_, **kwargs_):1751 if outgoingLinks.subclass:1752 return outgoingLinks.subclass(*args_, **kwargs_)1753 else:1754 return outgoingLinks(*args_, **kwargs_)1755 factory = staticmethod(factory)1756 def get_link(self): return self.link1757 def set_link(self, link): self.link = link1758 def add_link(self, value): self.link.append(value)1759 def insert_link(self, index, value): self.link[index] = value1760 def export(self, outfile, level, namespace_='', name_='outgoingLinks', namespacedef_=''):1761 showIndent(outfile, level)1762 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1763 self.exportAttributes(outfile, level, namespace_, name_='outgoingLinks')1764 if self.hasContent_():1765 outfile.write('>\n')1766 self.exportChildren(outfile, level + 1, namespace_, name_)1767 showIndent(outfile, level)1768 outfile.write('</%s%s>\n' % (namespace_, name_))1769 else:1770 outfile.write('/>\n')1771 def exportAttributes(self, outfile, level, namespace_='', name_='outgoingLinks'):1772 pass1773 def exportChildren(self, outfile, level, namespace_='', name_='outgoingLinks'):1774 for link_ in self.link:1775 link_.export(outfile, level, namespace_, name_='link')1776 def hasContent_(self):1777 if (1778 self.link1779 ):1780 return True1781 else:1782 return False1783 def exportLiteral(self, outfile, level, name_='outgoingLinks'):1784 level += 11785 self.exportLiteralAttributes(outfile, level, name_)1786 if self.hasContent_():1787 self.exportLiteralChildren(outfile, level, name_)1788 def exportLiteralAttributes(self, outfile, level, name_):1789 pass1790 def exportLiteralChildren(self, outfile, level, name_):1791 showIndent(outfile, level)1792 outfile.write('link=[\n')1793 level += 11794 for link_ in self.link:1795 showIndent(outfile, level)1796 outfile.write('model_.link(\n')1797 link_.exportLiteral(outfile, level)1798 showIndent(outfile, level)1799 outfile.write('),\n')1800 level -= 11801 showIndent(outfile, level)1802 outfile.write('],\n')1803 def build(self, node_):1804 attrs = node_.attributes1805 self.buildAttributes(attrs)1806 for child_ in node_.childNodes:1807 nodeName_ = child_.nodeName.split(':')[-1]1808 self.buildChildren(child_, nodeName_)1809 def buildAttributes(self, attrs):1810 pass1811 def buildChildren(self, child_, nodeName_):1812 if child_.nodeType == Node.ELEMENT_NODE and \1813 nodeName_ == 'link':1814 obj_ = link.factory()1815 obj_.build(child_)1816 self.link.append(obj_)1817# end class outgoingLinks1818class link(GeneratedsSuper):1819 subclass = None1820 superclass = None1821 def __init__(self, tag=None, valueOf_=''):1822 self.tag = _cast(None, tag)1823 self.valueOf_ = valueOf_1824 def factory(*args_, **kwargs_):1825 if link.subclass:1826 return link.subclass(*args_, **kwargs_)1827 else:1828 return link(*args_, **kwargs_)1829 factory = staticmethod(factory)1830 def get_tag(self): return self.tag1831 def set_tag(self, tag): self.tag = tag1832 def getValueOf_(self): return self.valueOf_1833 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1834 def export(self, outfile, level, namespace_='', name_='link', namespacedef_=''):1835 showIndent(outfile, level)1836 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1837 self.exportAttributes(outfile, level, namespace_, name_='link')1838 if self.hasContent_():1839 outfile.write('>')1840 self.exportChildren(outfile, level + 1, namespace_, name_)1841 outfile.write('</%s%s>\n' % (namespace_, name_))1842 else:1843 outfile.write('/>\n')1844 def exportAttributes(self, outfile, level, namespace_='', name_='link'):1845 if self.tag is not None:1846 outfile.write(' tag=%s' % (self.format_string(quote_attrib(self.tag).encode(ExternalEncoding), input_name='tag'), ))1847 def exportChildren(self, outfile, level, namespace_='', name_='link'):1848 if self.valueOf_.find('![CDATA') > -1:1849 value=quote_xml('%s' % self.valueOf_)1850 value=value.replace('![CDATA','<![CDATA')1851 value=value.replace(']]',']]>')1852 outfile.write(value)1853 else:1854 outfile.write(quote_xml('%s' % self.valueOf_))1855 def hasContent_(self):1856 if (1857 self.valueOf_1858 ):1859 return True1860 else:1861 return False1862 def exportLiteral(self, outfile, level, name_='link'):1863 level += 11864 self.exportLiteralAttributes(outfile, level, name_)1865 if self.hasContent_():1866 self.exportLiteralChildren(outfile, level, name_)1867 def exportLiteralAttributes(self, outfile, level, name_):1868 if self.tag is not None:1869 showIndent(outfile, level)1870 outfile.write('tag = "%s",\n' % (self.tag,))1871 def exportLiteralChildren(self, outfile, level, name_):1872 showIndent(outfile, level)1873 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1874 def build(self, node_):1875 attrs = node_.attributes1876 self.buildAttributes(attrs)1877 self.valueOf_ = ''1878 for child_ in node_.childNodes:1879 nodeName_ = child_.nodeName.split(':')[-1]1880 self.buildChildren(child_, nodeName_)1881 def buildAttributes(self, attrs):1882 if attrs.get('tag'):1883 self.tag = attrs.get('tag').value1884 def buildChildren(self, child_, nodeName_):1885 if child_.nodeType == Node.TEXT_NODE:1886 self.valueOf_ += child_.nodeValue1887 elif child_.nodeType == Node.CDATA_SECTION_NODE:1888 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1889# end class link1890class kit(GeneratedsSuper):1891 subclass = None1892 superclass = None1893 def __init__(self, version=None, valueOf_=''):1894 self.version = _cast(None, version)1895 self.valueOf_ = valueOf_1896 def factory(*args_, **kwargs_):1897 if kit.subclass:1898 return kit.subclass(*args_, **kwargs_)1899 else:1900 return kit(*args_, **kwargs_)1901 factory = staticmethod(factory)1902 def get_version(self): return self.version1903 def set_version(self, version): self.version = version1904 def getValueOf_(self): return self.valueOf_1905 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1906 def export(self, outfile, level, namespace_='', name_='kit', namespacedef_=''):1907 showIndent(outfile, level)1908 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1909 self.exportAttributes(outfile, level, namespace_, name_='kit')1910 if self.hasContent_():1911 outfile.write('>')1912 self.exportChildren(outfile, level + 1, namespace_, name_)1913 outfile.write('</%s%s>\n' % (namespace_, name_))1914 else:1915 outfile.write('/>\n')1916 def exportAttributes(self, outfile, level, namespace_='', name_='kit'):1917 if self.version is not None:1918 outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))1919 def exportChildren(self, outfile, level, namespace_='', name_='kit'):1920 if self.valueOf_.find('![CDATA') > -1:1921 value=quote_xml('%s' % self.valueOf_)1922 value=value.replace('![CDATA','<![CDATA')1923 value=value.replace(']]',']]>')1924 outfile.write(value)1925 else:1926 outfile.write(quote_xml('%s' % self.valueOf_))1927 def hasContent_(self):1928 if (1929 self.valueOf_1930 ):1931 return True1932 else:1933 return False1934 def exportLiteral(self, outfile, level, name_='kit'):1935 level += 11936 self.exportLiteralAttributes(outfile, level, name_)1937 if self.hasContent_():1938 self.exportLiteralChildren(outfile, level, name_)1939 def exportLiteralAttributes(self, outfile, level, name_):1940 if self.version is not None:1941 showIndent(outfile, level)1942 outfile.write('version = "%s",\n' % (self.version,))1943 def exportLiteralChildren(self, outfile, level, name_):1944 showIndent(outfile, level)1945 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))1946 def build(self, node_):1947 attrs = node_.attributes1948 self.buildAttributes(attrs)1949 self.valueOf_ = ''1950 for child_ in node_.childNodes:1951 nodeName_ = child_.nodeName.split(':')[-1]1952 self.buildChildren(child_, nodeName_)1953 def buildAttributes(self, attrs):1954 if attrs.get('version'):1955 self.version = attrs.get('version').value1956 def buildChildren(self, child_, nodeName_):1957 if child_.nodeType == Node.TEXT_NODE:1958 self.valueOf_ += child_.nodeValue1959 elif child_.nodeType == Node.CDATA_SECTION_NODE:1960 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1961# end class kit1962class exploits(GeneratedsSuper):1963 subclass = None1964 superclass = None1965 def __init__(self, exploit=None):1966 if exploit is None:1967 self.exploit = []1968 else:1969 self.exploit = exploit1970 def factory(*args_, **kwargs_):1971 if exploits.subclass:1972 return exploits.subclass(*args_, **kwargs_)1973 else:1974 return exploits(*args_, **kwargs_)1975 factory = staticmethod(factory)1976 def get_exploit(self): return self.exploit1977 def set_exploit(self, exploit): self.exploit = exploit1978 def add_exploit(self, value): self.exploit.append(value)1979 def insert_exploit(self, index, value): self.exploit[index] = value1980 def export(self, outfile, level, namespace_='', name_='exploits', namespacedef_=''):1981 showIndent(outfile, level)1982 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1983 self.exportAttributes(outfile, level, namespace_, name_='exploits')1984 if self.hasContent_():1985 outfile.write('>\n')1986 self.exportChildren(outfile, level + 1, namespace_, name_)1987 showIndent(outfile, level)1988 outfile.write('</%s%s>\n' % (namespace_, name_))1989 else:1990 outfile.write('/>\n')1991 def exportAttributes(self, outfile, level, namespace_='', name_='exploits'):1992 pass1993 def exportChildren(self, outfile, level, namespace_='', name_='exploits'):1994 for exploit_ in self.exploit:1995 exploit_.export(outfile, level, namespace_, name_='exploit')1996 def hasContent_(self):1997 if (1998 self.exploit1999 ):2000 return True2001 else:2002 return False2003 def exportLiteral(self, outfile, level, name_='exploits'):2004 level += 12005 self.exportLiteralAttributes(outfile, level, name_)2006 if self.hasContent_():2007 self.exportLiteralChildren(outfile, level, name_)2008 def exportLiteralAttributes(self, outfile, level, name_):2009 pass2010 def exportLiteralChildren(self, outfile, level, name_):2011 showIndent(outfile, level)2012 outfile.write('exploit=[\n')2013 level += 12014 for exploit_ in self.exploit:2015 showIndent(outfile, level)2016 outfile.write('model_.exploit(\n')2017 exploit_.exportLiteral(outfile, level)2018 showIndent(outfile, level)2019 outfile.write('),\n')2020 level -= 12021 showIndent(outfile, level)2022 outfile.write('],\n')2023 def build(self, node_):2024 attrs = node_.attributes2025 self.buildAttributes(attrs)2026 for child_ in node_.childNodes:2027 nodeName_ = child_.nodeName.split(':')[-1]2028 self.buildChildren(child_, nodeName_)2029 def buildAttributes(self, attrs):2030 pass2031 def buildChildren(self, child_, nodeName_):2032 if child_.nodeType == Node.ELEMENT_NODE and \2033 nodeName_ == 'exploit':2034 obj_ = exploit.factory()2035 obj_.build(child_)2036 self.exploit.append(obj_)2037# end class exploits2038class exploit(GeneratedsSuper):2039 subclass = None2040 superclass = None2041 def __init__(self, shellcode=None, vulnerability=None, module=None, consequence=None):2042 if shellcode is None:2043 self.shellcode = []2044 else:2045 self.shellcode = shellcode2046 if vulnerability is None:2047 self.vulnerability = []2048 else:2049 self.vulnerability = vulnerability2050 if module is None:2051 self.module = []2052 else:2053 self.module = module2054 if consequence is None:2055 self.consequence = []2056 else:2057 self.consequence = consequence2058 def factory(*args_, **kwargs_):2059 if exploit.subclass:2060 return exploit.subclass(*args_, **kwargs_)2061 else:2062 return exploit(*args_, **kwargs_)2063 factory = staticmethod(factory)2064 def get_shellcode(self): return self.shellcode2065 def set_shellcode(self, shellcode): self.shellcode = shellcode2066 def add_shellcode(self, value): self.shellcode.append(value)2067 def insert_shellcode(self, index, value): self.shellcode[index] = value2068 def get_vulnerability(self): return self.vulnerability2069 def set_vulnerability(self, vulnerability): self.vulnerability = vulnerability2070 def add_vulnerability(self, value): self.vulnerability.append(value)2071 def insert_vulnerability(self, index, value): self.vulnerability[index] = value2072 def get_module(self): return self.module2073 def set_module(self, module): self.module = module2074 def add_module(self, value): self.module.append(value)2075 def insert_module(self, index, value): self.module[index] = value2076 def get_consequence(self): return self.consequence2077 def set_consequence(self, consequence): self.consequence = consequence2078 def add_consequence(self, value): self.consequence.append(value)2079 def insert_consequence(self, index, value): self.consequence[index] = value2080 def export(self, outfile, level, namespace_='', name_='exploit', namespacedef_=''):2081 showIndent(outfile, level)2082 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2083 self.exportAttributes(outfile, level, namespace_, name_='exploit')2084 if self.hasContent_():2085 outfile.write('>\n')2086 self.exportChildren(outfile, level + 1, namespace_, name_)2087 showIndent(outfile, level)2088 outfile.write('</%s%s>\n' % (namespace_, name_))2089 else:2090 outfile.write('/>\n')2091 def exportAttributes(self, outfile, level, namespace_='', name_='exploit'):2092 pass2093 def exportChildren(self, outfile, level, namespace_='', name_='exploit'):2094 for shellcode_ in self.shellcode:2095 showIndent(outfile, level)2096 outfile.write('<%sshellcode>%s</%sshellcode>\n' % (namespace_, self.format_string(quote_xml(shellcode_).encode(ExternalEncoding), input_name='shellcode'), namespace_))2097 for vulnerability_ in self.vulnerability:2098 vulnerability_.export(outfile, level, namespace_, name_='vulnerability')2099 for module_ in self.module:2100 module_.export(outfile, level, namespace_, name_='module')2101 for consequence_ in self.consequence:2102 consequence_.export(outfile, level, namespace_, name_='consequence')2103 def hasContent_(self):2104 if (2105 self.shellcode or2106 self.vulnerability or2107 self.module or2108 self.consequence2109 ):2110 return True2111 else:2112 return False2113 def exportLiteral(self, outfile, level, name_='exploit'):2114 level += 12115 self.exportLiteralAttributes(outfile, level, name_)2116 if self.hasContent_():2117 self.exportLiteralChildren(outfile, level, name_)2118 def exportLiteralAttributes(self, outfile, level, name_):2119 pass2120 def exportLiteralChildren(self, outfile, level, name_):2121 showIndent(outfile, level)2122 outfile.write('shellcode=[\n')2123 level += 12124 for shellcode_ in self.shellcode:2125 showIndent(outfile, level)2126 outfile.write('%s,\n' % quote_python(shellcode_).encode(ExternalEncoding))2127 level -= 12128 showIndent(outfile, level)2129 outfile.write('],\n')2130 showIndent(outfile, level)2131 outfile.write('vulnerability=[\n')2132 level += 12133 for vulnerability_ in self.vulnerability:2134 showIndent(outfile, level)2135 outfile.write('model_.vulnerability(\n')2136 vulnerability_.exportLiteral(outfile, level)2137 showIndent(outfile, level)2138 outfile.write('),\n')2139 level -= 12140 showIndent(outfile, level)2141 outfile.write('],\n')2142 showIndent(outfile, level)2143 outfile.write('module=[\n')2144 level += 12145 for module_ in self.module:2146 showIndent(outfile, level)2147 outfile.write('model_.module(\n')2148 module_.exportLiteral(outfile, level)2149 showIndent(outfile, level)2150 outfile.write('),\n')2151 level -= 12152 showIndent(outfile, level)2153 outfile.write('],\n')2154 showIndent(outfile, level)2155 outfile.write('consequence=[\n')2156 level += 12157 for consequence_ in self.consequence:2158 showIndent(outfile, level)2159 outfile.write('model_.consequence(\n')2160 consequence_.exportLiteral(outfile, level)2161 showIndent(outfile, level)2162 outfile.write('),\n')2163 level -= 12164 showIndent(outfile, level)2165 outfile.write('],\n')2166 def build(self, node_):2167 attrs = node_.attributes2168 self.buildAttributes(attrs)2169 for child_ in node_.childNodes:2170 nodeName_ = child_.nodeName.split(':')[-1]2171 self.buildChildren(child_, nodeName_)2172 def buildAttributes(self, attrs):2173 pass2174 def buildChildren(self, child_, nodeName_):2175 if child_.nodeType == Node.ELEMENT_NODE and \2176 nodeName_ == 'shellcode':2177 shellcode_ = ''2178 for text__content_ in child_.childNodes:2179 shellcode_ += text__content_.nodeValue2180 self.shellcode.append(shellcode_)2181 elif child_.nodeType == Node.ELEMENT_NODE and \2182 nodeName_ == 'vulnerability':2183 obj_ = vulnerability.factory()2184 obj_.build(child_)2185 self.vulnerability.append(obj_)2186 elif child_.nodeType == Node.ELEMENT_NODE and \2187 nodeName_ == 'module':2188 obj_ = module.factory()2189 obj_.build(child_)2190 self.module.append(obj_)2191 elif child_.nodeType == Node.ELEMENT_NODE and \2192 nodeName_ == 'consequence':2193 obj_ = consequence.factory()2194 obj_.build(child_)2195 self.consequence.append(obj_)2196# end class exploit2197class vulnerability(GeneratedsSuper):2198 subclass = None2199 superclass = None2200 def __init__(self, id=None, valueOf_=''):2201 self.id = _cast(None, id)2202 self.valueOf_ = valueOf_2203 def factory(*args_, **kwargs_):2204 if vulnerability.subclass:2205 return vulnerability.subclass(*args_, **kwargs_)2206 else:2207 return vulnerability(*args_, **kwargs_)2208 factory = staticmethod(factory)2209 def get_id(self): return self.id2210 def set_id(self, id): self.id = id2211 def getValueOf_(self): return self.valueOf_2212 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2213 def export(self, outfile, level, namespace_='', name_='vulnerability', namespacedef_=''):2214 showIndent(outfile, level)2215 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2216 self.exportAttributes(outfile, level, namespace_, name_='vulnerability')2217 if self.hasContent_():2218 outfile.write('>')2219 self.exportChildren(outfile, level + 1, namespace_, name_)2220 outfile.write('</%s%s>\n' % (namespace_, name_))2221 else:2222 outfile.write('/>\n')2223 def exportAttributes(self, outfile, level, namespace_='', name_='vulnerability'):2224 if self.id is not None:2225 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))2226 def exportChildren(self, outfile, level, namespace_='', name_='vulnerability'):2227 if self.valueOf_.find('![CDATA') > -1:2228 value=quote_xml('%s' % self.valueOf_)2229 value=value.replace('![CDATA','<![CDATA')2230 value=value.replace(']]',']]>')2231 outfile.write(value)2232 else:2233 outfile.write(quote_xml('%s' % self.valueOf_))2234 def hasContent_(self):2235 if (2236 self.valueOf_2237 ):2238 return True2239 else:2240 return False2241 def exportLiteral(self, outfile, level, name_='vulnerability'):2242 level += 12243 self.exportLiteralAttributes(outfile, level, name_)2244 if self.hasContent_():2245 self.exportLiteralChildren(outfile, level, name_)2246 def exportLiteralAttributes(self, outfile, level, name_):2247 if self.id is not None:2248 showIndent(outfile, level)2249 outfile.write('id = "%s",\n' % (self.id,))2250 def exportLiteralChildren(self, outfile, level, name_):2251 showIndent(outfile, level)2252 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))2253 def build(self, node_):2254 attrs = node_.attributes2255 self.buildAttributes(attrs)2256 self.valueOf_ = ''2257 for child_ in node_.childNodes:2258 nodeName_ = child_.nodeName.split(':')[-1]2259 self.buildChildren(child_, nodeName_)2260 def buildAttributes(self, attrs):2261 if attrs.get('id'):2262 self.id = attrs.get('id').value2263 def buildChildren(self, child_, nodeName_):2264 if child_.nodeType == Node.TEXT_NODE:2265 self.valueOf_ += child_.nodeValue2266 elif child_.nodeType == Node.CDATA_SECTION_NODE:2267 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2268# end class vulnerability2269class module(GeneratedsSuper):2270 subclass = None2271 superclass = None2272 def __init__(self, clsname=None, clsid=None, valueOf_=''):2273 self.clsname = _cast(None, clsname)2274 self.clsid = _cast(None, clsid)2275 self.valueOf_ = valueOf_2276 def factory(*args_, **kwargs_):2277 if module.subclass:2278 return module.subclass(*args_, **kwargs_)2279 else:2280 return module(*args_, **kwargs_)2281 factory = staticmethod(factory)2282 def get_clsname(self): return self.clsname2283 def set_clsname(self, clsname): self.clsname = clsname2284 def get_clsid(self): return self.clsid2285 def set_clsid(self, clsid): self.clsid = clsid2286 def getValueOf_(self): return self.valueOf_2287 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2288 def export(self, outfile, level, namespace_='', name_='module', namespacedef_=''):2289 showIndent(outfile, level)2290 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2291 self.exportAttributes(outfile, level, namespace_, name_='module')2292 if self.hasContent_():2293 outfile.write('>')2294 self.exportChildren(outfile, level + 1, namespace_, name_)2295 outfile.write('</%s%s>\n' % (namespace_, name_))2296 else:2297 outfile.write('/>\n')2298 def exportAttributes(self, outfile, level, namespace_='', name_='module'):2299 if self.clsname is not None:2300 outfile.write(' clsname=%s' % (self.format_string(quote_attrib(self.clsname).encode(ExternalEncoding), input_name='clsname'), ))2301 if self.clsid is not None:2302 outfile.write(' clsid=%s' % (self.format_string(quote_attrib(self.clsid).encode(ExternalEncoding), input_name='clsid'), ))2303 def exportChildren(self, outfile, level, namespace_='', name_='module'):2304 if self.valueOf_.find('![CDATA') > -1:2305 value=quote_xml('%s' % self.valueOf_)2306 value=value.replace('![CDATA','<![CDATA')2307 value=value.replace(']]',']]>')2308 outfile.write(value)2309 else:2310 outfile.write(quote_xml('%s' % self.valueOf_))2311 def hasContent_(self):2312 if (2313 self.valueOf_2314 ):2315 return True2316 else:2317 return False2318 def exportLiteral(self, outfile, level, name_='module'):2319 level += 12320 self.exportLiteralAttributes(outfile, level, name_)2321 if self.hasContent_():2322 self.exportLiteralChildren(outfile, level, name_)2323 def exportLiteralAttributes(self, outfile, level, name_):2324 if self.clsname is not None:2325 showIndent(outfile, level)2326 outfile.write('clsname = "%s",\n' % (self.clsname,))2327 if self.clsid is not None:2328 showIndent(outfile, level)2329 outfile.write('clsid = "%s",\n' % (self.clsid,))2330 def exportLiteralChildren(self, outfile, level, name_):2331 showIndent(outfile, level)2332 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))2333 def build(self, node_):2334 attrs = node_.attributes2335 self.buildAttributes(attrs)2336 self.valueOf_ = ''2337 for child_ in node_.childNodes:2338 nodeName_ = child_.nodeName.split(':')[-1]2339 self.buildChildren(child_, nodeName_)2340 def buildAttributes(self, attrs):2341 if attrs.get('clsname'):2342 self.clsname = attrs.get('clsname').value2343 if attrs.get('clsid'):2344 self.clsid = attrs.get('clsid').value2345 def buildChildren(self, child_, nodeName_):2346 if child_.nodeType == Node.TEXT_NODE:2347 self.valueOf_ += child_.nodeValue2348 elif child_.nodeType == Node.CDATA_SECTION_NODE:2349 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2350# end class module2351class consequence(GeneratedsSuper):2352 subclass = None2353 superclass = None2354 def __init__(self, type_=None, additionalData=None):2355 self.type_ = _cast(None, type_)2356 if additionalData is None:2357 self.additionalData = []2358 else:2359 self.additionalData = additionalData2360 def factory(*args_, **kwargs_):2361 if consequence.subclass:2362 return consequence.subclass(*args_, **kwargs_)2363 else:2364 return consequence(*args_, **kwargs_)2365 factory = staticmethod(factory)2366 def get_additionalData(self): return self.additionalData2367 def set_additionalData(self, additionalData): self.additionalData = additionalData2368 def add_additionalData(self, value): self.additionalData.append(value)2369 def insert_additionalData(self, index, value): self.additionalData[index] = value2370 def get_type(self): return self.type_2371 def set_type(self, type_): self.type_ = type_2372 def export(self, outfile, level, namespace_='', name_='consequence', namespacedef_=''):2373 showIndent(outfile, level)2374 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2375 self.exportAttributes(outfile, level, namespace_, name_='consequence')2376 if self.hasContent_():2377 outfile.write('>\n')2378 self.exportChildren(outfile, level + 1, namespace_, name_)2379 showIndent(outfile, level)2380 outfile.write('</%s%s>\n' % (namespace_, name_))2381 else:2382 outfile.write('/>\n')2383 def exportAttributes(self, outfile, level, namespace_='', name_='consequence'):2384 if self.type_ is not None:2385 outfile.write(' type=%s' % (self.format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))2386 def exportChildren(self, outfile, level, namespace_='', name_='consequence'):2387 for additionalData_ in self.additionalData:2388 showIndent(outfile, level)2389 outfile.write('<%sadditionalData>%s</%sadditionalData>\n' % (namespace_, self.format_string(quote_xml(additionalData_).encode(ExternalEncoding), input_name='additionalData'), namespace_))2390 def hasContent_(self):2391 if (2392 self.additionalData2393 ):2394 return True2395 else:2396 return False2397 def exportLiteral(self, outfile, level, name_='consequence'):2398 level += 12399 self.exportLiteralAttributes(outfile, level, name_)2400 if self.hasContent_():2401 self.exportLiteralChildren(outfile, level, name_)2402 def exportLiteralAttributes(self, outfile, level, name_):2403 if self.type_ is not None:2404 showIndent(outfile, level)2405 outfile.write('type_ = "%s",\n' % (self.type_,))2406 def exportLiteralChildren(self, outfile, level, name_):2407 showIndent(outfile, level)2408 outfile.write('additionalData=[\n')2409 level += 12410 for additionalData_ in self.additionalData:2411 showIndent(outfile, level)2412 outfile.write('%s,\n' % quote_python(additionalData_).encode(ExternalEncoding))2413 level -= 12414 showIndent(outfile, level)2415 outfile.write('],\n')2416 def build(self, node_):2417 attrs = node_.attributes2418 self.buildAttributes(attrs)2419 for child_ in node_.childNodes:2420 nodeName_ = child_.nodeName.split(':')[-1]2421 self.buildChildren(child_, nodeName_)2422 def buildAttributes(self, attrs):2423 if attrs.get('type'):2424 self.type_ = attrs.get('type').value2425 def buildChildren(self, child_, nodeName_):2426 if child_.nodeType == Node.ELEMENT_NODE and \2427 nodeName_ == 'additionalData':2428 additionalData_ = ''2429 for text__content_ in child_.childNodes:2430 additionalData_ += text__content_.nodeValue2431 self.additionalData.append(additionalData_)2432# end class consequence2433class classifications(GeneratedsSuper):2434 subclass = None2435 superclass = None2436 def __init__(self, classification=None):2437 if classification is None:2438 self.classification = []2439 else:2440 self.classification = classification2441 def factory(*args_, **kwargs_):2442 if classifications.subclass:2443 return classifications.subclass(*args_, **kwargs_)2444 else:2445 return classifications(*args_, **kwargs_)2446 factory = staticmethod(factory)2447 def get_classification(self): return self.classification2448 def set_classification(self, classification): self.classification = classification2449 def add_classification(self, value): self.classification.append(value)2450 def insert_classification(self, index, value): self.classification[index] = value2451 def export(self, outfile, level, namespace_='', name_='classifications', namespacedef_=''):2452 showIndent(outfile, level)2453 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2454 self.exportAttributes(outfile, level, namespace_, name_='classifications')2455 if self.hasContent_():2456 outfile.write('>\n')2457 self.exportChildren(outfile, level + 1, namespace_, name_)2458 showIndent(outfile, level)2459 outfile.write('</%s%s>\n' % (namespace_, name_))2460 else:2461 outfile.write('/>\n')2462 def exportAttributes(self, outfile, level, namespace_='', name_='classifications'):2463 pass2464 def exportChildren(self, outfile, level, namespace_='', name_='classifications'):2465 for classification_ in self.classification:2466 classification_.export(outfile, level, namespace_, name_='classification')2467 def hasContent_(self):2468 if (2469 self.classification2470 ):2471 return True2472 else:2473 return False2474 def exportLiteral(self, outfile, level, name_='classifications'):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('classification=[\n')2484 level += 12485 for classification_ in self.classification:2486 showIndent(outfile, level)2487 outfile.write('model_.classification(\n')2488 classification_.exportLiteral(outfile, level)2489 showIndent(outfile, level)2490 outfile.write('),\n')2491 level -= 12492 showIndent(outfile, level)2493 outfile.write('],\n')2494 def build(self, node_):2495 attrs = node_.attributes2496 self.buildAttributes(attrs)2497 for child_ in node_.childNodes:2498 nodeName_ = child_.nodeName.split(':')[-1]2499 self.buildChildren(child_, nodeName_)2500 def buildAttributes(self, attrs):2501 pass2502 def buildChildren(self, child_, nodeName_):2503 if child_.nodeType == Node.ELEMENT_NODE and \2504 nodeName_ == 'classification':2505 obj_ = classification.factory()2506 obj_.build(child_)2507 self.classification.append(obj_)2508# end class classifications2509class classification(GeneratedsSuper):2510 subclass = None2511 superclass = None2512 def __init__(self, antivirus=None, urlbls=None):2513 if antivirus is None:2514 self.antivirus = []2515 else:2516 self.antivirus = antivirus2517 if urlbls is None:2518 self.urlbls = []2519 else:2520 self.urlbls = urlbls2521 def factory(*args_, **kwargs_):2522 if classification.subclass:2523 return classification.subclass(*args_, **kwargs_)2524 else:2525 return classification(*args_, **kwargs_)2526 factory = staticmethod(factory)2527 def get_antivirus(self): return self.antivirus2528 def set_antivirus(self, antivirus): self.antivirus = antivirus2529 def add_antivirus(self, value): self.antivirus.append(value)2530 def insert_antivirus(self, index, value): self.antivirus[index] = value2531 def get_urlbls(self): return self.urlbls2532 def set_urlbls(self, urlbls): self.urlbls = urlbls2533 def add_urlbls(self, value): self.urlbls.append(value)2534 def insert_urlbls(self, index, value): self.urlbls[index] = value2535 def export(self, outfile, level, namespace_='', name_='classification', namespacedef_=''):2536 showIndent(outfile, level)2537 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2538 self.exportAttributes(outfile, level, namespace_, name_='classification')2539 if self.hasContent_():2540 outfile.write('>\n')2541 self.exportChildren(outfile, level + 1, namespace_, name_)2542 showIndent(outfile, level)2543 outfile.write('</%s%s>\n' % (namespace_, name_))2544 else:2545 outfile.write('/>\n')2546 def exportAttributes(self, outfile, level, namespace_='', name_='classification'):2547 pass2548 def exportChildren(self, outfile, level, namespace_='', name_='classification'):2549 for antivirus_ in self.antivirus:2550 antivirus_.export(outfile, level, namespace_, name_='antivirus')2551 for urlbls_ in self.urlbls:2552 urlbls_.export(outfile, level, namespace_, name_='urlbls')2553 def hasContent_(self):2554 if (2555 self.antivirus or2556 self.urlbls2557 ):2558 return True2559 else:2560 return False2561 def exportLiteral(self, outfile, level, name_='classification'):2562 level += 12563 self.exportLiteralAttributes(outfile, level, name_)2564 if self.hasContent_():2565 self.exportLiteralChildren(outfile, level, name_)2566 def exportLiteralAttributes(self, outfile, level, name_):2567 pass2568 def exportLiteralChildren(self, outfile, level, name_):2569 showIndent(outfile, level)2570 outfile.write('antivirus=[\n')2571 level += 12572 for antivirus_ in self.antivirus:2573 showIndent(outfile, level)2574 outfile.write('model_.antivirus(\n')2575 antivirus_.exportLiteral(outfile, level)2576 showIndent(outfile, level)2577 outfile.write('),\n')2578 level -= 12579 showIndent(outfile, level)2580 outfile.write('],\n')2581 showIndent(outfile, level)2582 outfile.write('urlbls=[\n')2583 level += 12584 for urlbls_ in self.urlbls:2585 showIndent(outfile, level)2586 outfile.write('model_.urlbls(\n')2587 urlbls_.exportLiteral(outfile, level)2588 showIndent(outfile, level)2589 outfile.write('),\n')2590 level -= 12591 showIndent(outfile, level)2592 outfile.write('],\n')2593 def build(self, node_):2594 attrs = node_.attributes2595 self.buildAttributes(attrs)2596 for child_ in node_.childNodes:2597 nodeName_ = child_.nodeName.split(':')[-1]2598 self.buildChildren(child_, nodeName_)2599 def buildAttributes(self, attrs):2600 pass2601 def buildChildren(self, child_, nodeName_):2602 if child_.nodeType == Node.ELEMENT_NODE and \2603 nodeName_ == 'antivirus':2604 obj_ = antivirus.factory()2605 obj_.build(child_)2606 self.antivirus.append(obj_)2607 elif child_.nodeType == Node.ELEMENT_NODE and \2608 nodeName_ == 'urlbls':2609 obj_ = urlbls.factory()2610 obj_.build(child_)2611 self.urlbls.append(obj_)2612# end class classification2613class antivirus(GeneratedsSuper):2614 subclass = None2615 superclass = None2616 def __init__(self, engine=None, version=None, datVersion=None, timestamp=None, result=None):2617 if engine is None:2618 self.engine = []2619 else:2620 self.engine = engine2621 if version is None:2622 self.version = []2623 else:2624 self.version = version2625 if datVersion is None:2626 self.datVersion = []2627 else:2628 self.datVersion = datVersion2629 if timestamp is None:2630 self.timestamp = []2631 else:2632 self.timestamp = timestamp2633 if result is None:2634 self.result = []2635 else:2636 self.result = result2637 def factory(*args_, **kwargs_):2638 if antivirus.subclass:2639 return antivirus.subclass(*args_, **kwargs_)2640 else:2641 return antivirus(*args_, **kwargs_)2642 factory = staticmethod(factory)2643 def get_engine(self): return self.engine2644 def set_engine(self, engine): self.engine = engine2645 def add_engine(self, value): self.engine.append(value)2646 def insert_engine(self, index, value): self.engine[index] = value2647 def get_version(self): return self.version2648 def set_version(self, version): self.version = version2649 def add_version(self, value): self.version.append(value)2650 def insert_version(self, index, value): self.version[index] = value2651 def get_datVersion(self): return self.datVersion2652 def set_datVersion(self, datVersion): self.datVersion = datVersion2653 def add_datVersion(self, value): self.datVersion.append(value)2654 def insert_datVersion(self, index, value): self.datVersion[index] = value2655 def get_timestamp(self): return self.timestamp2656 def set_timestamp(self, timestamp): self.timestamp = timestamp2657 def add_timestamp(self, value): self.timestamp.append(value)2658 def insert_timestamp(self, index, value): self.timestamp[index] = value2659 def get_result(self): return self.result2660 def set_result(self, result): self.result = result2661 def add_result(self, value): self.result.append(value)2662 def insert_result(self, index, value): self.result[index] = value2663 def export(self, outfile, level, namespace_='', name_='antivirus', namespacedef_=''):2664 showIndent(outfile, level)2665 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2666 self.exportAttributes(outfile, level, namespace_, name_='antivirus')2667 if self.hasContent_():2668 outfile.write('>\n')2669 self.exportChildren(outfile, level + 1, namespace_, name_)2670 showIndent(outfile, level)2671 outfile.write('</%s%s>\n' % (namespace_, name_))2672 else:2673 outfile.write('/>\n')2674 def exportAttributes(self, outfile, level, namespace_='', name_='antivirus'):2675 pass2676 def exportChildren(self, outfile, level, namespace_='', name_='antivirus'):2677 for engine_ in self.engine:2678 showIndent(outfile, level)2679 outfile.write('<%sengine>%s</%sengine>\n' % (namespace_, self.format_string(quote_xml(engine_).encode(ExternalEncoding), input_name='engine'), namespace_))2680 for version_ in self.version:2681 showIndent(outfile, level)2682 outfile.write('<%sversion>%s</%sversion>\n' % (namespace_, self.format_string(quote_xml(version_).encode(ExternalEncoding), input_name='version'), namespace_))2683 for datVersion_ in self.datVersion:2684 showIndent(outfile, level)2685 outfile.write('<%sdatVersion>%s</%sdatVersion>\n' % (namespace_, self.format_string(quote_xml(datVersion_).encode(ExternalEncoding), input_name='datVersion'), namespace_))2686 for timestamp_ in self.timestamp:2687 showIndent(outfile, level)2688 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.format_string(quote_xml(timestamp_).encode(ExternalEncoding), input_name='timestamp'), namespace_))2689 for result_ in self.result:2690 showIndent(outfile, level)2691 outfile.write('<%sresult>%s</%sresult>\n' % (namespace_, self.format_string(quote_xml(result_).encode(ExternalEncoding), input_name='result'), namespace_))2692 def hasContent_(self):2693 if (2694 self.engine or2695 self.version or2696 self.datVersion or2697 self.timestamp or2698 self.result2699 ):2700 return True2701 else:2702 return False2703 def exportLiteral(self, outfile, level, name_='antivirus'):2704 level += 12705 self.exportLiteralAttributes(outfile, level, name_)2706 if self.hasContent_():2707 self.exportLiteralChildren(outfile, level, name_)2708 def exportLiteralAttributes(self, outfile, level, name_):2709 pass2710 def exportLiteralChildren(self, outfile, level, name_):2711 showIndent(outfile, level)2712 outfile.write('engine=[\n')2713 level += 12714 for engine_ in self.engine:2715 showIndent(outfile, level)2716 outfile.write('%s,\n' % quote_python(engine_).encode(ExternalEncoding))2717 level -= 12718 showIndent(outfile, level)2719 outfile.write('],\n')2720 showIndent(outfile, level)2721 outfile.write('version=[\n')2722 level += 12723 for version_ in self.version:2724 showIndent(outfile, level)2725 outfile.write('%s,\n' % quote_python(version_).encode(ExternalEncoding))2726 level -= 12727 showIndent(outfile, level)2728 outfile.write('],\n')2729 showIndent(outfile, level)2730 outfile.write('datVersion=[\n')2731 level += 12732 for datVersion_ in self.datVersion:2733 showIndent(outfile, level)2734 outfile.write('%s,\n' % quote_python(datVersion_).encode(ExternalEncoding))2735 level -= 12736 showIndent(outfile, level)2737 outfile.write('],\n')2738 showIndent(outfile, level)2739 outfile.write('timestamp=[\n')2740 level += 12741 for timestamp_ in self.timestamp:2742 showIndent(outfile, level)2743 outfile.write('%s,\n' % quote_python(timestamp_).encode(ExternalEncoding))2744 level -= 12745 showIndent(outfile, level)2746 outfile.write('],\n')2747 showIndent(outfile, level)2748 outfile.write('result=[\n')2749 level += 12750 for result_ in self.result:2751 showIndent(outfile, level)2752 outfile.write('%s,\n' % quote_python(result_).encode(ExternalEncoding))2753 level -= 12754 showIndent(outfile, level)2755 outfile.write('],\n')2756 def build(self, node_):2757 attrs = node_.attributes2758 self.buildAttributes(attrs)2759 for child_ in node_.childNodes:2760 nodeName_ = child_.nodeName.split(':')[-1]2761 self.buildChildren(child_, nodeName_)2762 def buildAttributes(self, attrs):2763 pass2764 def buildChildren(self, child_, nodeName_):2765 if child_.nodeType == Node.ELEMENT_NODE and \2766 nodeName_ == 'engine':2767 engine_ = ''2768 for text__content_ in child_.childNodes:2769 engine_ += text__content_.nodeValue2770 self.engine.append(engine_)2771 elif child_.nodeType == Node.ELEMENT_NODE and \2772 nodeName_ == 'version':2773 version_ = ''2774 for text__content_ in child_.childNodes:2775 version_ += text__content_.nodeValue2776 self.version.append(version_)2777 elif child_.nodeType == Node.ELEMENT_NODE and \2778 nodeName_ == 'datVersion':2779 datVersion_ = ''2780 for text__content_ in child_.childNodes:2781 datVersion_ += text__content_.nodeValue2782 self.datVersion.append(datVersion_)2783 elif child_.nodeType == Node.ELEMENT_NODE and \2784 nodeName_ == 'timestamp':2785 timestamp_ = ''2786 for text__content_ in child_.childNodes:2787 timestamp_ += text__content_.nodeValue2788 self.timestamp.append(timestamp_)2789 elif child_.nodeType == Node.ELEMENT_NODE and \2790 nodeName_ == 'result':2791 result_ = ''2792 for text__content_ in child_.childNodes:2793 result_ += text__content_.nodeValue2794 self.result.append(result_)2795# end class antivirus2796class urlbls(GeneratedsSuper):2797 subclass = None2798 superclass = None2799 def __init__(self, urlbl=None):2800 if urlbl is None:2801 self.urlbl = []2802 else:2803 self.urlbl = urlbl2804 def factory(*args_, **kwargs_):2805 if urlbls.subclass:2806 return urlbls.subclass(*args_, **kwargs_)2807 else:2808 return urlbls(*args_, **kwargs_)2809 factory = staticmethod(factory)2810 def get_urlbl(self): return self.urlbl2811 def set_urlbl(self, urlbl): self.urlbl = urlbl2812 def add_urlbl(self, value): self.urlbl.append(value)2813 def insert_urlbl(self, index, value): self.urlbl[index] = value2814 def export(self, outfile, level, namespace_='', name_='urlbls', namespacedef_=''):2815 showIndent(outfile, level)2816 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2817 self.exportAttributes(outfile, level, namespace_, name_='urlbls')2818 if self.hasContent_():2819 outfile.write('>\n')2820 self.exportChildren(outfile, level + 1, namespace_, name_)2821 showIndent(outfile, level)2822 outfile.write('</%s%s>\n' % (namespace_, name_))2823 else:2824 outfile.write('/>\n')2825 def exportAttributes(self, outfile, level, namespace_='', name_='urlbls'):2826 pass2827 def exportChildren(self, outfile, level, namespace_='', name_='urlbls'):2828 for urlbl_ in self.urlbl:2829 urlbl_.export(outfile, level, namespace_, name_='urlbl')2830 def hasContent_(self):2831 if (2832 self.urlbl2833 ):2834 return True2835 else:2836 return False2837 def exportLiteral(self, outfile, level, name_='urlbls'):2838 level += 12839 self.exportLiteralAttributes(outfile, level, name_)2840 if self.hasContent_():2841 self.exportLiteralChildren(outfile, level, name_)2842 def exportLiteralAttributes(self, outfile, level, name_):2843 pass2844 def exportLiteralChildren(self, outfile, level, name_):2845 showIndent(outfile, level)2846 outfile.write('urlbl=[\n')2847 level += 12848 for urlbl_ in self.urlbl:2849 showIndent(outfile, level)2850 outfile.write('model_.urlbl(\n')2851 urlbl_.exportLiteral(outfile, level)2852 showIndent(outfile, level)2853 outfile.write('),\n')2854 level -= 12855 showIndent(outfile, level)2856 outfile.write('],\n')2857 def build(self, node_):2858 attrs = node_.attributes2859 self.buildAttributes(attrs)2860 for child_ in node_.childNodes:2861 nodeName_ = child_.nodeName.split(':')[-1]2862 self.buildChildren(child_, nodeName_)2863 def buildAttributes(self, attrs):2864 pass2865 def buildChildren(self, child_, nodeName_):2866 if child_.nodeType == Node.ELEMENT_NODE and \2867 nodeName_ == 'urlbl':2868 obj_ = urlbl.factory()2869 obj_.build(child_)2870 self.urlbl.append(obj_)2871# end class urlbls2872class urlbl(GeneratedsSuper):2873 subclass = None2874 superclass = None2875 def __init__(self, bl=None, timestamp=None, result=None):2876 if bl is None:2877 self.bl = []2878 else:2879 self.bl = bl2880 if timestamp is None:2881 self.timestamp = []2882 else:2883 self.timestamp = timestamp2884 if result is None:2885 self.result = []2886 else:2887 self.result = result2888 def factory(*args_, **kwargs_):2889 if urlbl.subclass:2890 return urlbl.subclass(*args_, **kwargs_)2891 else:2892 return urlbl(*args_, **kwargs_)2893 factory = staticmethod(factory)2894 def get_bl(self): return self.bl2895 def set_bl(self, bl): self.bl = bl2896 def add_bl(self, value): self.bl.append(value)2897 def insert_bl(self, index, value): self.bl[index] = value2898 def get_timestamp(self): return self.timestamp2899 def set_timestamp(self, timestamp): self.timestamp = timestamp2900 def add_timestamp(self, value): self.timestamp.append(value)2901 def insert_timestamp(self, index, value): self.timestamp[index] = value2902 def get_result(self): return self.result2903 def set_result(self, result): self.result = result2904 def add_result(self, value): self.result.append(value)2905 def insert_result(self, index, value): self.result[index] = value2906 def export(self, outfile, level, namespace_='', name_='urlbl', namespacedef_=''):2907 showIndent(outfile, level)2908 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2909 self.exportAttributes(outfile, level, namespace_, name_='urlbl')2910 if self.hasContent_():2911 outfile.write('>\n')2912 self.exportChildren(outfile, level + 1, namespace_, name_)2913 showIndent(outfile, level)2914 outfile.write('</%s%s>\n' % (namespace_, name_))2915 else:2916 outfile.write('/>\n')2917 def exportAttributes(self, outfile, level, namespace_='', name_='urlbl'):2918 pass2919 def exportChildren(self, outfile, level, namespace_='', name_='urlbl'):2920 for bl_ in self.bl:2921 showIndent(outfile, level)2922 outfile.write('<%sbl>%s</%sbl>\n' % (namespace_, self.format_string(quote_xml(bl_).encode(ExternalEncoding), input_name='bl'), namespace_))2923 for timestamp_ in self.timestamp:2924 showIndent(outfile, level)2925 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.format_string(quote_xml(timestamp_).encode(ExternalEncoding), input_name='timestamp'), namespace_))2926 for result_ in self.result:2927 showIndent(outfile, level)2928 outfile.write('<%sresult>%s</%sresult>\n' % (namespace_, self.format_string(quote_xml(result_).encode(ExternalEncoding), input_name='result'), namespace_))2929 def hasContent_(self):2930 if (2931 self.bl or2932 self.timestamp or2933 self.result2934 ):2935 return True2936 else:2937 return False2938 def exportLiteral(self, outfile, level, name_='urlbl'):2939 level += 12940 self.exportLiteralAttributes(outfile, level, name_)2941 if self.hasContent_():2942 self.exportLiteralChildren(outfile, level, name_)2943 def exportLiteralAttributes(self, outfile, level, name_):2944 pass2945 def exportLiteralChildren(self, outfile, level, name_):2946 showIndent(outfile, level)2947 outfile.write('bl=[\n')2948 level += 12949 for bl_ in self.bl:2950 showIndent(outfile, level)2951 outfile.write('%s,\n' % quote_python(bl_).encode(ExternalEncoding))2952 level -= 12953 showIndent(outfile, level)2954 outfile.write('],\n')2955 showIndent(outfile, level)2956 outfile.write('timestamp=[\n')2957 level += 12958 for timestamp_ in self.timestamp:2959 showIndent(outfile, level)2960 outfile.write('%s,\n' % quote_python(timestamp_).encode(ExternalEncoding))2961 level -= 12962 showIndent(outfile, level)2963 outfile.write('],\n')2964 showIndent(outfile, level)2965 outfile.write('result=[\n')2966 level += 12967 for result_ in self.result:2968 showIndent(outfile, level)2969 outfile.write('%s,\n' % quote_python(result_).encode(ExternalEncoding))2970 level -= 12971 showIndent(outfile, level)2972 outfile.write('],\n')2973 def build(self, node_):2974 attrs = node_.attributes2975 self.buildAttributes(attrs)2976 for child_ in node_.childNodes:2977 nodeName_ = child_.nodeName.split(':')[-1]2978 self.buildChildren(child_, nodeName_)2979 def buildAttributes(self, attrs):2980 pass2981 def buildChildren(self, child_, nodeName_):2982 if child_.nodeType == Node.ELEMENT_NODE and \2983 nodeName_ == 'bl':2984 bl_ = ''2985 for text__content_ in child_.childNodes:...

Full Screen

Full Screen

ParameterDatabase.py

Source:ParameterDatabase.py Github

copy

Full Screen

...358CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)359#360# Support/utility functions.361#362def showIndent(outfile, level, pretty_print=True):363 if pretty_print:364 for idx in range(level):365 outfile.write(' ')366def quote_xml(inStr):367 "Escape markup chars, but do not modify CDATA sections."368 if not inStr:369 return ''370 s1 = (isinstance(inStr, basestring) and inStr or371 '%s' % inStr)372 s2 = ''373 pos = 0374 matchobjects = CDATA_pattern_.finditer(s1)375 for mo in matchobjects:376 s3 = s1[pos:mo.start()]377 s2 += quote_xml_aux(s3)378 s2 += s1[mo.start():mo.end()]379 pos = mo.end()380 s3 = s1[pos:]381 s2 += quote_xml_aux(s3)382 return s2383def quote_xml_aux(inStr):384 s1 = inStr.replace('&', '&amp;')385 s1 = s1.replace('<', '&lt;')386 s1 = s1.replace('>', '&gt;')387 return s1388def quote_attrib(inStr):389 s1 = (isinstance(inStr, basestring) and inStr or390 '%s' % inStr)391 s1 = s1.replace('&', '&amp;')392 s1 = s1.replace('<', '&lt;')393 s1 = s1.replace('>', '&gt;')394 if '"' in s1:395 if "'" in s1:396 s1 = '"%s"' % s1.replace('"', "&quot;")397 else:398 s1 = "'%s'" % s1399 else:400 s1 = '"%s"' % s1401 return s1402def quote_python(inStr):403 s1 = inStr404 if s1.find("'") == -1:405 if s1.find('\n') == -1:406 return "'%s'" % s1407 else:408 return "'''%s'''" % s1409 else:410 if s1.find('"') != -1:411 s1 = s1.replace('"', '\\"')412 if s1.find('\n') == -1:413 return '"%s"' % s1414 else:415 return '"""%s"""' % s1416def get_all_text_(node):417 if node.text is not None:418 text = node.text419 else:420 text = ''421 for child in node:422 if child.tail is not None:423 text += child.tail424 return text425def find_attr_value_(attr_name, node):426 attrs = node.attrib427 attr_parts = attr_name.split(':')428 value = None429 if len(attr_parts) == 1:430 value = attrs.get(attr_name)431 elif len(attr_parts) == 2:432 prefix, name = attr_parts433 namespace = node.nsmap.get(prefix)434 if namespace is not None:435 value = attrs.get('{%s}%s' % (namespace, name, ))436 return value437class GDSParseError(Exception):438 pass439def raise_parse_error(node, msg):440 if XMLParser_import_library == XMLParser_import_lxml:441 msg = '%s (element %s/line %d)' % (442 msg, node.tag, node.sourceline, )443 else:444 msg = '%s (element %s)' % (msg, node.tag, )445 raise GDSParseError(msg)446class MixedContainer:447 # Constants for category:448 CategoryNone = 0449 CategoryText = 1450 CategorySimple = 2451 CategoryComplex = 3452 # Constants for content_type:453 TypeNone = 0454 TypeText = 1455 TypeString = 2456 TypeInteger = 3457 TypeFloat = 4458 TypeDecimal = 5459 TypeDouble = 6460 TypeBoolean = 7461 TypeBase64 = 8462 def __init__(self, category, content_type, name, value):463 self.category = category464 self.content_type = content_type465 self.name = name466 self.value = value467 def getCategory(self):468 return self.category469 def getContenttype(self, content_type):470 return self.content_type471 def getValue(self):472 return self.value473 def getName(self):474 return self.name475 def export(self, outfile, level, name, namespace, pretty_print=True):476 if self.category == MixedContainer.CategoryText:477 # Prevent exporting empty content as empty lines.478 if self.value.strip():479 outfile.write(self.value)480 elif self.category == MixedContainer.CategorySimple:481 self.exportSimple(outfile, level, name)482 else: # category == MixedContainer.CategoryComplex483 self.value.export(outfile, level, namespace, name, pretty_print)484 def exportSimple(self, outfile, level, name):485 if self.content_type == MixedContainer.TypeString:486 outfile.write('<%s>%s</%s>' % (487 self.name, self.value, self.name))488 elif self.content_type == MixedContainer.TypeInteger or \489 self.content_type == MixedContainer.TypeBoolean:490 outfile.write('<%s>%d</%s>' % (491 self.name, self.value, self.name))492 elif self.content_type == MixedContainer.TypeFloat or \493 self.content_type == MixedContainer.TypeDecimal:494 outfile.write('<%s>%f</%s>' % (495 self.name, self.value, self.name))496 elif self.content_type == MixedContainer.TypeDouble:497 outfile.write('<%s>%g</%s>' % (498 self.name, self.value, self.name))499 elif self.content_type == MixedContainer.TypeBase64:500 outfile.write('<%s>%s</%s>' % (501 self.name, base64.b64encode(self.value), self.name))502 def to_etree(self, element):503 if self.category == MixedContainer.CategoryText:504 # Prevent exporting empty content as empty lines.505 if self.value.strip():506 if len(element) > 0:507 if element[-1].tail is None:508 element[-1].tail = self.value509 else:510 element[-1].tail += self.value511 else:512 if element.text is None:513 element.text = self.value514 else:515 element.text += self.value516 elif self.category == MixedContainer.CategorySimple:517 subelement = etree_.SubElement(element, '%s' % self.name)518 subelement.text = self.to_etree_simple()519 else: # category == MixedContainer.CategoryComplex520 self.value.to_etree(element)521 def to_etree_simple(self):522 if self.content_type == MixedContainer.TypeString:523 text = self.value524 elif (self.content_type == MixedContainer.TypeInteger or525 self.content_type == MixedContainer.TypeBoolean):526 text = '%d' % self.value527 elif (self.content_type == MixedContainer.TypeFloat or528 self.content_type == MixedContainer.TypeDecimal):529 text = '%f' % self.value530 elif self.content_type == MixedContainer.TypeDouble:531 text = '%g' % self.value532 elif self.content_type == MixedContainer.TypeBase64:533 text = '%s' % base64.b64encode(self.value)534 return text535 def exportLiteral(self, outfile, level, name):536 if self.category == MixedContainer.CategoryText:537 showIndent(outfile, level)538 outfile.write(539 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (540 self.category, self.content_type, self.name, self.value))541 elif self.category == MixedContainer.CategorySimple:542 showIndent(outfile, level)543 outfile.write(544 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (545 self.category, self.content_type, self.name, self.value))546 else: # category == MixedContainer.CategoryComplex547 showIndent(outfile, level)548 outfile.write(549 'model_.MixedContainer(%d, %d, "%s",\n' % (550 self.category, self.content_type, self.name,))551 self.value.exportLiteral(outfile, level + 1)552 showIndent(outfile, level)553 outfile.write(')\n')554class MemberSpec_(object):555 def __init__(self, name='', data_type='', container=0):556 self.name = name557 self.data_type = data_type558 self.container = container559 def set_name(self, name): self.name = name560 def get_name(self): return self.name561 def set_data_type(self, data_type): self.data_type = data_type562 def get_data_type_chain(self): return self.data_type563 def get_data_type(self):564 if isinstance(self.data_type, list):565 if len(self.data_type) > 0:566 return self.data_type[-1]567 else:568 return 'xs:string'569 else:570 return self.data_type571 def set_container(self, container): self.container = container572 def get_container(self): return self.container573def _cast(typ, value):574 if typ is None or value is None:575 return value576 return typ(value)577#578# Data representation classes.579#580class SerialisationFlags(GeneratedsSuper):581 subclass = None582 superclass = None583 def __init__(self, serialisationFlag=None):584 self.original_tagname_ = None585 if serialisationFlag is None:586 self.serialisationFlag = []587 else:588 self.serialisationFlag = serialisationFlag589 def factory(*args_, **kwargs_):590 if SerialisationFlags.subclass:591 return SerialisationFlags.subclass(*args_, **kwargs_)592 else:593 return SerialisationFlags(*args_, **kwargs_)594 factory = staticmethod(factory)595 def get_serialisationFlag(self): return self.serialisationFlag596 def set_serialisationFlag(self, serialisationFlag): self.serialisationFlag = serialisationFlag597 def add_serialisationFlag(self, value): self.serialisationFlag.append(value)598 def insert_serialisationFlag_at(self, index, value): self.serialisationFlag.insert(index, value)599 def replace_serialisationFlag_at(self, index, value): self.serialisationFlag[index] = value600 def hasContent_(self):601 if (602 self.serialisationFlag603 ):604 return True605 else:606 return False607 def export(self, outfile, level, namespace_='', name_='SerialisationFlags', namespacedef_='', pretty_print=True):608 if pretty_print:609 eol_ = '\n'610 else:611 eol_ = ''612 if self.original_tagname_ is not None:613 name_ = self.original_tagname_614 showIndent(outfile, level, pretty_print)615 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))616 already_processed = set()617 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SerialisationFlags')618 if self.hasContent_():619 outfile.write('>%s' % (eol_, ))620 self.exportChildren(outfile, level + 1, namespace_='', name_='SerialisationFlags', pretty_print=pretty_print)621 showIndent(outfile, level, pretty_print)622 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))623 else:624 outfile.write('/>%s' % (eol_, ))625 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SerialisationFlags'):626 pass627 def exportChildren(self, outfile, level, namespace_='', name_='SerialisationFlags', fromsubclass_=False, pretty_print=True):628 if pretty_print:629 eol_ = '\n'630 else:631 eol_ = ''632 for serialisationFlag_ in self.serialisationFlag:633 showIndent(outfile, level, pretty_print)634 outfile.write('<%sserialisationFlag>%s</%sserialisationFlag>%s' % (namespace_, self.gds_format_string(quote_xml(serialisationFlag_).encode(ExternalEncoding), input_name='serialisationFlag'), namespace_, eol_))635 def exportLiteral(self, outfile, level, name_='SerialisationFlags'):636 level += 1637 already_processed = set()638 self.exportLiteralAttributes(outfile, level, already_processed, name_)639 if self.hasContent_():640 self.exportLiteralChildren(outfile, level, name_)641 def exportLiteralAttributes(self, outfile, level, already_processed, name_):642 pass643 def exportLiteralChildren(self, outfile, level, name_):644 showIndent(outfile, level)645 outfile.write('serialisationFlag=[\n')646 level += 1647 for serialisationFlag_ in self.serialisationFlag:648 showIndent(outfile, level)649 outfile.write('%s,\n' % quote_python(serialisationFlag_).encode(ExternalEncoding))650 level -= 1651 showIndent(outfile, level)652 outfile.write('],\n')653 def build(self, node):654 already_processed = set()655 self.buildAttributes(node, node.attrib, already_processed)656 for child in node:657 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]658 self.buildChildren(child, node, nodeName_)659 return self660 def buildAttributes(self, node, attrs, already_processed):661 pass662 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):663 if nodeName_ == 'serialisationFlag':664 serialisationFlag_ = child_.text665 serialisationFlag_ = self.gds_validate_string(serialisationFlag_, node, 'serialisationFlag')666 self.serialisationFlag.append(serialisationFlag_)667# end class SerialisationFlags668class UDBType(GeneratedsSuper):669 subclass = None670 superclass = None671 def __init__(self, typeName=None, sendFunction=None, setFunction=None, mavlinkType=None):672 self.original_tagname_ = None673 self.typeName = typeName674 self.sendFunction = sendFunction675 self.setFunction = setFunction676 self.mavlinkType = mavlinkType677 def factory(*args_, **kwargs_):678 if UDBType.subclass:679 return UDBType.subclass(*args_, **kwargs_)680 else:681 return UDBType(*args_, **kwargs_)682 factory = staticmethod(factory)683 def get_typeName(self): return self.typeName684 def set_typeName(self, typeName): self.typeName = typeName685 def get_sendFunction(self): return self.sendFunction686 def set_sendFunction(self, sendFunction): self.sendFunction = sendFunction687 def get_setFunction(self): return self.setFunction688 def set_setFunction(self, setFunction): self.setFunction = setFunction689 def get_mavlinkType(self): return self.mavlinkType690 def set_mavlinkType(self, mavlinkType): self.mavlinkType = mavlinkType691 def hasContent_(self):692 if (693 self.typeName is not None or694 self.sendFunction is not None or695 self.setFunction is not None or696 self.mavlinkType is not None697 ):698 return True699 else:700 return False701 def export(self, outfile, level, namespace_='', name_='UDBType', namespacedef_='', pretty_print=True):702 if pretty_print:703 eol_ = '\n'704 else:705 eol_ = ''706 if self.original_tagname_ is not None:707 name_ = self.original_tagname_708 showIndent(outfile, level, pretty_print)709 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))710 already_processed = set()711 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UDBType')712 if self.hasContent_():713 outfile.write('>%s' % (eol_, ))714 self.exportChildren(outfile, level + 1, namespace_='', name_='UDBType', pretty_print=pretty_print)715 showIndent(outfile, level, pretty_print)716 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))717 else:718 outfile.write('/>%s' % (eol_, ))719 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UDBType'):720 pass721 def exportChildren(self, outfile, level, namespace_='', name_='UDBType', fromsubclass_=False, pretty_print=True):722 if pretty_print:723 eol_ = '\n'724 else:725 eol_ = ''726 if self.typeName is not None:727 showIndent(outfile, level, pretty_print)728 outfile.write('<%stypeName>%s</%stypeName>%s' % (namespace_, self.gds_format_string(quote_xml(self.typeName).encode(ExternalEncoding), input_name='typeName'), namespace_, eol_))729 if self.sendFunction is not None:730 showIndent(outfile, level, pretty_print)731 outfile.write('<%ssendFunction>%s</%ssendFunction>%s' % (namespace_, self.gds_format_string(quote_xml(self.sendFunction).encode(ExternalEncoding), input_name='sendFunction'), namespace_, eol_))732 if self.setFunction is not None:733 showIndent(outfile, level, pretty_print)734 outfile.write('<%ssetFunction>%s</%ssetFunction>%s' % (namespace_, self.gds_format_string(quote_xml(self.setFunction).encode(ExternalEncoding), input_name='setFunction'), namespace_, eol_))735 if self.mavlinkType is not None:736 showIndent(outfile, level, pretty_print)737 outfile.write('<%smavlinkType>%s</%smavlinkType>%s' % (namespace_, self.gds_format_string(quote_xml(self.mavlinkType).encode(ExternalEncoding), input_name='mavlinkType'), namespace_, eol_))738 def exportLiteral(self, outfile, level, name_='UDBType'):739 level += 1740 already_processed = set()741 self.exportLiteralAttributes(outfile, level, already_processed, name_)742 if self.hasContent_():743 self.exportLiteralChildren(outfile, level, name_)744 def exportLiteralAttributes(self, outfile, level, already_processed, name_):745 pass746 def exportLiteralChildren(self, outfile, level, name_):747 if self.typeName is not None:748 showIndent(outfile, level)749 outfile.write('typeName=%s,\n' % quote_python(self.typeName).encode(ExternalEncoding))750 if self.sendFunction is not None:751 showIndent(outfile, level)752 outfile.write('sendFunction=%s,\n' % quote_python(self.sendFunction).encode(ExternalEncoding))753 if self.setFunction is not None:754 showIndent(outfile, level)755 outfile.write('setFunction=%s,\n' % quote_python(self.setFunction).encode(ExternalEncoding))756 if self.mavlinkType is not None:757 showIndent(outfile, level)758 outfile.write('mavlinkType=%s,\n' % quote_python(self.mavlinkType).encode(ExternalEncoding))759 def build(self, node):760 already_processed = set()761 self.buildAttributes(node, node.attrib, already_processed)762 for child in node:763 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]764 self.buildChildren(child, node, nodeName_)765 return self766 def buildAttributes(self, node, attrs, already_processed):767 pass768 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):769 if nodeName_ == 'typeName':770 typeName_ = child_.text771 typeName_ = self.gds_validate_string(typeName_, node, 'typeName')772 self.typeName = typeName_773 elif nodeName_ == 'sendFunction':774 sendFunction_ = child_.text775 sendFunction_ = self.gds_validate_string(sendFunction_, node, 'sendFunction')776 self.sendFunction = sendFunction_777 elif nodeName_ == 'setFunction':778 setFunction_ = child_.text779 setFunction_ = self.gds_validate_string(setFunction_, node, 'setFunction')780 self.setFunction = setFunction_781 elif nodeName_ == 'mavlinkType':782 mavlinkType_ = child_.text783 mavlinkType_ = self.gds_validate_string(mavlinkType_, node, 'mavlinkType')784 self.mavlinkType = mavlinkType_785# end class UDBType786class UDBTypes(GeneratedsSuper):787 subclass = None788 superclass = None789 def __init__(self, udbType=None):790 self.original_tagname_ = None791 if udbType is None:792 self.udbType = []793 else:794 self.udbType = udbType795 def factory(*args_, **kwargs_):796 if UDBTypes.subclass:797 return UDBTypes.subclass(*args_, **kwargs_)798 else:799 return UDBTypes(*args_, **kwargs_)800 factory = staticmethod(factory)801 def get_udbType(self): return self.udbType802 def set_udbType(self, udbType): self.udbType = udbType803 def add_udbType(self, value): self.udbType.append(value)804 def insert_udbType_at(self, index, value): self.udbType.insert(index, value)805 def replace_udbType_at(self, index, value): self.udbType[index] = value806 def hasContent_(self):807 if (808 self.udbType809 ):810 return True811 else:812 return False813 def export(self, outfile, level, namespace_='', name_='UDBTypes', namespacedef_='', pretty_print=True):814 if pretty_print:815 eol_ = '\n'816 else:817 eol_ = ''818 if self.original_tagname_ is not None:819 name_ = self.original_tagname_820 showIndent(outfile, level, pretty_print)821 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))822 already_processed = set()823 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UDBTypes')824 if self.hasContent_():825 outfile.write('>%s' % (eol_, ))826 self.exportChildren(outfile, level + 1, namespace_='', name_='UDBTypes', pretty_print=pretty_print)827 showIndent(outfile, level, pretty_print)828 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))829 else:830 outfile.write('/>%s' % (eol_, ))831 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UDBTypes'):832 pass833 def exportChildren(self, outfile, level, namespace_='', name_='UDBTypes', fromsubclass_=False, pretty_print=True):834 if pretty_print:835 eol_ = '\n'836 else:837 eol_ = ''838 for udbType_ in self.udbType:839 udbType_.export(outfile, level, namespace_, name_='udbType', pretty_print=pretty_print)840 def exportLiteral(self, outfile, level, name_='UDBTypes'):841 level += 1842 already_processed = set()843 self.exportLiteralAttributes(outfile, level, already_processed, name_)844 if self.hasContent_():845 self.exportLiteralChildren(outfile, level, name_)846 def exportLiteralAttributes(self, outfile, level, already_processed, name_):847 pass848 def exportLiteralChildren(self, outfile, level, name_):849 showIndent(outfile, level)850 outfile.write('udbType=[\n')851 level += 1852 for udbType_ in self.udbType:853 showIndent(outfile, level)854 outfile.write('model_.UDBType(\n')855 udbType_.exportLiteral(outfile, level, name_='UDBType')856 showIndent(outfile, level)857 outfile.write('),\n')858 level -= 1859 showIndent(outfile, level)860 outfile.write('],\n')861 def build(self, node):862 already_processed = set()863 self.buildAttributes(node, node.attrib, already_processed)864 for child in node:865 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]866 self.buildChildren(child, node, nodeName_)867 return self868 def buildAttributes(self, node, attrs, already_processed):869 pass870 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):871 if nodeName_ == 'udbType':872 obj_ = UDBType.factory()873 obj_.build(child_)874 self.udbType.append(obj_)875 obj_.original_tagname_ = 'udbType'876# end class UDBTypes877class Parameter(GeneratedsSuper):878 subclass = None879 superclass = None880 def __init__(self, parameterName=None, udb_param_type=None, variable_name='NULL', description='no description', min='0.0', max='0.0', readonly=True):881 self.original_tagname_ = None882 self.parameterName = parameterName883 self.validate_ParamIdentifier(self.parameterName)884 self.udb_param_type = udb_param_type885 self.variable_name = variable_name886 self.description = description887 self.min = min888 self.max = max889 self.readonly = readonly890 def factory(*args_, **kwargs_):891 if Parameter.subclass:892 return Parameter.subclass(*args_, **kwargs_)893 else:894 return Parameter(*args_, **kwargs_)895 factory = staticmethod(factory)896 def get_parameterName(self): return self.parameterName897 def set_parameterName(self, parameterName): self.parameterName = parameterName898 def get_udb_param_type(self): return self.udb_param_type899 def set_udb_param_type(self, udb_param_type): self.udb_param_type = udb_param_type900 def get_variable_name(self): return self.variable_name901 def set_variable_name(self, variable_name): self.variable_name = variable_name902 def get_description(self): return self.description903 def set_description(self, description): self.description = description904 def get_min(self): return self.min905 def set_min(self, min): self.min = min906 def get_max(self): return self.max907 def set_max(self, max): self.max = max908 def get_readonly(self): return self.readonly909 def set_readonly(self, readonly): self.readonly = readonly910 def validate_ParamIdentifier(self, value):911 # Validate type ParamIdentifier, a restriction on xs:string.912 if value is not None and Validate_simpletypes_:913 if len(value) > 15:914 warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on ParamIdentifier' % {"value" : value.encode("utf-8")} )915 if len(value) < 1:916 warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on ParamIdentifier' % {"value" : value.encode("utf-8")} )917 def hasContent_(self):918 if (919 self.parameterName is not None or920 self.udb_param_type is not None or921 self.variable_name != "NULL" or922 self.description != "no description" or923 self.min != "0.0" or924 self.max != "0.0" or925 not self.readonly926 ):927 return True928 else:929 return False930 def export(self, outfile, level, namespace_='', name_='Parameter', namespacedef_='', pretty_print=True):931 if pretty_print:932 eol_ = '\n'933 else:934 eol_ = ''935 if self.original_tagname_ is not None:936 name_ = self.original_tagname_937 showIndent(outfile, level, pretty_print)938 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))939 already_processed = set()940 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Parameter')941 if self.hasContent_():942 outfile.write('>%s' % (eol_, ))943 self.exportChildren(outfile, level + 1, namespace_='', name_='Parameter', pretty_print=pretty_print)944 showIndent(outfile, level, pretty_print)945 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))946 else:947 outfile.write('/>%s' % (eol_, ))948 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Parameter'):949 pass950 def exportChildren(self, outfile, level, namespace_='', name_='Parameter', fromsubclass_=False, pretty_print=True):951 if pretty_print:952 eol_ = '\n'953 else:954 eol_ = ''955 if self.parameterName is not None:956 showIndent(outfile, level, pretty_print)957 outfile.write('<%sparameterName>%s</%sparameterName>%s' % (namespace_, self.gds_format_string(quote_xml(self.parameterName).encode(ExternalEncoding), input_name='parameterName'), namespace_, eol_))958 if self.udb_param_type is not None:959 showIndent(outfile, level, pretty_print)960 outfile.write('<%sudb_param_type>%s</%sudb_param_type>%s' % (namespace_, self.gds_format_string(quote_xml(self.udb_param_type).encode(ExternalEncoding), input_name='udb_param_type'), namespace_, eol_))961 if self.variable_name != "NULL":962 showIndent(outfile, level, pretty_print)963 outfile.write('<%svariable_name>%s</%svariable_name>%s' % (namespace_, self.gds_format_string(quote_xml(self.variable_name).encode(ExternalEncoding), input_name='variable_name'), namespace_, eol_))964 if self.description != "no description":965 showIndent(outfile, level, pretty_print)966 outfile.write('<%sdescription>%s</%sdescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.description).encode(ExternalEncoding), input_name='description'), namespace_, eol_))967 if self.min != "0.0":968 showIndent(outfile, level, pretty_print)969 outfile.write('<%smin>%s</%smin>%s' % (namespace_, self.gds_format_string(quote_xml(self.min).encode(ExternalEncoding), input_name='min'), namespace_, eol_))970 if self.max != "0.0":971 showIndent(outfile, level, pretty_print)972 outfile.write('<%smax>%s</%smax>%s' % (namespace_, self.gds_format_string(quote_xml(self.max).encode(ExternalEncoding), input_name='max'), namespace_, eol_))973 if not self.readonly:974 showIndent(outfile, level, pretty_print)975 outfile.write('<%sreadonly>%s</%sreadonly>%s' % (namespace_, self.gds_format_boolean(self.readonly, input_name='readonly'), namespace_, eol_))976 def exportLiteral(self, outfile, level, name_='Parameter'):977 level += 1978 already_processed = set()979 self.exportLiteralAttributes(outfile, level, already_processed, name_)980 if self.hasContent_():981 self.exportLiteralChildren(outfile, level, name_)982 def exportLiteralAttributes(self, outfile, level, already_processed, name_):983 pass984 def exportLiteralChildren(self, outfile, level, name_):985 if self.parameterName is not None:986 showIndent(outfile, level)987 outfile.write('parameterName=%s,\n' % quote_python(self.parameterName).encode(ExternalEncoding))988 if self.udb_param_type is not None:989 showIndent(outfile, level)990 outfile.write('udb_param_type=%s,\n' % quote_python(self.udb_param_type).encode(ExternalEncoding))991 if self.variable_name is not None:992 showIndent(outfile, level)993 outfile.write('variable_name=%s,\n' % quote_python(self.variable_name).encode(ExternalEncoding))994 if self.description is not None:995 showIndent(outfile, level)996 outfile.write('description=%s,\n' % quote_python(self.description).encode(ExternalEncoding))997 if self.min is not None:998 showIndent(outfile, level)999 outfile.write('min=%s,\n' % quote_python(self.min).encode(ExternalEncoding))1000 if self.max is not None:1001 showIndent(outfile, level)1002 outfile.write('max=%s,\n' % quote_python(self.max).encode(ExternalEncoding))1003 if self.readonly is not None:1004 showIndent(outfile, level)1005 outfile.write('readonly=%s,\n' % self.readonly)1006 def build(self, node):1007 already_processed = set()1008 self.buildAttributes(node, node.attrib, already_processed)1009 for child in node:1010 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1011 self.buildChildren(child, node, nodeName_)1012 return self1013 def buildAttributes(self, node, attrs, already_processed):1014 pass1015 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1016 if nodeName_ == 'parameterName':1017 parameterName_ = child_.text1018 parameterName_ = self.gds_validate_string(parameterName_, node, 'parameterName')1019 self.parameterName = parameterName_1020 # validate type ParamIdentifier1021 self.validate_ParamIdentifier(self.parameterName)1022 elif nodeName_ == 'udb_param_type':1023 udb_param_type_ = child_.text1024 udb_param_type_ = self.gds_validate_string(udb_param_type_, node, 'udb_param_type')1025 self.udb_param_type = udb_param_type_1026 elif nodeName_ == 'variable_name':1027 variable_name_ = child_.text1028 variable_name_ = self.gds_validate_string(variable_name_, node, 'variable_name')1029 self.variable_name = variable_name_1030 elif nodeName_ == 'description':1031 description_ = child_.text1032 description_ = self.gds_validate_string(description_, node, 'description')1033 self.description = description_1034 elif nodeName_ == 'min':1035 min_ = child_.text1036 min_ = self.gds_validate_string(min_, node, 'min')1037 self.min = min_1038 elif nodeName_ == 'max':1039 max_ = child_.text1040 max_ = self.gds_validate_string(max_, node, 'max')1041 self.max = max_1042 elif nodeName_ == 'readonly':1043 sval_ = child_.text1044 if sval_ in ('true', '1'):1045 ival_ = True1046 elif sval_ in ('false', '0'):1047 ival_ = False1048 else:1049 raise_parse_error(child_, 'requires boolean')1050 ival_ = self.gds_validate_boolean(ival_, node, 'readonly')1051 self.readonly = ival_1052# end class Parameter1053class Parameters(GeneratedsSuper):1054 subclass = None1055 superclass = None1056 def __init__(self, parameter=None):1057 self.original_tagname_ = None1058 if parameter is None:1059 self.parameter = []1060 else:1061 self.parameter = parameter1062 def factory(*args_, **kwargs_):1063 if Parameters.subclass:1064 return Parameters.subclass(*args_, **kwargs_)1065 else:1066 return Parameters(*args_, **kwargs_)1067 factory = staticmethod(factory)1068 def get_parameter(self): return self.parameter1069 def set_parameter(self, parameter): self.parameter = parameter1070 def add_parameter(self, value): self.parameter.append(value)1071 def insert_parameter_at(self, index, value): self.parameter.insert(index, value)1072 def replace_parameter_at(self, index, value): self.parameter[index] = value1073 def hasContent_(self):1074 if (1075 self.parameter1076 ):1077 return True1078 else:1079 return False1080 def export(self, outfile, level, namespace_='', name_='Parameters', namespacedef_='', pretty_print=True):1081 if pretty_print:1082 eol_ = '\n'1083 else:1084 eol_ = ''1085 if self.original_tagname_ is not None:1086 name_ = self.original_tagname_1087 showIndent(outfile, level, pretty_print)1088 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1089 already_processed = set()1090 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Parameters')1091 if self.hasContent_():1092 outfile.write('>%s' % (eol_, ))1093 self.exportChildren(outfile, level + 1, namespace_='', name_='Parameters', pretty_print=pretty_print)1094 showIndent(outfile, level, pretty_print)1095 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1096 else:1097 outfile.write('/>%s' % (eol_, ))1098 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Parameters'):1099 pass1100 def exportChildren(self, outfile, level, namespace_='', name_='Parameters', fromsubclass_=False, pretty_print=True):1101 if pretty_print:1102 eol_ = '\n'1103 else:1104 eol_ = ''1105 for parameter_ in self.parameter:1106 parameter_.export(outfile, level, namespace_, name_='parameter', pretty_print=pretty_print)1107 def exportLiteral(self, outfile, level, name_='Parameters'):1108 level += 11109 already_processed = set()1110 self.exportLiteralAttributes(outfile, level, already_processed, name_)1111 if self.hasContent_():1112 self.exportLiteralChildren(outfile, level, name_)1113 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1114 pass1115 def exportLiteralChildren(self, outfile, level, name_):1116 showIndent(outfile, level)1117 outfile.write('parameter=[\n')1118 level += 11119 for parameter_ in self.parameter:1120 showIndent(outfile, level)1121 outfile.write('model_.Parameter(\n')1122 parameter_.exportLiteral(outfile, level, name_='Parameter')1123 showIndent(outfile, level)1124 outfile.write('),\n')1125 level -= 11126 showIndent(outfile, level)1127 outfile.write('],\n')1128 def build(self, node):1129 already_processed = set()1130 self.buildAttributes(node, node.attrib, already_processed)1131 for child in node:1132 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1133 self.buildChildren(child, node, nodeName_)1134 return self1135 def buildAttributes(self, node, attrs, already_processed):1136 pass1137 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1138 if nodeName_ == 'parameter':1139 obj_ = Parameter.factory()1140 obj_.build(child_)1141 self.parameter.append(obj_)1142 obj_.original_tagname_ = 'parameter'1143# end class Parameters1144class ParameterBlock(GeneratedsSuper):1145 subclass = None1146 superclass = None1147 def __init__(self, blockName=None, storage_area='None', serialisationFlags=None, externs=None, includes=None, load_callback=None, in_mavlink_parameters=None, parameters=None, description='no description'):1148 self.original_tagname_ = None1149 self.blockName = blockName1150 self.storage_area = storage_area1151 self.serialisationFlags = serialisationFlags1152 self.externs = externs1153 self.includes = includes1154 self.load_callback = load_callback1155 self.in_mavlink_parameters = in_mavlink_parameters1156 self.parameters = parameters1157 self.description = description1158 def factory(*args_, **kwargs_):1159 if ParameterBlock.subclass:1160 return ParameterBlock.subclass(*args_, **kwargs_)1161 else:1162 return ParameterBlock(*args_, **kwargs_)1163 factory = staticmethod(factory)1164 def get_blockName(self): return self.blockName1165 def set_blockName(self, blockName): self.blockName = blockName1166 def get_storage_area(self): return self.storage_area1167 def set_storage_area(self, storage_area): self.storage_area = storage_area1168 def get_serialisationFlags(self): return self.serialisationFlags1169 def set_serialisationFlags(self, serialisationFlags): self.serialisationFlags = serialisationFlags1170 def get_externs(self): return self.externs1171 def set_externs(self, externs): self.externs = externs1172 def get_includes(self): return self.includes1173 def set_includes(self, includes): self.includes = includes1174 def get_load_callback(self): return self.load_callback1175 def set_load_callback(self, load_callback): self.load_callback = load_callback1176 def get_in_mavlink_parameters(self): return self.in_mavlink_parameters1177 def set_in_mavlink_parameters(self, in_mavlink_parameters): self.in_mavlink_parameters = in_mavlink_parameters1178 def get_parameters(self): return self.parameters1179 def set_parameters(self, parameters): self.parameters = parameters1180 def get_description(self): return self.description1181 def set_description(self, description): self.description = description1182 def hasContent_(self):1183 if (1184 self.blockName is not None or1185 self.storage_area != "None" or1186 self.serialisationFlags is not None or1187 self.externs is not None or1188 self.includes is not None or1189 self.load_callback is not None or1190 self.in_mavlink_parameters is not None or1191 self.parameters is not None or1192 self.description != "no description"1193 ):1194 return True1195 else:1196 return False1197 def export(self, outfile, level, namespace_='', name_='ParameterBlock', namespacedef_='', pretty_print=True):1198 if pretty_print:1199 eol_ = '\n'1200 else:1201 eol_ = ''1202 if self.original_tagname_ is not None:1203 name_ = self.original_tagname_1204 showIndent(outfile, level, pretty_print)1205 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1206 already_processed = set()1207 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParameterBlock')1208 if self.hasContent_():1209 outfile.write('>%s' % (eol_, ))1210 self.exportChildren(outfile, level + 1, namespace_='', name_='ParameterBlock', pretty_print=pretty_print)1211 showIndent(outfile, level, pretty_print)1212 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1213 else:1214 outfile.write('/>%s' % (eol_, ))1215 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ParameterBlock'):1216 pass1217 def exportChildren(self, outfile, level, namespace_='', name_='ParameterBlock', fromsubclass_=False, pretty_print=True):1218 if pretty_print:1219 eol_ = '\n'1220 else:1221 eol_ = ''1222 if self.blockName is not None:1223 showIndent(outfile, level, pretty_print)1224 outfile.write('<%sblockName>%s</%sblockName>%s' % (namespace_, self.gds_format_string(quote_xml(self.blockName).encode(ExternalEncoding), input_name='blockName'), namespace_, eol_))1225 if self.storage_area != "None":1226 showIndent(outfile, level, pretty_print)1227 outfile.write('<%sstorage_area>%s</%sstorage_area>%s' % (namespace_, self.gds_format_string(quote_xml(self.storage_area).encode(ExternalEncoding), input_name='storage_area'), namespace_, eol_))1228 if self.serialisationFlags is not None:1229 self.serialisationFlags.export(outfile, level, namespace_, name_='serialisationFlags', pretty_print=pretty_print)1230 if self.externs is not None:1231 self.externs.export(outfile, level, namespace_, name_='externs', pretty_print=pretty_print)1232 if self.includes is not None:1233 self.includes.export(outfile, level, namespace_, name_='includes', pretty_print=pretty_print)1234 if self.load_callback is not None:1235 showIndent(outfile, level, pretty_print)1236 outfile.write('<%sload_callback>%s</%sload_callback>%s' % (namespace_, self.gds_format_string(quote_xml(self.load_callback).encode(ExternalEncoding), input_name='load_callback'), namespace_, eol_))1237 if self.in_mavlink_parameters is not None:1238 showIndent(outfile, level, pretty_print)1239 outfile.write('<%sin_mavlink_parameters>%s</%sin_mavlink_parameters>%s' % (namespace_, self.gds_format_boolean(self.in_mavlink_parameters, input_name='in_mavlink_parameters'), namespace_, eol_))1240 if self.parameters is not None:1241 self.parameters.export(outfile, level, namespace_, name_='parameters', pretty_print=pretty_print)1242 if self.description != "no description":1243 showIndent(outfile, level, pretty_print)1244 outfile.write('<%sdescription>%s</%sdescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.description).encode(ExternalEncoding), input_name='description'), namespace_, eol_))1245 def exportLiteral(self, outfile, level, name_='ParameterBlock'):1246 level += 11247 already_processed = set()1248 self.exportLiteralAttributes(outfile, level, already_processed, name_)1249 if self.hasContent_():1250 self.exportLiteralChildren(outfile, level, name_)1251 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1252 pass1253 def exportLiteralChildren(self, outfile, level, name_):1254 if self.blockName is not None:1255 showIndent(outfile, level)1256 outfile.write('blockName=%s,\n' % quote_python(self.blockName).encode(ExternalEncoding))1257 if self.storage_area is not None:1258 showIndent(outfile, level)1259 outfile.write('storage_area=%s,\n' % quote_python(self.storage_area).encode(ExternalEncoding))1260 if self.serialisationFlags is not None:1261 showIndent(outfile, level)1262 outfile.write('serialisationFlags=model_.SerialisationFlags(\n')1263 self.serialisationFlags.exportLiteral(outfile, level, name_='serialisationFlags')1264 showIndent(outfile, level)1265 outfile.write('),\n')1266 if self.externs is not None:1267 showIndent(outfile, level)1268 outfile.write('externs=model_.Externs(\n')1269 self.externs.exportLiteral(outfile, level, name_='externs')1270 showIndent(outfile, level)1271 outfile.write('),\n')1272 if self.includes is not None:1273 showIndent(outfile, level)1274 outfile.write('includes=model_.Includes(\n')1275 self.includes.exportLiteral(outfile, level, name_='includes')1276 showIndent(outfile, level)1277 outfile.write('),\n')1278 if self.load_callback is not None:1279 showIndent(outfile, level)1280 outfile.write('load_callback=%s,\n' % quote_python(self.load_callback).encode(ExternalEncoding))1281 if self.in_mavlink_parameters is not None:1282 showIndent(outfile, level)1283 outfile.write('in_mavlink_parameters=%s,\n' % self.in_mavlink_parameters)1284 if self.parameters is not None:1285 showIndent(outfile, level)1286 outfile.write('parameters=model_.Parameters(\n')1287 self.parameters.exportLiteral(outfile, level, name_='parameters')1288 showIndent(outfile, level)1289 outfile.write('),\n')1290 if self.description is not None:1291 showIndent(outfile, level)1292 outfile.write('description=%s,\n' % quote_python(self.description).encode(ExternalEncoding))1293 def build(self, node):1294 already_processed = set()1295 self.buildAttributes(node, node.attrib, already_processed)1296 for child in node:1297 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1298 self.buildChildren(child, node, nodeName_)1299 return self1300 def buildAttributes(self, node, attrs, already_processed):1301 pass1302 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1303 if nodeName_ == 'blockName':1304 blockName_ = child_.text1305 blockName_ = self.gds_validate_string(blockName_, node, 'blockName')1306 self.blockName = blockName_1307 elif nodeName_ == 'storage_area':1308 storage_area_ = child_.text1309 storage_area_ = self.gds_validate_string(storage_area_, node, 'storage_area')1310 self.storage_area = storage_area_1311 elif nodeName_ == 'serialisationFlags':1312 obj_ = SerialisationFlags.factory()1313 obj_.build(child_)1314 self.serialisationFlags = obj_1315 obj_.original_tagname_ = 'serialisationFlags'1316 elif nodeName_ == 'externs':1317 obj_ = Externs.factory()1318 obj_.build(child_)1319 self.externs = obj_1320 obj_.original_tagname_ = 'externs'1321 elif nodeName_ == 'includes':1322 obj_ = Includes.factory()1323 obj_.build(child_)1324 self.includes = obj_1325 obj_.original_tagname_ = 'includes'1326 elif nodeName_ == 'load_callback':1327 load_callback_ = child_.text1328 load_callback_ = self.gds_validate_string(load_callback_, node, 'load_callback')1329 self.load_callback = load_callback_1330 elif nodeName_ == 'in_mavlink_parameters':1331 sval_ = child_.text1332 if sval_ in ('true', '1'):1333 ival_ = True1334 elif sval_ in ('false', '0'):1335 ival_ = False1336 else:1337 raise_parse_error(child_, 'requires boolean')1338 ival_ = self.gds_validate_boolean(ival_, node, 'in_mavlink_parameters')1339 self.in_mavlink_parameters = ival_1340 elif nodeName_ == 'parameters':1341 obj_ = Parameters.factory()1342 obj_.build(child_)1343 self.parameters = obj_1344 obj_.original_tagname_ = 'parameters'1345 elif nodeName_ == 'description':1346 description_ = child_.text1347 description_ = self.gds_validate_string(description_, node, 'description')1348 self.description = description_1349# end class ParameterBlock1350class ParameterBlocks(GeneratedsSuper):1351 subclass = None1352 superclass = None1353 def __init__(self, parameterBlock=None):1354 self.original_tagname_ = None1355 if parameterBlock is None:1356 self.parameterBlock = []1357 else:1358 self.parameterBlock = parameterBlock1359 def factory(*args_, **kwargs_):1360 if ParameterBlocks.subclass:1361 return ParameterBlocks.subclass(*args_, **kwargs_)1362 else:1363 return ParameterBlocks(*args_, **kwargs_)1364 factory = staticmethod(factory)1365 def get_parameterBlock(self): return self.parameterBlock1366 def set_parameterBlock(self, parameterBlock): self.parameterBlock = parameterBlock1367 def add_parameterBlock(self, value): self.parameterBlock.append(value)1368 def insert_parameterBlock_at(self, index, value): self.parameterBlock.insert(index, value)1369 def replace_parameterBlock_at(self, index, value): self.parameterBlock[index] = value1370 def hasContent_(self):1371 if (1372 self.parameterBlock1373 ):1374 return True1375 else:1376 return False1377 def export(self, outfile, level, namespace_='', name_='ParameterBlocks', namespacedef_='', pretty_print=True):1378 if pretty_print:1379 eol_ = '\n'1380 else:1381 eol_ = ''1382 if self.original_tagname_ is not None:1383 name_ = self.original_tagname_1384 showIndent(outfile, level, pretty_print)1385 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1386 already_processed = set()1387 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParameterBlocks')1388 if self.hasContent_():1389 outfile.write('>%s' % (eol_, ))1390 self.exportChildren(outfile, level + 1, namespace_='', name_='ParameterBlocks', pretty_print=pretty_print)1391 showIndent(outfile, level, pretty_print)1392 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1393 else:1394 outfile.write('/>%s' % (eol_, ))1395 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ParameterBlocks'):1396 pass1397 def exportChildren(self, outfile, level, namespace_='', name_='ParameterBlocks', fromsubclass_=False, pretty_print=True):1398 if pretty_print:1399 eol_ = '\n'1400 else:1401 eol_ = ''1402 for parameterBlock_ in self.parameterBlock:1403 parameterBlock_.export(outfile, level, namespace_, name_='parameterBlock', pretty_print=pretty_print)1404 def exportLiteral(self, outfile, level, name_='ParameterBlocks'):1405 level += 11406 already_processed = set()1407 self.exportLiteralAttributes(outfile, level, already_processed, name_)1408 if self.hasContent_():1409 self.exportLiteralChildren(outfile, level, name_)1410 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1411 pass1412 def exportLiteralChildren(self, outfile, level, name_):1413 showIndent(outfile, level)1414 outfile.write('parameterBlock=[\n')1415 level += 11416 for parameterBlock_ in self.parameterBlock:1417 showIndent(outfile, level)1418 outfile.write('model_.ParameterBlock(\n')1419 parameterBlock_.exportLiteral(outfile, level, name_='ParameterBlock')1420 showIndent(outfile, level)1421 outfile.write('),\n')1422 level -= 11423 showIndent(outfile, level)1424 outfile.write('],\n')1425 def build(self, node):1426 already_processed = set()1427 self.buildAttributes(node, node.attrib, already_processed)1428 for child in node:1429 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1430 self.buildChildren(child, node, nodeName_)1431 return self1432 def buildAttributes(self, node, attrs, already_processed):1433 pass1434 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1435 if nodeName_ == 'parameterBlock':1436 obj_ = ParameterBlock.factory()1437 obj_.build(child_)1438 self.parameterBlock.append(obj_)1439 obj_.original_tagname_ = 'parameterBlock'1440# end class ParameterBlocks1441class ParameterDatabase(GeneratedsSuper):1442 subclass = None1443 superclass = None1444 def __init__(self, dataStorageAreas=None, serialisationFlags=None, udbTypes=None, parameterBlocks=None):1445 self.original_tagname_ = None1446 self.dataStorageAreas = dataStorageAreas1447 self.serialisationFlags = serialisationFlags1448 self.udbTypes = udbTypes1449 self.parameterBlocks = parameterBlocks1450 def factory(*args_, **kwargs_):1451 if ParameterDatabase.subclass:1452 return ParameterDatabase.subclass(*args_, **kwargs_)1453 else:1454 return ParameterDatabase(*args_, **kwargs_)1455 factory = staticmethod(factory)1456 def get_dataStorageAreas(self): return self.dataStorageAreas1457 def set_dataStorageAreas(self, dataStorageAreas): self.dataStorageAreas = dataStorageAreas1458 def get_serialisationFlags(self): return self.serialisationFlags1459 def set_serialisationFlags(self, serialisationFlags): self.serialisationFlags = serialisationFlags1460 def get_udbTypes(self): return self.udbTypes1461 def set_udbTypes(self, udbTypes): self.udbTypes = udbTypes1462 def get_parameterBlocks(self): return self.parameterBlocks1463 def set_parameterBlocks(self, parameterBlocks): self.parameterBlocks = parameterBlocks1464 def hasContent_(self):1465 if (1466 self.dataStorageAreas is not None or1467 self.serialisationFlags is not None or1468 self.udbTypes is not None or1469 self.parameterBlocks is not None1470 ):1471 return True1472 else:1473 return False1474 def export(self, outfile, level, namespace_='', name_='ParameterDatabase', namespacedef_='', pretty_print=True):1475 if pretty_print:1476 eol_ = '\n'1477 else:1478 eol_ = ''1479 if self.original_tagname_ is not None:1480 name_ = self.original_tagname_1481 showIndent(outfile, level, pretty_print)1482 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1483 already_processed = set()1484 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParameterDatabase')1485 if self.hasContent_():1486 outfile.write('>%s' % (eol_, ))1487 self.exportChildren(outfile, level + 1, namespace_='', name_='ParameterDatabase', pretty_print=pretty_print)1488 showIndent(outfile, level, pretty_print)1489 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1490 else:1491 outfile.write('/>%s' % (eol_, ))1492 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ParameterDatabase'):1493 pass1494 def exportChildren(self, outfile, level, namespace_='', name_='ParameterDatabase', fromsubclass_=False, pretty_print=True):1495 if pretty_print:1496 eol_ = '\n'1497 else:1498 eol_ = ''1499 if self.dataStorageAreas is not None:1500 self.dataStorageAreas.export(outfile, level, namespace_, name_='dataStorageAreas', pretty_print=pretty_print)1501 if self.serialisationFlags is not None:1502 self.serialisationFlags.export(outfile, level, namespace_, name_='serialisationFlags', pretty_print=pretty_print)1503 if self.udbTypes is not None:1504 self.udbTypes.export(outfile, level, namespace_, name_='udbTypes', pretty_print=pretty_print)1505 if self.parameterBlocks is not None:1506 self.parameterBlocks.export(outfile, level, namespace_, name_='parameterBlocks', pretty_print=pretty_print)1507 def exportLiteral(self, outfile, level, name_='ParameterDatabase'):1508 level += 11509 already_processed = set()1510 self.exportLiteralAttributes(outfile, level, already_processed, name_)1511 if self.hasContent_():1512 self.exportLiteralChildren(outfile, level, name_)1513 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1514 pass1515 def exportLiteralChildren(self, outfile, level, name_):1516 if self.dataStorageAreas is not None:1517 showIndent(outfile, level)1518 outfile.write('dataStorageAreas=model_.DataStorageAreas(\n')1519 self.dataStorageAreas.exportLiteral(outfile, level, name_='dataStorageAreas')1520 showIndent(outfile, level)1521 outfile.write('),\n')1522 if self.serialisationFlags is not None:1523 showIndent(outfile, level)1524 outfile.write('serialisationFlags=model_.SerialisationFlags(\n')1525 self.serialisationFlags.exportLiteral(outfile, level, name_='serialisationFlags')1526 showIndent(outfile, level)1527 outfile.write('),\n')1528 if self.udbTypes is not None:1529 showIndent(outfile, level)1530 outfile.write('udbTypes=model_.UDBTypes(\n')1531 self.udbTypes.exportLiteral(outfile, level, name_='udbTypes')1532 showIndent(outfile, level)1533 outfile.write('),\n')1534 if self.parameterBlocks is not None:1535 showIndent(outfile, level)1536 outfile.write('parameterBlocks=model_.ParameterBlocks(\n')1537 self.parameterBlocks.exportLiteral(outfile, level, name_='parameterBlocks')1538 showIndent(outfile, level)1539 outfile.write('),\n')1540 def build(self, node):1541 already_processed = set()1542 self.buildAttributes(node, node.attrib, already_processed)1543 for child in node:1544 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1545 self.buildChildren(child, node, nodeName_)1546 return self1547 def buildAttributes(self, node, attrs, already_processed):1548 pass1549 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1550 if nodeName_ == 'dataStorageAreas':1551 obj_ = DataStorageAreas.factory()1552 obj_.build(child_)1553 self.dataStorageAreas = obj_1554 obj_.original_tagname_ = 'dataStorageAreas'1555 elif nodeName_ == 'serialisationFlags':1556 obj_ = SerialisationFlags.factory()1557 obj_.build(child_)1558 self.serialisationFlags = obj_1559 obj_.original_tagname_ = 'serialisationFlags'1560 elif nodeName_ == 'udbTypes':1561 obj_ = UDBTypes.factory()1562 obj_.build(child_)1563 self.udbTypes = obj_1564 obj_.original_tagname_ = 'udbTypes'1565 elif nodeName_ == 'parameterBlocks':1566 obj_ = ParameterBlocks.factory()1567 obj_.build(child_)1568 self.parameterBlocks = obj_1569 obj_.original_tagname_ = 'parameterBlocks'1570# end class ParameterDatabase1571class Externs(GeneratedsSuper):1572 subclass = None1573 superclass = None1574 def __init__(self, externString=None):1575 self.original_tagname_ = None1576 if externString is None:1577 self.externString = []1578 else:1579 self.externString = externString1580 def factory(*args_, **kwargs_):1581 if Externs.subclass:1582 return Externs.subclass(*args_, **kwargs_)1583 else:1584 return Externs(*args_, **kwargs_)1585 factory = staticmethod(factory)1586 def get_externString(self): return self.externString1587 def set_externString(self, externString): self.externString = externString1588 def add_externString(self, value): self.externString.append(value)1589 def insert_externString_at(self, index, value): self.externString.insert(index, value)1590 def replace_externString_at(self, index, value): self.externString[index] = value1591 def hasContent_(self):1592 if (1593 self.externString1594 ):1595 return True1596 else:1597 return False1598 def export(self, outfile, level, namespace_='', name_='Externs', namespacedef_='', pretty_print=True):1599 if pretty_print:1600 eol_ = '\n'1601 else:1602 eol_ = ''1603 if self.original_tagname_ is not None:1604 name_ = self.original_tagname_1605 showIndent(outfile, level, pretty_print)1606 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1607 already_processed = set()1608 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Externs')1609 if self.hasContent_():1610 outfile.write('>%s' % (eol_, ))1611 self.exportChildren(outfile, level + 1, namespace_='', name_='Externs', pretty_print=pretty_print)1612 showIndent(outfile, level, pretty_print)1613 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1614 else:1615 outfile.write('/>%s' % (eol_, ))1616 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Externs'):1617 pass1618 def exportChildren(self, outfile, level, namespace_='', name_='Externs', fromsubclass_=False, pretty_print=True):1619 if pretty_print:1620 eol_ = '\n'1621 else:1622 eol_ = ''1623 for externString_ in self.externString:1624 showIndent(outfile, level, pretty_print)1625 outfile.write('<%sexternString>%s</%sexternString>%s' % (namespace_, self.gds_format_string(quote_xml(externString_).encode(ExternalEncoding), input_name='externString'), namespace_, eol_))1626 def exportLiteral(self, outfile, level, name_='Externs'):1627 level += 11628 already_processed = set()1629 self.exportLiteralAttributes(outfile, level, already_processed, name_)1630 if self.hasContent_():1631 self.exportLiteralChildren(outfile, level, name_)1632 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1633 pass1634 def exportLiteralChildren(self, outfile, level, name_):1635 showIndent(outfile, level)1636 outfile.write('externString=[\n')1637 level += 11638 for externString_ in self.externString:1639 showIndent(outfile, level)1640 outfile.write('%s,\n' % quote_python(externString_).encode(ExternalEncoding))1641 level -= 11642 showIndent(outfile, level)1643 outfile.write('],\n')1644 def build(self, node):1645 already_processed = set()1646 self.buildAttributes(node, node.attrib, already_processed)1647 for child in node:1648 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1649 self.buildChildren(child, node, nodeName_)1650 return self1651 def buildAttributes(self, node, attrs, already_processed):1652 pass1653 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1654 if nodeName_ == 'externString':1655 externString_ = child_.text1656 externString_ = self.gds_validate_string(externString_, node, 'externString')1657 self.externString.append(externString_)1658# end class Externs1659class Includes(GeneratedsSuper):1660 subclass = None1661 superclass = None1662 def __init__(self, includeString=None):1663 self.original_tagname_ = None1664 if includeString is None:1665 self.includeString = []1666 else:1667 self.includeString = includeString1668 def factory(*args_, **kwargs_):1669 if Includes.subclass:1670 return Includes.subclass(*args_, **kwargs_)1671 else:1672 return Includes(*args_, **kwargs_)1673 factory = staticmethod(factory)1674 def get_includeString(self): return self.includeString1675 def set_includeString(self, includeString): self.includeString = includeString1676 def add_includeString(self, value): self.includeString.append(value)1677 def insert_includeString_at(self, index, value): self.includeString.insert(index, value)1678 def replace_includeString_at(self, index, value): self.includeString[index] = value1679 def hasContent_(self):1680 if (1681 self.includeString1682 ):1683 return True1684 else:1685 return False1686 def export(self, outfile, level, namespace_='', name_='Includes', namespacedef_='', pretty_print=True):1687 if pretty_print:1688 eol_ = '\n'1689 else:1690 eol_ = ''1691 if self.original_tagname_ is not None:1692 name_ = self.original_tagname_1693 showIndent(outfile, level, pretty_print)1694 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1695 already_processed = set()1696 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Includes')1697 if self.hasContent_():1698 outfile.write('>%s' % (eol_, ))1699 self.exportChildren(outfile, level + 1, namespace_='', name_='Includes', pretty_print=pretty_print)1700 showIndent(outfile, level, pretty_print)1701 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1702 else:1703 outfile.write('/>%s' % (eol_, ))1704 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Includes'):1705 pass1706 def exportChildren(self, outfile, level, namespace_='', name_='Includes', fromsubclass_=False, pretty_print=True):1707 if pretty_print:1708 eol_ = '\n'1709 else:1710 eol_ = ''1711 for includeString_ in self.includeString:1712 showIndent(outfile, level, pretty_print)1713 outfile.write('<%sincludeString>%s</%sincludeString>%s' % (namespace_, self.gds_format_string(quote_xml(includeString_).encode(ExternalEncoding), input_name='includeString'), namespace_, eol_))1714 def exportLiteral(self, outfile, level, name_='Includes'):1715 level += 11716 already_processed = set()1717 self.exportLiteralAttributes(outfile, level, already_processed, name_)1718 if self.hasContent_():1719 self.exportLiteralChildren(outfile, level, name_)1720 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1721 pass1722 def exportLiteralChildren(self, outfile, level, name_):1723 showIndent(outfile, level)1724 outfile.write('includeString=[\n')1725 level += 11726 for includeString_ in self.includeString:1727 showIndent(outfile, level)1728 outfile.write('%s,\n' % quote_python(includeString_).encode(ExternalEncoding))1729 level -= 11730 showIndent(outfile, level)1731 outfile.write('],\n')1732 def build(self, node):1733 already_processed = set()1734 self.buildAttributes(node, node.attrib, already_processed)1735 for child in node:1736 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1737 self.buildChildren(child, node, nodeName_)1738 return self1739 def buildAttributes(self, node, attrs, already_processed):1740 pass1741 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1742 if nodeName_ == 'includeString':1743 includeString_ = child_.text1744 includeString_ = self.gds_validate_string(includeString_, node, 'includeString')1745 self.includeString.append(includeString_)1746# end class Includes1747class DataStorageAreas(GeneratedsSuper):1748 subclass = None1749 superclass = None1750 def __init__(self, dataStorageArea=None):1751 self.original_tagname_ = None1752 if dataStorageArea is None:1753 self.dataStorageArea = []1754 else:1755 self.dataStorageArea = dataStorageArea1756 def factory(*args_, **kwargs_):1757 if DataStorageAreas.subclass:1758 return DataStorageAreas.subclass(*args_, **kwargs_)1759 else:1760 return DataStorageAreas(*args_, **kwargs_)1761 factory = staticmethod(factory)1762 def get_dataStorageArea(self): return self.dataStorageArea1763 def set_dataStorageArea(self, dataStorageArea): self.dataStorageArea = dataStorageArea1764 def add_dataStorageArea(self, value): self.dataStorageArea.append(value)1765 def insert_dataStorageArea_at(self, index, value): self.dataStorageArea.insert(index, value)1766 def replace_dataStorageArea_at(self, index, value): self.dataStorageArea[index] = value1767 def hasContent_(self):1768 if (1769 self.dataStorageArea1770 ):1771 return True1772 else:1773 return False1774 def export(self, outfile, level, namespace_='', name_='DataStorageAreas', namespacedef_='', pretty_print=True):1775 if pretty_print:1776 eol_ = '\n'1777 else:1778 eol_ = ''1779 if self.original_tagname_ is not None:1780 name_ = self.original_tagname_1781 showIndent(outfile, level, pretty_print)1782 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1783 already_processed = set()1784 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DataStorageAreas')1785 if self.hasContent_():1786 outfile.write('>%s' % (eol_, ))1787 self.exportChildren(outfile, level + 1, namespace_='', name_='DataStorageAreas', pretty_print=pretty_print)1788 showIndent(outfile, level, pretty_print)1789 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1790 else:1791 outfile.write('/>%s' % (eol_, ))1792 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DataStorageAreas'):1793 pass1794 def exportChildren(self, outfile, level, namespace_='', name_='DataStorageAreas', fromsubclass_=False, pretty_print=True):1795 if pretty_print:1796 eol_ = '\n'1797 else:1798 eol_ = ''1799 for dataStorageArea_ in self.dataStorageArea:1800 showIndent(outfile, level, pretty_print)1801 outfile.write('<%sdataStorageArea>%s</%sdataStorageArea>%s' % (namespace_, self.gds_format_string(quote_xml(dataStorageArea_).encode(ExternalEncoding), input_name='dataStorageArea'), namespace_, eol_))1802 def exportLiteral(self, outfile, level, name_='DataStorageAreas'):1803 level += 11804 already_processed = set()1805 self.exportLiteralAttributes(outfile, level, already_processed, name_)1806 if self.hasContent_():1807 self.exportLiteralChildren(outfile, level, name_)1808 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1809 pass1810 def exportLiteralChildren(self, outfile, level, name_):1811 showIndent(outfile, level)1812 outfile.write('dataStorageArea=[\n')1813 level += 11814 for dataStorageArea_ in self.dataStorageArea:1815 showIndent(outfile, level)1816 outfile.write('%s,\n' % quote_python(dataStorageArea_).encode(ExternalEncoding))1817 level -= 11818 showIndent(outfile, level)1819 outfile.write('],\n')1820 def build(self, node):1821 already_processed = set()1822 self.buildAttributes(node, node.attrib, already_processed)1823 for child in node:1824 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1825 self.buildChildren(child, node, nodeName_)1826 return self1827 def buildAttributes(self, node, attrs, already_processed):1828 pass1829 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1830 if nodeName_ == 'dataStorageArea':1831 dataStorageArea_ = child_.text1832 dataStorageArea_ = self.gds_validate_string(dataStorageArea_, node, 'dataStorageArea')...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful