Ejemplo n.º 1
0
def importRequirementsFile(importFile, session_id=None):
  parser = xml.sax.make_parser()
  handler = GoalsContentHandler(session_id=session_id)
  parser.setContentHandler(handler)
  parser.setEntityResolver(handler)
  parser.parse(importFile)
  return importRequirements(handler.domainProperties(),handler.goals(),handler.obstacles(),handler.requirements(),handler.countermeasures(), session_id=session_id)
Ejemplo n.º 2
0
def importRequirementsFile(importFile,session_id = None):
  try:
    parser = xml.sax.make_parser()
    handler = GoalsContentHandler(session_id = session_id)
    parser.setContentHandler(handler)
    parser.setEntityResolver(handler)
    parser.parse(importFile)
    return importRequirements(handler.domainProperties(),handler.goals(),handler.obstacles(),handler.requirements(),handler.countermeasures(),session_id = session_id)
  except xml.sax.SAXException, e:
    raise ARMException("Error parsing" + importFile + ": " + e.getMessage())
Ejemplo n.º 3
0
def importRequirementsFile(importFile,session_id = None):
  try:
    parser = xml.sax.make_parser()
    handler = GoalsContentHandler(session_id = session_id)
    parser.setContentHandler(handler)
    parser.setEntityResolver(handler)
    parser.parse(importFile)
    return importRequirements(handler.domainProperties(),handler.goals(),handler.obstacles(),handler.requirements(),handler.countermeasures(),session_id = session_id)
  except xml.sax.SAXException, e:
    raise ARMException("Error parsing" + importFile + ": " + e.getMessage())
Ejemplo n.º 4
0
def importRequirementsFile(importFile):
    parser = xml.sax.make_parser()
    handler = GoalsContentHandler()
    parser.setContentHandler(handler)
    parser.setEntityResolver(handler)
    parser.parse(importFile)
    return importRequirements(handler.domainProperties(), handler.goals(),
                              handler.obstacles(), handler.requirements(),
                              handler.countermeasures())
Ejemplo n.º 5
0
def importRequirementsString(buf, session_id=None):
    try:
        handler = GoalsContentHandler(session_id=session_id)
        xml.sax.parseString(buf, handler)
        return importRequirements(handler.domainProperties(),
                                  handler.goals(),
                                  handler.obstacles(),
                                  handler.requirements(),
                                  handler.countermeasures(),
                                  session_id=session_id)
    except xml.sax.SAXException, e:
        raise ARMException("Error parsing" + importFile + ": " +
                           e.getMessage())