Skip to content

Commit 27f491b

Browse files
committed
generate_config.py once again defaulting to original behavior.
1 parent ac79be4 commit 27f491b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/generate_configuration.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# THUMB PARAMETERS
4949
##############################
5050
# 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ'
51-
'thumb_style': 'TRACKBALL_CJ',
51+
'thumb_style': 'TRACKBALL_ORBYL',
5252
'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U
5353
# Thumb key size. May need slight oversizing, check w/ caps. Additional spacing will be automatically added for larger keys.
5454
'minidox_Usize': 1.6,
@@ -388,21 +388,29 @@
388388
def save_config():
389389
# Check to see if the user has specified an alternate config
390390
opts, args = getopt.getopt(sys.argv[1:], "", ["config=", "update="])
391+
got_opts = False
391392
for opt, arg in opts:
392393
if opt in ('--update'):
393394
with open(os.path.join(r"..", "configs", arg + '.json'), mode='r') as fid:
394395
data = json.load(fid)
395396
shape_config.update(data)
397+
got_opts = True
396398

397399
for opt, arg in opts:
398400
if opt in ('--config'):
399401
# If a config file was specified, set the config_name and save_dir
400402
shape_config['save_dir'] = arg
401403
shape_config['config_name'] = arg
404+
got_opts = True
402405

403406
# Write the config to ./configs/<config_name>.json
404-
with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid:
405-
json.dump(shape_config, fid, indent=4)
407+
if got_opts:
408+
with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid:
409+
json.dump(shape_config, fid, indent=4)
410+
411+
else:
412+
with open(os.path.join(r".", 'run_config.json'), mode='w') as fid:
413+
json.dump(shape_config, fid, indent=4)
406414

407415

408416
if __name__ == '__main__':

src/run_config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"config_name": "DM",
55
"show_caps": true,
66
"show_pcbs": false,
7-
"nrows": 4,
8-
"ncols": 5,
7+
"nrows": 5,
8+
"ncols": 6,
99
"alpha": 0.26179916666666664,
1010
"beta": 0.08726638888888888,
1111
"centercol": 3,
@@ -20,7 +20,7 @@
2020
7
2121
],
2222
"keyboard_z_offset": 11,
23-
"thumb_style": "TRACKBALL_CJ",
23+
"thumb_style": "TRACKBALL_ORBYL",
2424
"default_1U_cluster": true,
2525
"minidox_Usize": 1.6,
2626
"thumb_plate_tr_rotation": 0.0,

0 commit comments

Comments
 (0)