-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconvert.py
More file actions
21 lines (17 loc) · 725 Bytes
/
convert.py
File metadata and controls
21 lines (17 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import json
with open('src/main/resources/assets/rug/lang/en_us.json5', 'r') as file:
raw = json.load(file)
rule_names = sorted(list(set([rule.removeprefix('carpet.rule.').split('.')[0] for rule in raw.keys()])))
print('rug:')
print(' rule:')
for rule in rule_names:
print(f' {rule}:')
print(' desc: ' + raw[f'carpet.rule.{rule}.desc'])
if f'carpet.rule.{rule}.extra.0' in raw:
print(' extra:')
i = 0
while f'carpet.rule.{rule}.extra.{i}' in raw:
print(f" '{i}': " + raw[f'carpet.rule.{rule}.extra.{i}'])
i += 1
if f'carpet.rule.{rule}.additional' in raw:
print(' additional: ' + raw[f'carpet.rule.{rule}.additional'])