mirror of
https://github.com/RGBCube/JsonWrapper
synced 2025-07-27 11:47:45 +00:00
code simplification
This commit is contained in:
parent
6e7295262e
commit
961aa9ff57
1 changed files with 1 additions and 4 deletions
5
db.py
5
db.py
|
@ -24,10 +24,7 @@ class ClutterDB:
|
|||
def get(self, key: str, *, default=None):
|
||||
with open(self.path_to_json, mode="r") as json_file:
|
||||
json_data = json.load(json_file)
|
||||
if key in json_data:
|
||||
return json_data[key]
|
||||
else:
|
||||
return default
|
||||
return json_data.get(key, default)
|
||||
|
||||
def all(self):
|
||||
with open(self.path_to_json, mode="r") as json_file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue