mirror of
https://github.com/RGBCube/JsonWrapper
synced 2025-07-27 19:57:44 +00:00
Update db.py
This commit is contained in:
parent
78b1a750a6
commit
e8dc229458
1 changed files with 1 additions and 3 deletions
4
db.py
4
db.py
|
@ -26,10 +26,8 @@ class ClutterDB:
|
||||||
json_data = json.load(json_file)
|
json_data = json.load(json_file)
|
||||||
if key in json_data:
|
if key in json_data:
|
||||||
return json_data[key]
|
return json_data[key]
|
||||||
elif "default" in kwargs:
|
|
||||||
return kwargs["default"]
|
|
||||||
else:
|
else:
|
||||||
return None
|
return kwargs.get("default", None)
|
||||||
|
|
||||||
def all(self):
|
def all(self):
|
||||||
with open(self.path_to_json, mode="r") as json_file:
|
with open(self.path_to_json, mode="r") as json_file:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue