# HG changeset patch # User casties # Date 1443113910 -7200 # Node ID 248bf8d1e2e7ccb119d05afa34e620b828792fb5 # Parent 5bdcb5805d29c69bf234373eab9d780911e61f35 make operations command-line configurable. parameters: infile outfile ops diff -r 5bdcb5805d29 -r 248bf8d1e2e7 importFromOpenMind/importer/model2model.py --- a/importFromOpenMind/importer/model2model.py Thu Sep 24 18:17:41 2015 +0200 +++ b/importFromOpenMind/importer/model2model.py Thu Sep 24 18:58:30 2015 +0200 @@ -215,7 +215,9 @@ if len(sys.argv) > 2: input_fn = sys.argv[1] output_fn = sys.argv[2] - #ops = sys.argv[3] + +if len(sys.argv) > 3: + ops = sys.argv[3].split(',') # read networkx graph from pickle print("Reading graph from %s"%input_fn) @@ -235,6 +237,9 @@ elif op == 'add_links': addLinks(nx_graph) + + else: + print("ERROR: unknown operation %s"%op) print("Writing graph to %s"%output_fn) nx_graph = nx.write_gpickle(nx_graph, output_fn)