You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

6 years ago
  1. #!/usr/bin/env python3
  2. import os
  3. import configparser
  4. import argparse
  5. def main():
  6. args = __parseArguments();
  7. config = configparser.ConfigParser()
  8. dirs = {"INSTANCE_DIR": "instances",
  9. "MINISAT_RESULT_DIR": "minisatResults",
  10. "WMIS_RESULT_DIR": "wmisResults",
  11. "COMPARISON_DIR": "comparison"}
  12. dirs["COMPARISON_STATS_DIR"] = os.path.join(dirs["COMPARISON_DIR"],
  13. "stats")
  14. config["STRUCTURE"] = dirs
  15. os.mkdir(args["dir"])
  16. os.mkdir(os.path.join(args["dir"], dirs["INSTANCE_DIR"]))
  17. os.mkdir(os.path.join(args["dir"], dirs["MINISAT_RESULT_DIR"]))
  18. os.mkdir(os.path.join(args["dir"], dirs["WMIS_RESULT_DIR"]))
  19. os.mkdir(os.path.join(args["dir"], dirs["COMPARISON_DIR"]))
  20. os.mkdir(os.path.join(args["dir"], dirs["COMPARISON_STATS_DIR"]))
  21. with open(os.path.join(args["dir"], "dataset.config"), "w") as configfile:
  22. config.write(configfile)
  23. configfile.close()
  24. def __parseArguments():
  25. parser = argparse.ArgumentParser()
  26. parser.add_argument("-d", "--directory", help="the direcotry for the new dataset", type=str)
  27. args = parser.parse_args()
  28. arguments = {}
  29. print(args)
  30. arguments["dir"] = args.directory
  31. if arguments["dir"] == None:
  32. arguments["dir"] = str(input("Directory: "))
  33. arguments["dir"] = os.path.abspath(arguments["dir"])
  34. return arguments
  35. if __name__ == "__main__":
  36. main()