def __parseXmlResult(self, xmlResult): result = de_util.getResultObject() try: xmlDoc = minidom.parseString(xmlResult) functionNodes = xmlDoc.getElementsByTagName("function") for fNode in functionNodes: fName = fNode.getAttribute("name") fDetail = fNode.firstChild fVariable = fDetail.getElementsByTagName( "type")[0].firstChild.nodeValue fLineNumber = fDetail.getElementsByTagName( "line_number")[0].firstChild.nodeValue errorText = "Function [ %s ] :: Variable [ %s ] " % (fName, fVariable) errorCaption = "Varscoper :: %s " % (fLineNumber) result["errors"].append( de_util.returnErrorArray(errorCaption, errorText)) result["regions"].append( self.baseLinter.getRegion(fLineNumber)) except Exception as e: de_util.log("Error parsing xml results :: " + str(e)) return result
def __parseXmlResult(self, xmlResult): result = de_util.getResultObject() try: xmlDoc = minidom.parseString(xmlResult) functionNodes =xmlDoc.getElementsByTagName("function") for fNode in functionNodes: fName = fNode.getAttribute("name") fDetail = fNode.firstChild fVariable = fDetail.getElementsByTagName("type")[0].firstChild.nodeValue fLineNumber = fDetail.getElementsByTagName("line_number")[0].firstChild.nodeValue errorText = "Function [ %s ] :: Variable [ %s ] " % (fName, fVariable) errorCaption = "Varscoper :: %s " % (fLineNumber) result["errors"].append(de_util.returnErrorArray(errorCaption, errorText)) result["regions"].append(self.baseLinter.getRegion(fLineNumber)) except Exception as e: de_util.log("Error parsing xml results :: " + str(e)) return result
def __getErrors(self, regex=None, errorText=None, selections=None): if selections is None: selections = self.view.find_all(regex, sublime.IGNORECASE) errorResult = None if selections: errorResult = de_util.getResultObject() errorResult["regions"] = selections for region in selections: lineNumber = self.baseLinter.getLineNumber(region) errorCaption = "DE Standard :: %+5s " % (str(lineNumber)) errorResult["errors"].append(de_util.returnErrorArray(errorCaption, errorText)) return errorResult
def __getErrors(self, regex=None, errorText=None, selections=None): if selections is None: selections = self.view.find_all(regex, sublime.IGNORECASE) errorResult = None if selections: errorResult = de_util.getResultObject() errorResult["regions"] = selections for region in selections: lineNumber = self.baseLinter.getLineNumber(region) errorCaption = "DE Standard :: %+5s " % (str(lineNumber)) errorResult["errors"].append( de_util.returnErrorArray(errorCaption, errorText)) return errorResult