diff options
Diffstat (limited to 'gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py')
-rw-r--r-- | gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py | 115 |
1 files changed, 87 insertions, 28 deletions
diff --git a/gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py b/gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py index cc2c112418..b30e062ae7 100644 --- a/gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py +++ b/gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py @@ -24,12 +24,16 @@ except ImportError as exp: class GeneratedsSuper(object): def format_string(self, input_data, input_name=''): return input_data + def format_integer(self, input_data, input_name=''): return '%d' % input_data + def format_float(self, input_data, input_name=''): return '%f' % input_data + def format_double(self, input_data, input_name=''): return '%e' % input_data + def format_boolean(self, input_data, input_name=''): return '%s' % input_data @@ -41,9 +45,9 @@ except ImportError as exp: ## from IPython.Shell import IPShellEmbed ## args = '' -## ipshell = IPShellEmbed(args, +# ipshell = IPShellEmbed(args, ## banner = 'Dropping into IPython', -## exit_msg = 'Leaving Interpreter, back to program.') +# exit_msg = 'Leaving Interpreter, back to program.') # Then use the following line where and when you want to drop into the # IPython shell: @@ -59,10 +63,12 @@ ExternalEncoding = 'ascii' # Support/utility functions. # + def showIndent(outfile, level): for idx in range(level): outfile.write(' ') + def quote_xml(inStr): s1 = (isinstance(inStr, str) and inStr or '%s' % inStr) @@ -71,6 +77,7 @@ def quote_xml(inStr): s1 = s1.replace('>', '>') return s1 + def quote_attrib(inStr): s1 = (isinstance(inStr, str) and inStr or '%s' % inStr) @@ -86,6 +93,7 @@ def quote_attrib(inStr): s1 = '"%s"' % s1 return s1 + def quote_python(inStr): s1 = inStr if s1.find("'") == -1: @@ -117,26 +125,33 @@ class MixedContainer(object): TypeDecimal = 5 TypeDouble = 6 TypeBoolean = 7 + def __init__(self, category, content_type, name, value): self.category = category self.content_type = content_type self.name = name self.value = value + def getCategory(self): return self.category + def getContenttype(self, content_type): return self.content_type + def getValue(self): return self.value + def getName(self): return self.name + def export(self, outfile, level, name, namespace): if self.category == MixedContainer.CategoryText: outfile.write(self.value) elif self.category == MixedContainer.CategorySimple: self.exportSimple(outfile, level, name) else: # category == MixedContainer.CategoryComplex - self.value.export(outfile, level, namespace,name) + self.value.export(outfile, level, namespace, name) + def exportSimple(self, outfile, level, name): if self.content_type == MixedContainer.TypeString: outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name)) @@ -148,19 +163,20 @@ class MixedContainer(object): outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeDouble: outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): if self.category == MixedContainer.CategoryText: showIndent(outfile, level) - outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \ - (self.category, self.content_type, self.name, self.value)) + outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % + (self.category, self.content_type, self.name, self.value)) elif self.category == MixedContainer.CategorySimple: showIndent(outfile, level) - outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \ - (self.category, self.content_type, self.name, self.value)) + outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % + (self.category, self.content_type, self.name, self.value)) else: # category == MixedContainer.CategoryComplex showIndent(outfile, level) - outfile.write('MixedContainer(%d, %d, "%s",\n' % \ - (self.category, self.content_type, self.name,)) + outfile.write('MixedContainer(%d, %d, "%s",\n' % + (self.category, self.content_type, self.name,)) self.value.exportLiteral(outfile, level + 1) showIndent(outfile, level) outfile.write(')\n') @@ -171,6 +187,7 @@ class _MemberSpec(object): self.name = name self.data_type = data_type self.container = container + def set_name(self, name): self.name = name def get_name(self): return self.name def set_data_type(self, data_type): self.data_type = data_type @@ -186,12 +203,14 @@ class _MemberSpec(object): class DoxygenType(GeneratedsSuper): subclass = None superclass = None + def __init__(self, version=None, compound=None): self.version = version if compound is None: self.compound = [] else: self.compound = compound + def factory(*args_, **kwargs_): if DoxygenType.subclass: return DoxygenType.subclass(*args_, **kwargs_) @@ -204,6 +223,7 @@ class DoxygenType(GeneratedsSuper): def insert_compound(self, index, value): self.compound[index] = value def get_version(self): return self.version def set_version(self, version): self.version = version + def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''): showIndent(outfile, level) outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) @@ -215,27 +235,34 @@ class DoxygenType(GeneratedsSuper): outfile.write('</%s%s>\n' % (namespace_, name_)) else: outfile.write(' />\n') + def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'): - outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), )) + outfile.write(' version=%s' % (self.format_string(quote_attrib( + self.version).encode(ExternalEncoding), input_name='version'), )) + def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'): for compound_ in self.compound: compound_.export(outfile, level, namespace_, name_='compound') + def hasContent_(self): if ( self.compound is not None - ): + ): return True else: return False + def exportLiteral(self, outfile, level, name_='DoxygenType'): level += 1 self.exportLiteralAttributes(outfile, level, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, name_): if self.version is not None: showIndent(outfile, level) outfile.write('version = %s,\n' % (self.version,)) + def exportLiteralChildren(self, outfile, level, name_): showIndent(outfile, level) outfile.write('compound=[\n') @@ -249,18 +276,21 @@ class DoxygenType(GeneratedsSuper): level -= 1 showIndent(outfile, level) outfile.write('],\n') + def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(':')[-1] self.buildChildren(child_, nodeName_) + def buildAttributes(self, attrs): if attrs.get('version'): self.version = attrs.get('version').value + def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and \ - nodeName_ == 'compound': + nodeName_ == 'compound': obj_ = CompoundType.factory() obj_.build(child_) self.compound.append(obj_) @@ -270,6 +300,7 @@ class DoxygenType(GeneratedsSuper): class CompoundType(GeneratedsSuper): subclass = None superclass = None + def __init__(self, kind=None, refid=None, name=None, member=None): self.kind = kind self.refid = refid @@ -278,6 +309,7 @@ class CompoundType(GeneratedsSuper): self.member = [] else: self.member = member + def factory(*args_, **kwargs_): if CompoundType.subclass: return CompoundType.subclass(*args_, **kwargs_) @@ -294,6 +326,7 @@ class CompoundType(GeneratedsSuper): def set_kind(self, kind): self.kind = kind def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid + def export(self, outfile, level, namespace_='', name_='CompoundType', namespacedef_=''): showIndent(outfile, level) outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) @@ -305,28 +338,35 @@ class CompoundType(GeneratedsSuper): outfile.write('</%s%s>\n' % (namespace_, name_)) else: outfile.write(' />\n') + def exportAttributes(self, outfile, level, namespace_='', name_='CompoundType'): outfile.write(' kind=%s' % (quote_attrib(self.kind), )) - outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), )) + outfile.write(' refid=%s' % (self.format_string(quote_attrib( + self.refid).encode(ExternalEncoding), input_name='refid'), )) + def exportChildren(self, outfile, level, namespace_='', name_='CompoundType'): if self.name is not None: showIndent(outfile, level) - outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) + outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string( + quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) for member_ in self.member: member_.export(outfile, level, namespace_, name_='member') + def hasContent_(self): if ( self.name is not None or self.member is not None - ): + ): return True else: return False + def exportLiteral(self, outfile, level, name_='CompoundType'): level += 1 self.exportLiteralAttributes(outfile, level, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, name_): if self.kind is not None: showIndent(outfile, level) @@ -334,9 +374,11 @@ class CompoundType(GeneratedsSuper): if self.refid is not None: showIndent(outfile, level) outfile.write('refid = %s,\n' % (self.refid,)) + def exportLiteralChildren(self, outfile, level, name_): showIndent(outfile, level) - outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) + outfile.write('name=%s,\n' % quote_python( + self.name).encode(ExternalEncoding)) showIndent(outfile, level) outfile.write('member=[\n') level += 1 @@ -349,26 +391,29 @@ class CompoundType(GeneratedsSuper): level -= 1 showIndent(outfile, level) outfile.write('],\n') + def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(':')[-1] self.buildChildren(child_, nodeName_) + def buildAttributes(self, attrs): if attrs.get('kind'): self.kind = attrs.get('kind').value if attrs.get('refid'): self.refid = attrs.get('refid').value + def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and \ - nodeName_ == 'name': + nodeName_ == 'name': name_ = '' for text__content_ in child_.childNodes: name_ += text__content_.nodeValue self.name = name_ elif child_.nodeType == Node.ELEMENT_NODE and \ - nodeName_ == 'member': + nodeName_ == 'member': obj_ = MemberType.factory() obj_.build(child_) self.member.append(obj_) @@ -378,10 +423,12 @@ class CompoundType(GeneratedsSuper): class MemberType(GeneratedsSuper): subclass = None superclass = None + def __init__(self, kind=None, refid=None, name=None): self.kind = kind self.refid = refid self.name = name + def factory(*args_, **kwargs_): if MemberType.subclass: return MemberType.subclass(*args_, **kwargs_) @@ -394,6 +441,7 @@ class MemberType(GeneratedsSuper): def set_kind(self, kind): self.kind = kind def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid + def export(self, outfile, level, namespace_='', name_='MemberType', namespacedef_=''): showIndent(outfile, level) outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) @@ -405,25 +453,32 @@ class MemberType(GeneratedsSuper): outfile.write('</%s%s>\n' % (namespace_, name_)) else: outfile.write(' />\n') + def exportAttributes(self, outfile, level, namespace_='', name_='MemberType'): outfile.write(' kind=%s' % (quote_attrib(self.kind), )) - outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), )) + outfile.write(' refid=%s' % (self.format_string(quote_attrib( + self.refid).encode(ExternalEncoding), input_name='refid'), )) + def exportChildren(self, outfile, level, namespace_='', name_='MemberType'): if self.name is not None: showIndent(outfile, level) - outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) + outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string( + quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) + def hasContent_(self): if ( self.name is not None - ): + ): return True else: return False + def exportLiteral(self, outfile, level, name_='MemberType'): level += 1 self.exportLiteralAttributes(outfile, level, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, name_): if self.kind is not None: showIndent(outfile, level) @@ -431,23 +486,28 @@ class MemberType(GeneratedsSuper): if self.refid is not None: showIndent(outfile, level) outfile.write('refid = %s,\n' % (self.refid,)) + def exportLiteralChildren(self, outfile, level, name_): showIndent(outfile, level) - outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) + outfile.write('name=%s,\n' % quote_python( + self.name).encode(ExternalEncoding)) + def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(':')[-1] self.buildChildren(child_, nodeName_) + def buildAttributes(self, attrs): if attrs.get('kind'): self.kind = attrs.get('kind').value if attrs.get('refid'): self.refid = attrs.get('refid').value + def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and \ - nodeName_ == 'name': + nodeName_ == 'name': name_ = '' for text__content_ in child_.childNodes: name_ += text__content_.nodeValue @@ -461,6 +521,7 @@ Options: -s Use the SAX parser, not the minidom parser. """ + def usage(): print(USAGE_TEXT) sys.exit(1) @@ -475,7 +536,7 @@ def parse(inFileName): doc = None sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export(sys.stdout, 0, name_="doxygenindex", - namespacedef_='') + namespacedef_='') return rootObj @@ -488,7 +549,7 @@ def parseString(inString): doc = None sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export(sys.stdout, 0, name_="doxygenindex", - namespacedef_='') + namespacedef_='') return rootObj @@ -514,9 +575,7 @@ def main(): usage() - - if __name__ == '__main__': main() #import pdb - #pdb.run('main()') + # pdb.run('main()') |