Skip to content

Commit

Permalink
JSON save fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NodudeWasTaken committed Jul 1, 2024
1 parent 7e532d3 commit 9086150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dancer/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def __init__(self) -> None:
self.configfile = "config.json"
self.data = {}
if os.path.exists(self.configfile):
with open(self.configfile, "rb") as f:
with open(self.configfile, "r") as f:
self.data = json.load(f)
def save(self, name, val):
self.data[name] = val
with open(self.configfile, "wb") as f:
with open(self.configfile, "w") as f:
json.dump(self.data, f)
def get(self, name, default):
if name in self.data:
Expand Down

0 comments on commit 9086150

Please sign in to comment.