1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 11:47:45 +00:00

Update db.py

This commit is contained in:
RGBCube 2022-01-12 21:41:31 +03:00 committed by GitHub
parent 78b1a750a6
commit e8dc229458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
db.py
View file

@ -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: