Skip to content
This repository was archived by the owner on Aug 10, 2024. It is now read-only.

Commit 6c2cb43

Browse files
committed
Formatting cleanup in render-config.py
1 parent 4a49d56 commit 6c2cb43

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

render-config.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,26 @@ def parse_config(markdown_contents):
1919

2020
config[section] = lines
2121

22-
flat_keys = [key for key in config.keys() if key != 'searchTerms']
22+
flat_keys = [key for key in config.keys() if key != "searchTerms"]
2323
for key in flat_keys:
2424
config[key] = " ".join(config[key])
25-
if 'searchTerms' in config:
26-
config['searchTerms'] = [
27-
re.compile(r"^- ").sub("", term)
28-
for term
29-
in config['searchTerms']
25+
if "searchTerms" in config:
26+
config["searchTerms"] = [
27+
re.compile(r"^- ").sub("", term) for term in config["searchTerms"]
3028
]
31-
if 'avatar' in config:
32-
matches = re.compile("^.*\((.+)\)$").match(config['avatar'])
29+
if "avatar" in config:
30+
matches = re.compile("^.*\((.+)\)$").match(config["avatar"])
3331
if matches:
34-
config['avatar'] = matches.group(1)
35-
if 'recordName' in config:
36-
record_name = config['recordName']
37-
record_name = record_name.replace(' ', '').lower()
32+
config["avatar"] = matches.group(1)
33+
if "recordName" in config:
34+
record_name = config["recordName"]
35+
record_name = record_name.replace(" ", "").lower()
3836
record_name = record_name[0:15]
39-
config['recordName'] = record_name
40-
if 'displayName' in config:
41-
display_name = config['displayName']
37+
config["recordName"] = record_name
38+
if "displayName" in config:
39+
display_name = config["displayName"]
4240
display_name = display_name[0:24]
43-
config['displayName'] = display_name
41+
config["displayName"] = display_name
4442

4543
return config
4644

@@ -57,12 +55,14 @@ def replace_json_config(worker_js_path, config):
5755
if len(sections) != 2:
5856
raise Exception("Expected to find sentinel in worker.js")
5957

60-
new_contents = "".join([
61-
sections[0],
62-
WORKER_SENTINEL,
63-
"const CONFIG = " + json.dumps(config, indent=2),
64-
"\n",
65-
])
58+
new_contents = "".join(
59+
[
60+
sections[0],
61+
WORKER_SENTINEL,
62+
"const CONFIG = " + json.dumps(config, indent=2),
63+
"\n",
64+
]
65+
)
6666

6767
with open(worker_js_path, "w") as f:
6868
f.write(new_contents)

0 commit comments

Comments
 (0)