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

#!/usr/bin/env python3
import os
import configparser
import argparse
def main():
args = __parseArguments();
config = configparser.ConfigParser()
dirs = {"INSTANCE_DIR": "instances",
"MINISAT_RESULT_DIR": "minisatResults",
"WMIS_RESULT_DIR": "wmisResults",
"COMPARISON_DIR": "comparison"}
dirs["COMPARISON_STATS_DIR"] = os.path.join(dirs["COMPARISON_DIR"],
"stats")
config["STRUCTURE"] = dirs
os.mkdir(args["dir"])
os.mkdir(os.path.join(args["dir"], dirs["INSTANCE_DIR"]))
os.mkdir(os.path.join(args["dir"], dirs["MINISAT_RESULT_DIR"]))
os.mkdir(os.path.join(args["dir"], dirs["WMIS_RESULT_DIR"]))
os.mkdir(os.path.join(args["dir"], dirs["COMPARISON_DIR"]))
os.mkdir(os.path.join(args["dir"], dirs["COMPARISON_STATS_DIR"]))
with open(os.path.join(args["dir"], "dataset.config"), "w") as configfile:
config.write(configfile)
configfile.close()
def __parseArguments():
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--directory", help="the direcotry for the new dataset", type=str)
args = parser.parse_args()
arguments = {}
print(args)
arguments["dir"] = args.directory
if arguments["dir"] == None:
arguments["dir"] = str(input("Directory: "))
arguments["dir"] = os.path.abspath(arguments["dir"])
return arguments
if __name__ == "__main__":
main()