Skip to content
Snippets Groups Projects
Commit 681ddd12 authored by ave's avatar ave
Browse files

nick: Cleanup save code to make schema do more heavy lifting

parent 989bc859
No related branches found
No related tags found
1 merge request!199nick: Cleanup save code to make schema do more heavy lifting
Pipeline #7168 passed
...@@ -87,14 +87,9 @@ class Configuration: ...@@ -87,14 +87,9 @@ class Configuration:
def save(self, path: str) -> None: def save(self, path: str) -> None:
d = { d = {
"name": self.name, config_key: getattr(self, config_key) for config_key in CONFIG_SCHEMA.keys()
"size": self.size,
"font": self.font,
"pronouns": self.pronouns,
"pronouns_size": self.pronouns_size,
"color": self.color,
"mode": self.mode,
} }
jsondata = json.dumps(d) jsondata = json.dumps(d)
with open(path, "w") as f: with open(path, "w") as f:
f.write(jsondata) f.write(jsondata)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment