-
Notifications
You must be signed in to change notification settings - Fork 1
/
branding.py
48 lines (35 loc) · 1.02 KB
/
branding.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Provide branding (customizing text) to Shawl."""
import json
import pathlib
import dataclasses
@dataclasses.dataclass
class Brand:
"""Class passed to shawl to customize its apperance and or functionality."""
name: str
app_name: str
page_title: str
hostname_label: str
hostname_value: str
username_label: str
password_label: str
local_path_label: str
remote_path_label: str
upload_button_text: str
run_button_text: str
watch_queue_button_text: str
remote_shell_button_text: str
download_button_text: str
file_browser_button_text: str
manual_file: str
def load_brands():
"""Load brands from brand/*.json files."""
brand_files = pathlib.Path("brands").glob("*.json")
ret = dict()
for brand_file in brand_files:
with open(brand_file) as b_fd:
brand_json = json.load(b_fd)
brand = Brand(**brand_json)
ret[brand.name] = brand
return ret
if __name__ == "__main__":
print(load_brands().values())