preprocess.py 568 B

123456789101112131415161718
  1. import argparse
  2. import TestScripts.NewParser as parse
  3. import pickle
  4. parser = argparse.ArgumentParser(description='Parse test description')
  5. parser.add_argument('-f', nargs='?',type = str, default=None, help="Test description file path")
  6. parser.add_argument('-o', nargs='?',type = str, default="Output.pickle", help="output file for parsed description")
  7. args = parser.parse_args()
  8. if args.f is not None:
  9. p = parse.Parser()
  10. # Parse the test description file
  11. root = p.parse(args.f)
  12. with open(args.o,"wb") as output:
  13. pickle.dump(root, output)