Update file util.py
Browse files
util.py
CHANGED
|
@@ -2,10 +2,13 @@ import json
|
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
-
|
| 6 |
class Config:
|
| 7 |
def __init__(self, data):
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
class ConfigParser:
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
|
|
|
|
| 5 |
class Config:
|
| 6 |
def __init__(self, data):
|
| 7 |
+
for key, value in data.items():
|
| 8 |
+
if isinstance(value, dict):
|
| 9 |
+
setattr(self, key, Config(value))
|
| 10 |
+
else:
|
| 11 |
+
setattr(self, key, value)
|
| 12 |
|
| 13 |
|
| 14 |
class ConfigParser:
|