def importTVTypeFile(importFile, isOverwrite=1, session_id=None): parser = xml.sax.make_parser() handler = TVTypeContentHandler() parser.setContentHandler(handler) parser.setEntityResolver(handler) parser.parse(importFile) vulTypes,threatTypes = handler.types() return importTVTypes(vulTypes,threatTypes,isOverwrite, session_id=session_id)
def importTVTypeFile(importFile, isOverwrite=1): parser = xml.sax.make_parser() handler = TVTypeContentHandler() parser.setContentHandler(handler) parser.setEntityResolver(handler) parser.parse(importFile) vulTypes, threatTypes = handler.types() return importTVTypes(vulTypes, threatTypes, isOverwrite)
def importTVTypeFile(importFile,isOverwrite=1,session_id = None): try: parser = xml.sax.make_parser() handler = TVTypeContentHandler() parser.setContentHandler(handler) parser.setEntityResolver(handler) parser.parse(importFile) vulTypes,threatTypes = handler.types() return importTVTypes(vulTypes,threatTypes,isOverwrite,session_id) except xml.sax.SAXException, e: raise ARMException("Error parsing" + importFile + ": " + e.getMessage())