REFACTOR: Split into modules (controller, models, and utils)
This commit is contained in:
12
utils/json_object.py
Normal file
12
utils/json_object.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import json
|
||||
|
||||
class JSONObject:
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
def read(self):
|
||||
with open(self.path, "r") as f:
|
||||
return json.load(f)
|
||||
|
||||
def get(self, key):
|
||||
return self.read()[key]
|
||||
Reference in New Issue
Block a user