for testing some lines

This commit is contained in:
Bela 2018-02-21 22:36:45 +01:00
parent a10b74253b
commit 9b07ca5b7b

View file

@ -82,3 +82,21 @@ def parse():
return args
if __name__ == "__main__":
try:
arguments = parse()
except argparse.ArgumentTypeError as e:
print("Error while parsing the command line arguments:\n",
e)
else:
print(arguments)
config = readformdata.listFields([], arguments["config"])
data = {f: readformdata.listFields([], f) for f in arguments["data"]}
# todo: find commands in config, sort them, do them
comms = itertools.chain(*[commands.Command.extractCommands(
field, config, data) for field in config])
# comms = commands.Command.extractCommands(config[0], config, data)
print(comms)
for command in comms:
command()
print(config[0])