Keepass outline
This commit is contained in:
parent
b18488a6d3
commit
162c0adf13
9 changed files with 115 additions and 3 deletions
0
app/util/__init__.py
Normal file
0
app/util/__init__.py
Normal file
11
app/util/dicts.py
Normal file
11
app/util/dicts.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from types import SimpleNamespace
|
||||
|
||||
|
||||
class NestedNamespace(SimpleNamespace):
|
||||
def __init__(self, dictionary, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
for key, value in dictionary.items():
|
||||
if isinstance(value, dict):
|
||||
self.__setattr__(key, NestedNamespace(value))
|
||||
else:
|
||||
self.__setattr__(key, value)
|
||||
Loading…
Add table
Add a link
Reference in a new issue