aboutsummaryrefslogtreecommitdiffstats
path: root/src/dactyl_manuform.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/dactyl_manuform.py')
-rw-r--r--src/dactyl_manuform.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py
index 0fd4be6..1dc1507 100644
--- a/src/dactyl_manuform.py
+++ b/src/dactyl_manuform.py
@@ -1,6 +1,7 @@
import numpy as np
from numpy import pi
import os.path as path
+import getopt, sys
import json
import os
@@ -23,11 +24,15 @@ import generate_configuration as cfg
for item in cfg.shape_config:
locals()[item] = cfg.shape_config[item]
-## LOAD RUN CONFIGURATION FILE AND WRITE TO ANY VARIABLES IN FILE.
-with open('run_config.json', mode='r') as fid:
- data = json.load(fid)
-for item in data:
- locals()[item] = data[item]
+## CHECK FOR CONFIG FILE AND WRITE TO ANY VARIABLES IN FILE.
+opts, args = getopt.getopt(sys.argv[1:], "", ["config="]);
+for opt, arg in opts:
+ if opt in ('--config'):
+ with open(os.path.join(r"..", "configs", arg + '.json'), mode='r') as fid:
+ data = json.load(fid)
+ for item in data:
+ locals()[item] = data[item]
+
# Really rough setup. Check for ENGINE, set it not present from configuration.
try: