changeset 26:248bf8d1e2e7

make operations command-line configurable. parameters: infile outfile ops
author casties
date Thu, 24 Sep 2015 18:58:30 +0200
parents 5bdcb5805d29
children 3fce3fa9097e
files importFromOpenMind/importer/model2model.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)