summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Shreve <j.a.shreve@gmail.com>2021-08-23 19:59:18 -0400
committerJoshua Shreve <j.a.shreve@gmail.com>2021-08-23 19:59:18 -0400
commit27f491bda62c18e314380ddc6456962a2417b84b (patch)
tree841ac38c106484c774eeda03b0dd3a71a0593dee
parentac79be4f7981d9c3efbfc47ffaaf589ff8db33e7 (diff)
generate_config.py once again defaulting to original behavior.
-rw-r--r--src/generate_configuration.py14
-rw-r--r--src/run_config.json6
2 files changed, 14 insertions, 6 deletions
diff --git a/src/generate_configuration.py b/src/generate_configuration.py
index 7b0ef84..f5fa716 100644
--- a/src/generate_configuration.py
+++ b/src/generate_configuration.py
@@ -48,7 +48,7 @@ shape_config = {
# THUMB PARAMETERS
##############################
# 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ'
- 'thumb_style': 'TRACKBALL_CJ',
+ 'thumb_style': 'TRACKBALL_ORBYL',
'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U
# Thumb key size. May need slight oversizing, check w/ caps. Additional spacing will be automatically added for larger keys.
'minidox_Usize': 1.6,
@@ -388,21 +388,29 @@ shape_config = {
def save_config():
# Check to see if the user has specified an alternate config
opts, args = getopt.getopt(sys.argv[1:], "", ["config=", "update="])
+ got_opts = False
for opt, arg in opts:
if opt in ('--update'):
with open(os.path.join(r"..", "configs", arg + '.json'), mode='r') as fid:
data = json.load(fid)
shape_config.update(data)
+ got_opts = True
for opt, arg in opts:
if opt in ('--config'):
# If a config file was specified, set the config_name and save_dir
shape_config['save_dir'] = arg
shape_config['config_name'] = arg
+ got_opts = True
# Write the config to ./configs/<config_name>.json
- with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid:
- json.dump(shape_config, fid, indent=4)
+ if got_opts:
+ with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid:
+ json.dump(shape_config, fid, indent=4)
+
+ else:
+ with open(os.path.join(r".", 'run_config.json'), mode='w') as fid:
+ json.dump(shape_config, fid, indent=4)
if __name__ == '__main__':
diff --git a/src/run_config.json b/src/run_config.json
index 2b68e88..48bde38 100644
--- a/src/run_config.json
+++ b/src/run_config.json
@@ -4,8 +4,8 @@
"config_name": "DM",
"show_caps": true,
"show_pcbs": false,
- "nrows": 4,
- "ncols": 5,
+ "nrows": 5,
+ "ncols": 6,
"alpha": 0.26179916666666664,
"beta": 0.08726638888888888,
"centercol": 3,
@@ -20,7 +20,7 @@
7
],
"keyboard_z_offset": 11,
- "thumb_style": "TRACKBALL_CJ",
+ "thumb_style": "TRACKBALL_ORBYL",
"default_1U_cluster": true,
"minidox_Usize": 1.6,
"thumb_plate_tr_rotation": 0.0,