コード例 #1
0
ファイル: main.py プロジェクト: ashan36/report-card-generator
def run(args):

    if args.input != None:
        if valid_path(args.input[0]):
            DataParser.inputPath = args.input[0]
        else:
            print("Input path not found")
            quit()
    if args.output != None:
        if valid_path(args.output[0]):
            ReportOutput.outputPath = args.output[0]
        else:
            print("Output path not found")
            quit()

    DataParser.loadAll()

    try:
        DataStore.validateTestWeights()
        DataStore.computeAll()
    except exceptions.InvalidCourseWeightError as e:
        print(e.message)
        quit()
    except:  #Catch any other error that arises and print the exception
        print("Unknown error occured while parsing data")
        traceback.print_exc()
        quit()

    ReportOutput.saveReport()