Update file util.py
Browse files
util.py
CHANGED
|
@@ -5,13 +5,13 @@ import json
|
|
| 5 |
class ConfigParser:
|
| 6 |
def __init__(self, path: str):
|
| 7 |
with open(path, 'r') as f:
|
| 8 |
-
|
| 9 |
|
| 10 |
-
config = json.loads(
|
| 11 |
|
| 12 |
self.path = path
|
| 13 |
self.config = config
|
| 14 |
-
self.
|
| 15 |
|
| 16 |
|
| 17 |
|
|
|
|
| 5 |
class ConfigParser:
|
| 6 |
def __init__(self, path: str):
|
| 7 |
with open(path, 'r') as f:
|
| 8 |
+
json_str = f.read()
|
| 9 |
|
| 10 |
+
config = json.loads(json_str, object_hook=lambda x: SimpleNamespace(**x))
|
| 11 |
|
| 12 |
self.path = path
|
| 13 |
self.config = config
|
| 14 |
+
self.json_str = json_str
|
| 15 |
|
| 16 |
|
| 17 |
|