Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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())
Exemple #4
0
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())