Beispiel #1
0
    for fileName in csvFiles:
        try:
            os.unlink(fileName)
        except OSError:
            pass
    print 'temp files removed'


if __name__ == "__main__":

    outputDir = os.environ['TMP_DIR']
    archDir = os.environ['ARCHITECTURE_DIR']

    removeTempFiles()
    try:
        converter = DocumentConverter()
        apMitFile = 'attackPatternMitigations.xls'
        csvFile = apMitFile.split('.')[0] + '.csv'
        converter.convert(archDir + '/' + apMitFile, outputDir + '/' + csvFile)

        xmlBuf = '<?xml version="1.0"?>\n<!DOCTYPE cairis_model PUBLIC "-//CAIRIS//DTD MODEL 1.0//EN" "http://cairis.org/dtd/cairis_model.dtd">\n\n<cairis_model>\n\n'

        dpBuf = ''
        gaBuf = ''
        aaBuf = '|_.Obstacle|_.Mitigating Requirement Name|_.Mitigating Requirement Definition|_.Affected Components|_.Satisfied (Y/N)|_.Rationale|\n'

        print 'Converting ' + csvFile
        r = csv.reader(open(outputDir + '/' + csvFile, 'rU'))
        r.next()  # skip the headers
        reqLabel = 1
        for cells in r:
def removeTempFiles():
  for fileName in csvFiles:
    try:
      os.unlink(fileName)
    except OSError:
      pass
  print 'temp files removed'

if __name__ == "__main__":
 
  outputDir = os.environ['TMP_DIR']
  archDir = os.environ['ARCHITECTURE_DIR']

  removeTempFiles()
  try: 
    converter = DocumentConverter()
    apMitFile = 'attackPatternMitigations.xls'
    csvFile = apMitFile.split('.')[0] + '.csv'
    converter.convert(archDir + '/' + apMitFile,outputDir + '/' + csvFile)

    xmlBuf = '<?xml version="1.0"?>\n<!DOCTYPE cairis_model PUBLIC "-//University of Oxford//DTD MODEL 1.0//EN" "http://www.cs.ox.ac.uk/cairis/dtd/cairis_model.dtd">\n\n<cairis_model>\n\n'

    dpBuf = ''
    gaBuf = ''
    aaBuf = '|_.Obstacle|_.Mitigating Requirement Name|_.Mitigating Requirement Definition|_.Affected Components|_.Satisfied (Y/N)|_.Rationale|\n'

    print 'Converting ' + csvFile
    r = csv.reader(open(outputDir + '/' + csvFile,'rU'))
    r.next() # skip the headers
    reqLabel = 1
    for cells in r:
Beispiel #3
0
def removeTempFiles():
  for fileName in csvFiles:
    try:
      os.unlink(fileName)
    except OSError:
      pass
  print 'temp files removed'

if __name__ == "__main__":
 
  outputDir = os.environ['TMP_DIR']
  reqDir = os.environ['REQ_DIR']

  removeTempFiles()
  try: 
    converter = DocumentConverter()
    print 'converting spreadsheets to CSV' 
    for fileName in ['TMS.xls','PS.xlsx','NM.xlsx','NC.xlsx','LC.xlsx','ID.xlsx','DA.xls','CAP.xlsx']:
      tmpFile = fileName.split('.')[0] + '.csv'
      converter.convert(reqDir + '/' + fileName,outputDir + '/' + tmpFile)
      print 'Created ' + tmpFile

    xmlBuf = '<?xml version="1.0"?>\n<!DOCTYPE goals PUBLIC "-//University of Oxford//DTD GOALS USABILITY 1.0//EN" "http://www.cs.ox.ac.uk/cairis/dtd/goals.dtd">\n\n<goals>\n\n'

    priorityLookup = {}
    priorityLookup['Low'] = '3'
    priorityLookup['Medium'] = '2'
    priorityLookup['High'] = '1'

    for csvFile in csvFiles:
      print 'Converting ' + csvFile
Beispiel #4
0
    for fileName in csvFiles:
        try:
            os.unlink(fileName)
        except OSError:
            pass
    print "temp files removed"


if __name__ == "__main__":

    outputDir = os.environ["TMP_DIR"]
    archDir = os.environ["ARCHITECTURE_DIR"]

    removeTempFiles()
    try:
        converter = DocumentConverter()
        apMitFile = "attackPatternMitigations.xls"
        csvFile = apMitFile.split(".")[0] + ".csv"
        converter.convert(archDir + "/" + apMitFile, outputDir + "/" + csvFile)

        xmlBuf = '<?xml version="1.0"?>\n<!DOCTYPE cairis_model PUBLIC "-//CAIRIS//DTD MODEL 1.0//EN" "http://cairis.org/dtd/cairis_model.dtd">\n\n<cairis_model>\n\n'

        dpBuf = ""
        gaBuf = ""
        aaBuf = "|_.Obstacle|_.Mitigating Requirement Name|_.Mitigating Requirement Definition|_.Affected Components|_.Satisfied (Y/N)|_.Rationale|\n"

        print "Converting " + csvFile
        r = csv.reader(open(outputDir + "/" + csvFile, "rU"))
        r.next()  # skip the headers
        reqLabel = 1
        for cells in r: