예제 #1
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))
예제 #2
0
파일: group.py 프로젝트: dk-dev/vault112
    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)
예제 #3
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)
예제 #4
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))
예제 #5
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())
예제 #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))
예제 #7
0
 def __init__(self, xml):
     self.name = getNodeText(xml)
     self.direction = ""
     self.type = None # there is no type information, but it can be binded later
     try:
         self.direction = xml.attributes["direction"].value
     except KeyError:
         pass
예제 #8
0
 def __init__(self, xml):
     self.name = getNodeText(xml)
     self.direction = ""
     self.type = None  # there is no type information, but it can be binded later
     try:
         self.direction = xml.attributes["direction"].value
     except KeyError:
         pass
예제 #9
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))
예제 #10
0
파일: page.py 프로젝트: freel210/fonline
    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)
예제 #11
0
파일: section.py 프로젝트: dk-dev/vault112
    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
예제 #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
예제 #13
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())
예제 #14
0
def convertLine(node, parent):

    if node is None:
        return []

    text = []
    child = node.firstChild
    while child is not None:
        if child.nodeType == child.TEXT_NODE:
            text.append(Text(child, parent))
        else:
            try:
                e = elements[child.tagName]
            except KeyError:
                print "Unrecognized element,", child.tagName
                t = Text(None, parent)
                t.text = getNodeText(child).strip()
                text.append(t)
            else:
                text.append(e(child, parent))

        child = child.nextSibling
    return text