Ejemplo n.º 1
0
    def __init__(self, xml, template):
        def getSections(file, predicate=None):
            return [
                DoxygenSection(sd, self) for sd in filter(
                    predicate, getDirectDescendants(xml, "sectiondef"))
            ]

        def isUserDefined(section):
            return section.attributes["kind"].value == "user-defined"

        self.id = xml.attributes["id"].value
        self.parent = None
        self.template = template
        self.name = getNodeText(xml.getElementsByTagName("compoundname")[0])
        self.title = getNodeText(getDirectDescendant(xml, "title"))
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"),
                                 self)
        self.detailed = convertLine(
            getDirectDescendant(xml, "detaileddescription"), self)

        # call base class constructor
        WikiPage.__init__(self, self.getPageName())

        self.usersections = getSections(xml, isUserDefined)
        self.generatedsections = getSections(xml,
                                             lambda x: not isUserDefined(x))

        programlistings = xml.getElementsByTagName("programlisting")
        if len(programlistings) > 0:
            self.programlisting = ProgramListing(programlistings[0], self)
Ejemplo n.º 2
0
    def __init__(self, xml):
        def getSections(file, predicate=None):
            return [
                DoxygenSection(sd, self) for sd in filter(
                    predicate, getDirectDescendants(xml, "sectiondef"))
            ]

        def isUserDefined(section):
            return section.attributes["kind"].value == "user-defined"

        self.id = xml.attributes["id"].value
        self.name = getNodeText(xml.getElementsByTagName("compoundname")[0])
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"),
                                 self)
        self.detailed = convertLine(
            getDirectDescendant(xml, "detaileddescription"), self)

        # call base class constructor
        WikiPage.__init__(self, self.getPageName())

        self.user_sections = getSections(xml, isUserDefined)
        self.generated_sections = getSections(xml,
                                              lambda x: not isUserDefined(x))

        # register class page
        doxygen.addLink(self.id, self.getPageName())
Ejemplo n.º 3
0
    def __init__(self, xml, parent_page):
        self.parent_page = parent_page
        self.refid = xml.attributes["id"].value
        self.name = getNodeText(xml.getElementsByTagName("name")[0])
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"), self)
        self.detailed = convertLine(getDirectDescendant(xml, "detaileddescription"), self)
        self.type = getNodeText(xml.getElementsByTagName("type")[0])

        # TODO: rewrite
        self.params = []
        paramsdict = {}
        for p in xml.getElementsByTagName("param"):
            type = getNodeText(p.getElementsByTagName("type")[0])
            declnameNode = getDirectDescendant(p, "declname")
            if declnameNode is not None:
                declname = getNodeText(declnameNode)
                paramsdict[declname] = type
            else:
                declname = ""
            self.params.append((type, declname))

        self.param_groups = [ParamGroup(node) for node in xml.getElementsByTagName("parameteritem")]
        # typing
        for param_group in self.param_groups:
            for param in param_group.params:
                 param.type = paramsdict[param.name]
        
        self.returns = ReturnGroup(getDirectDescendant(xml, "detaileddescription"))
        self.remarks = RemarkGroup(getDirectDescendant(xml, "detaileddescription"))
        self.see = SeeGroup(getDirectDescendant(xml, "detaileddescription"))
        
        # register function
        self.parent_page.addMember(self.refid, self.name)
        doxygen.addLink(self.refid, parent_page.getPageName() + "#" + self.parent_page.getMemberAnchor(self.refid))
Ejemplo n.º 4
0
    def __init__(self, xml, template):

        def getSections(file, predicate=None):
            return [DoxygenSection(sd, self) for sd in filter(predicate, getDirectDescendants(xml, "sectiondef"))]

        def isUserDefined(section):
            return section.attributes["kind"].value == "user-defined"

        self.id = xml.attributes["id"].value
        self.parent = None
        self.template = template
        self.name = getNodeText(xml.getElementsByTagName("compoundname")[0])
        self.title = getNodeText(getDirectDescendant(xml, "title"))
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"), self)
        self.detailed = convertLine(getDirectDescendant(xml, "detaileddescription"), self)
        
        # call base class constructor
        WikiPage.__init__(self, self.getPageName())

        self.usersections = getSections(xml, isUserDefined)
        self.generatedsections = getSections(xml, lambda x: not isUserDefined(x))

        programlistings = xml.getElementsByTagName("programlisting");
        if len(programlistings) > 0:
            self.programlisting = ProgramListing(programlistings[0], self)
Ejemplo n.º 5
0
 def __init__(self, xml, parent_page):
     self.parent_page = parent_page
     self.refid = xml.attributes["id"].value
     self.type = getNodeText(xml.getElementsByTagName("type")[0])
     self.name = getNodeText(xml.getElementsByTagName("name")[0])
     self.initializer = getNodeText(getDirectDescendant(xml, "initialize"))
     self.brief = convertLine(getDirectDescendant(xml, "briefdescription"), self)
     self.detailed = convertLine(getDirectDescendant(xml, "detaileddescription"), self)
     
     # register variable
     self.parent_page.addMember(self.refid, self.name)
     doxygen.addLink(self.refid, parent_page.getPageName() + "#" + self.parent_page.getMemberAnchor(self.refid))
Ejemplo n.º 6
0
    def __init__(self, xml, parent_page):
        self.parent_page = parent_page
        self.refid = xml.attributes["id"].value
        self.type = getNodeText(xml.getElementsByTagName("type")[0])
        self.name = getNodeText(xml.getElementsByTagName("name")[0])
        self.initializer = getNodeText(getDirectDescendant(xml, "initialize"))
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"),
                                 self)
        self.detailed = convertLine(
            getDirectDescendant(xml, "detaileddescription"), self)

        # register variable
        self.parent_page.addMember(self.refid, self.name)
        doxygen.addLink(
            self.refid,
            parent_page.getPageName() + "#" +
            self.parent_page.getMemberAnchor(self.refid))
Ejemplo n.º 7
0
    def __init__(self, xml, parent_page):
        self.parent_page = parent_page
        self.refid = xml.attributes["id"].value
        self.name = getNodeText(xml.getElementsByTagName("name")[0])
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"),
                                 self)
        self.detailed = convertLine(
            getDirectDescendant(xml, "detaileddescription"), self)
        self.type = getNodeText(xml.getElementsByTagName("type")[0])

        # TODO: rewrite
        self.params = []
        paramsdict = {}
        for p in xml.getElementsByTagName("param"):
            type = getNodeText(p.getElementsByTagName("type")[0])
            declnameNode = getDirectDescendant(p, "declname")
            if declnameNode is not None:
                declname = getNodeText(declnameNode)
                paramsdict[declname] = type
            else:
                declname = ""
            self.params.append((type, declname))

        self.param_groups = [
            ParamGroup(node)
            for node in xml.getElementsByTagName("parameteritem")
        ]
        # typing
        for param_group in self.param_groups:
            for param in param_group.params:
                param.type = paramsdict[param.name]

        self.returns = ReturnGroup(
            getDirectDescendant(xml, "detaileddescription"))
        self.remarks = RemarkGroup(
            getDirectDescendant(xml, "detaileddescription"))
        self.see = SeeGroup(getDirectDescendant(xml, "detaileddescription"))

        # register function
        self.parent_page.addMember(self.refid, self.name)
        doxygen.addLink(
            self.refid,
            parent_page.getPageName() + "#" +
            self.parent_page.getMemberAnchor(self.refid))
Ejemplo n.º 8
0
    def __init__(self, xml):

        def getSections(file, predicate=None):
            return [DoxygenSection(sd, self) for sd in filter(predicate, getDirectDescendants(xml, "sectiondef"))]

        def isUserDefined(section):
            return section.attributes["kind"].value == "user-defined"
        
        self.id = xml.attributes["id"].value
        self.name = getNodeText(xml.getElementsByTagName("compoundname")[0])
        self.brief = convertLine(getDirectDescendant(xml, "briefdescription"), self)
        self.detailed = convertLine(getDirectDescendant(xml, "detaileddescription"), self)
        
        # call base class constructor
        WikiPage.__init__(self, self.getPageName())
        
        self.user_sections = getSections(xml, isUserDefined)
        self.generated_sections = getSections(xml, lambda x: not isUserDefined(x))
               
        # register class page
        doxygen.addLink(self.id, self.getPageName())
Ejemplo n.º 9
0
 def extractRemarks(node):
     remarks = []
     remark = []
     for el in getDirectDescendants(node, "*"):
         if (el.tagName == "para"):
             remark[-1:] = (convertLine(el, None))
         elif (el.tagName == "simplesectsep"):  # remarks delimiter
             remarks.append(remark)
             remark = []
     else:
         if len(remark) > 0:
             remarks.append(remark)
     return remarks
Ejemplo n.º 10
0
 def extractRemarks(node):
     remarks = []
     remark = []
     for el in getDirectDescendants(node, "*"):
         if (el.tagName == "para"):
             remark[-1:] = (convertLine(el, None))
         elif (el.tagName == "simplesectsep"): # remarks delimiter
             remarks.append(remark)
             remark = []
     else:
         if len(remark) > 0:
             remarks.append(remark)
     return remarks
Ejemplo n.º 11
0
    def __init__(self, xml):
        self.id = xml.attributes["id"].value
        if self.id == "indexpage":
            self.pagename = options.prefix
        else:
            self.pagename = options.prefix + "_" + self.id

        doxygen.addLink(self.id, self.pagename)

        try:
            title = xml.getElementsByTagName("title")[0]
        except IndexError:
            self.title = ""
        else:
            self.title = getNodeText(title)

        self.detailed = convertLine(xml.getElementsByTagName("detaileddescription")[0], self)
Ejemplo n.º 12
0
    def __init__(self, xml, parent_page):
        def kind(node):
            return node.attributes["kind"].value

        self.parent_page = parent_page
        self.kind = xml.attributes["kind"].value
        self.name = getNodeText(getDirectDescendant(xml, "header"))
        self._description = convertLine(
            getDirectDescendant(xml, "description"), self)

        self.functions = []
        self.variables = []

        for node in getDirectDescendants(xml, "memberdef"):
            if kind(node) == "function":
                self.functions.append(DoxygenMemberFunction(node, parent_page))
            elif kind(node) == "variable":
                self.variables.append(DoxygenMemberVariable(node, parent_page))
            else:
                pass
Ejemplo n.º 13
0
    def __init__(self, xml, parent_page):
        
        def kind(node):
            return node.attributes["kind"].value

        self.parent_page = parent_page;
        self.kind = xml.attributes["kind"].value
        self.name = getNodeText(getDirectDescendant(xml, "header"))
        self._description = convertLine(getDirectDescendant(xml, "description"), self)
        
        self.functions = []
        self.variables = []
        
        for node in getDirectDescendants(xml, "memberdef"):
            if kind(node) == "function":
                self.functions.append(DoxygenMemberFunction(node, parent_page))
            elif kind(node) == "variable":
                self.variables.append(DoxygenMemberVariable(node, parent_page))
            else:
                pass
Ejemplo n.º 14
0
 def extractLinks(node):
     return [convertLine(n, self) for n in getDirectDescendants(node, "para")]
Ejemplo n.º 15
0
 def __init__(self, xml):
     self.params = [
         Param(node) for node in xml.getElementsByTagName("parametername")
     ]
     self._description = convertLine(
         getDirectDescendant(xml, "parameterdescription"), self)
Ejemplo n.º 16
0
 def extractLinks(node):
     return [
         convertLine(n, self)
         for n in getDirectDescendants(node, "para")
     ]
Ejemplo n.º 17
0
 def __init__(self, xml):
     self.items = [convertLine(s, self) for s in xml.getElementsByTagName("simplesect") if kind(s) == "return"]
Ejemplo n.º 18
0
 def __init__(self, xml):
     self.params = [Param(node) for node in xml.getElementsByTagName("parametername")]
     self._description = convertLine(getDirectDescendant(xml, "parameterdescription"), self)
Ejemplo n.º 19
0
 def __init__(self, xml):
     self.items = [
         convertLine(s, self)
         for s in xml.getElementsByTagName("simplesect")
         if kind(s) == "return"
     ]