summaryrefslogtreecommitdiff
path: root/src/dactyl_manuform.py
diff options
context:
space:
mode:
authorJoshua Shreve <j.a.shreve@gmail.com>2021-08-21 20:31:07 -0400
committerJoshua Shreve <j.a.shreve@gmail.com>2021-08-21 20:31:07 -0400
commit9e2c0c3b72eb0bb27210bf19d76e7e4b6f5ce295 (patch)
tree7a6ef8f77f99ecf3b7cfb4cb370c163d81e888e0 /src/dactyl_manuform.py
parent4c179f900053db8acb072cf6eb6e73b40293fea7 (diff)
Added config update to add new parameters to config. Retained ability to run the run_config.json file if there are no CLI arguments.
Retained ability to run the run_config.json file if there are no CLI arguments. Will eventually deprecate run_config in favor of the configs directory, but don't want to mess up existing configs until they have time to migrate. Un-ignored configs. Would like to build a set of user configs through PRs to see variety. Add gallery directory for those with submit configs for people to see examples. All PRs for configs are expected to have identically named files (with some suffix for multiple) to show example images.
Diffstat (limited to 'src/dactyl_manuform.py')
-rw-r--r--src/dactyl_manuform.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py
index 1dc1507..8156ca6 100644
--- a/src/dactyl_manuform.py
+++ b/src/dactyl_manuform.py
@@ -24,14 +24,20 @@ import generate_configuration as cfg
for item in cfg.shape_config:
locals()[item] = cfg.shape_config[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]
+if len(sys.argv) <= 1:
+ with open(os.path.join(r".", 'run_config.json'), mode='r') as fid:
+ data = json.load(fid)
+
+else:
+ ## 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.
@@ -152,15 +158,6 @@ teensy_holder_width = 7 + teensy_pcb_thickness
teensy_holder_height = 6 + teensy_width
-
-# wire_post_height = 7
-# wire_post_overhang = 3.5
-# wire_post_diameter = 2.6
-#
-# screw_insert_height = 3.8
-# screw_insert_bottom_radius = 5.31 / 2
-# screw_insert_top_radius = 5.1 / 2
-
# save_path = path.join("..", "things", save_dir)
if not path.isdir(save_path):
os.mkdir(save_path)
@@ -2605,7 +2602,7 @@ def thumb_walls(side='right', style_override=None):
elif "TRACKBALL" in _thumb_style:
if (side == ball_side or ball_side == 'both'):
- if _thumb_style == "TRACKBALL_ORBYL" :
+ if _thumb_style == "TRACKBALL_ORBYL":
return tbjs_thumb_walls()
elif thumb_style == "TRACKBALL_CJ":
return tbcj_thumb_walls()