|
3 | 3 | Usage: |
4 | 4 | update-presets.py [options] |
5 | 5 | update-presets.py add <preset> |
6 | | - update-presets.py list-non-default [--rust | --compact] <preset> |
| 6 | + update-presets.py list-non-default [--rust-password | --rust-no-password | --compact] <preset> |
7 | 7 | update-presets.py diff <left> <right> |
8 | 8 | update-presets.py (-h | --help) |
9 | 9 |
|
10 | 10 | Options: |
11 | | - -h, --help show this help message and exit |
12 | | - --compact print settings on a single line |
13 | | - --defaults fill in missing settings with their default values |
14 | | - --from=<rev> update presets to match the given git commit |
15 | | - --hook run noninteractively for git pre-commit hook purposes |
16 | | - --preset=<preset> only update the named preset |
17 | | - --rust list non-default settings in Rust syntax appropriate for the midos.house codebase |
| 11 | + -h, --help show this help message and exit |
| 12 | + --compact print settings on a single line |
| 13 | + --defaults fill in missing settings with their default values |
| 14 | + --from=<rev> update presets to match the given git commit |
| 15 | + --hook run noninteractively for git pre-commit hook purposes |
| 16 | + --preset=<preset> only update the named preset |
| 17 | + --rust-no-password list non-default settings in Rust syntax appropriate for the midos.house codebase (disable password lock) |
| 18 | + --rust-password list non-default settings in Rust syntax appropriate for the midos.house codebase (enable password lock) |
18 | 19 | """ |
19 | 20 |
|
20 | 21 | import sys |
@@ -130,8 +131,12 @@ def print_rust_json_setting(name, value, indent): |
130 | 131 | preset = get_preset(presets, arguments['<preset>']) |
131 | 132 | if preset is None: |
132 | 133 | preset = json.loads(subprocess.run([sys.executable, 'OoTRandomizer.py', '--convert_settings', '--settings_string', arguments['<preset>']], stdout=subprocess.PIPE, encoding='utf-8', check=True).stdout) |
| 134 | + if arguments['--rust-password']: |
| 135 | + preset['password_lock'] = True |
| 136 | + if arguments['--rust-no-password']: |
| 137 | + preset['password_lock'] = False |
133 | 138 | non_default = {name: value for name, value in preset.items() if value != SETTINGS_DICT[name].default} |
134 | | - if arguments['--rust']: |
| 139 | + if arguments['--rust-password'] or arguments['--rust-no-password']: |
135 | 140 | print(' collect![') |
136 | 141 | for name, value in non_default.items(): |
137 | 142 | if name == 'aliases': |
|
0 commit comments