Exemple #1
0
def getExceptions(root):
    exceptions = []
    for plist in root.findall("detaileddescription/para/parameterlist"):
        if (plist.get("kind") == "exception"):
            for exp in plist.findall("parameteritem"):
                extype = exp.find("parameternamelist/parametername")
                if (extype.text == None):
                    logError(
                        "Doxygen has f****d up, symbol exceptions might be corrupted!"
                    )
                    extype.text = ""
                exname = strOp.epurStr(extype.text)
                if (extype.find("ref") != None):
                    extype = extype.find("ref").get("refid")
                else:
                    extype = None
                exdesc = ""
                for txt in exp.find("parameterdescription").itertext():
                    exdesc += " " + strOp.epurStr(txt)
                cl = exceptionClass()
                cl.typename = exname
                cl.reference = extype
                cl.description = exdesc
                exceptions.append(cl)
    return (exceptions)
Exemple #2
0
def getReturnDesc(elem):
    try:
        tmp = ""
        for simplesect in elem.findall("detaileddescription/para/simplesect"):
            if simplesect.get("kind") == "return":
                for ret in simplesect.itertext():
                    tmp += " " + strOp.epurStr(ret)
        tmp = strOp.epurStr(tmp)
        return tmp
    except Exception as error:
        useful.printExceptionVerbose(error)
        return ""
Exemple #3
0
def getFunctionDetailedDesc(elem):
    detailedDesc = ""
    try:
        detailedDesc += strOp.epurStr(
            elem.find("detaileddescription/para").text)
        if elem.find("detaileddescription/para/simplesect").get(
                "kind") == 'note':
            for token in elem.find(
                    "detaileddescription/para/simplesect").itertext():
                detailedDesc += " " + token.replace('\n', '').replace(
                    '\t', ' ')
        return strOp.epurStr(detailedDesc)
    except Exception as error:
        useful.printExceptionVerbose(error)
        return detailedDesc
Exemple #4
0
def getParamDesc(elem, params):
    try:
        for param in elem.find("detaileddescription/para/parameterlist"
                               ).findall("parameteritem"):
            name = strOp.epurStr(
                param.find("parameternamelist/parametername").text)
            tmp = ""
            for txt in param.find("parameterdescription").itertext():
                tmp += " " + strOp.epurStr(txt)
            for param in params:
                if param.name == name:
                    param.desc = strOp.epurStr(tmp)
                    break
        return params
    except Exception as error:
        useful.printExceptionVerbose(error)
        return params
Exemple #5
0
def getBriefDesc(elem):
    try:
        briefDesc = ""
        for token in elem.find("briefdescription").itertext():
            briefDesc += token.replace('\n', '').replace('\t', ' ')
        return strOp.epurStr(briefDesc)
    except Exception as error:
        useful.printExceptionVerbose(error)
        return ""
Exemple #6
0
def getInitializer(elem):
    try:
        init = strOp.epurStr(elem.find("initializer").text)
        if init.startswith('= '):
            init = init[2:]
        return init
    except Exception as error:
        useful.printExceptionVerbose(error)
        return ""
Exemple #7
0
def getDetailedDesc(elem):
    try:
        return (strOp.epurStr(elem.find("detaileddescription/para").text))
        #detailedDesc = ""
        #for token in elem.find("detaileddescription").itertext():
        #    detailedDesc += " " + token.replace('\n', '').replace('\t', ' ')
        #return strOp.epurStr(detailedDesc)
    except Exception as error:
        useful.printExceptionVerbose(error)
        return ""
Exemple #8
0
def getType(elem):
    try:
        elemType = ""
        for token in elem.find("type").itertext():
            elemType += token
        elemType = strOp.removePointerSpace(strOp.epurStr(elemType))
        return elemType
    except Exception as error:
        useful.printExceptionVerbose(error)
        return ""
Exemple #9
0
def getParams(define):
    params = []
    try:
        for param in define.findall("param"):
            tmpParam = variableClass()
            try:
                tmpParam.name = strOp.epurStr(param.find("defname").text)
                if (param.find("defval")):
                    tmpParam.value = strOp.epurStr(param.find("defval").text)
            except Exception as error:
                useful.printExceptionVerbose(error)
                tmpParam.name = strOp.epurStr(param.find("declname").text)
            t = param.find("type")
            if (t.find("ref") != None):
                tmpParam.ref = t.find("ref").get("refid")
            tmpParam.type = getType(param)
            params.append(tmpParam)
        return params
    except Exception as error:
        useful.printExceptionVerbose(error)
        return params
Exemple #10
0
def getRetvals(elem):
    retvals = []
    try:
        for parameterlist in elem.findall(
                "detaileddescription/para/parameterlist"):
            if parameterlist.get("kind") == "retval":
                for retval in parameterlist.findall("parameteritem"):
                    tmp = variableClass()
                    tmpName = ""
                    for txt in retval.find(
                            "parameternamelist/parametername").itertext():
                        tmpName += " " + strOp.epurStr(txt)
                    tmpDesc = ""
                    for txt in retval.find("parameterdescription").itertext():
                        tmpDesc += " " + strOp.epurStr(txt)
                    tmp.value = strOp.epurStr(tmpName)
                    tmp.desc = strOp.epurStr(tmpDesc)
                    retvals.append(tmp)
        return retvals
    except Exception as error:
        useful.printExceptionVerbose(error)
        return retvals
Exemple #11
0
def getTypedef(elem):
    syms = []
    tdType = getters.getType(elem)
    include = getters.getLocation(elem)
    try:
        if elem.find("argsstring").text:
            tmp = strOp.epurStr(elem.find("argsstring").text)
        else:
            return syms
        tdType = strOp.epurStr(tdType + tmp)
    except Exception as error:
        useful.printExceptionVerbose(error)
        pass
    tdName = getters.getName(elem)
    briefDesc = getters.getBriefDesc(elem)
    detailedDesc = getters.getDetailedDesc(elem)
    typedefProto = buildPrototype("typedef " + tdName + " " + tdType,
                                  briefDesc)
    syms.append(
        buildTypedef(path=tdName,
                     prototypeObj=typedefProto,
                     importString=include))
    return syms
Exemple #12
0
def getCompoundName(elem):
    return strOp.epurStr(elem.find("compounddef/compoundname").text)
Exemple #13
0
def getName(elem):
    ret = elem.find("name")
    if ret != -1:
        return strOp.epurStr(elem.find("name").text)
    return "ERRORED"