TEMP: WIP: add repo_config
TEMP cause it spams a bunch of prints in dataclass handling
This commit is contained in:
parent
72f4d4948e
commit
ff1c31e157
10 changed files with 493 additions and 130 deletions
|
@ -20,10 +20,12 @@ class JsonFile(DataClass):
|
|||
|
||||
_filename: ClassVar[str]
|
||||
_relative_path: str
|
||||
_strip_hidden: ClassVar[bool] = True
|
||||
_sparse: ClassVar[bool] = False
|
||||
|
||||
def toJSON(self) -> str:
|
||||
'Returns a json representation, with private keys that start with "_" filtered out'
|
||||
return json.dumps({key: val for key, val in self.toDict().items() if not key.startswith('_')}, indent=2)
|
||||
return json.dumps(self.toDict(), indent=2)
|
||||
|
||||
def write(self):
|
||||
'Write the filtered json representation to disk'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue