1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 19:57:44 +00:00

Update db.py

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

3
db.py
View file

@ -39,7 +39,8 @@ class ClutterDB:
with open(self.path_to_json, mode="r") as json_file: with open(self.path_to_json, mode="r") as json_file:
json_data = json.load(json_file) json_data = json.load(json_file)
with open(self.path_to_json, mode="w") as json_file: with open(self.path_to_json, mode="w") as json_file:
json.dump(json_data.pop(key, None), json_file, indent=4) json_data.pop(key, None)
json.dump(json_data, json_file, indent=4)
def nuke(self): def nuke(self):
with open(self.path_to_json, mode="w") as json_file: with open(self.path_to_json, mode="w") as json_file: