Code style

This commit is contained in:
kramo
2023-03-15 01:57:43 +01:00
parent e4002fb786
commit bd0cf7402a
15 changed files with 123 additions and 109 deletions

View File

@@ -27,10 +27,10 @@ def toggle_hidden(game):
if not os.path.exists(games_dir):
return
file = open(os.path.join(games_dir, game + ".json"), "r")
data = json.loads(file.read())
file.close()
file = open(os.path.join(games_dir, game + ".json"), "w")
data["hidden"] = not data["hidden"]
file.write(json.dumps(data, indent=4))
file.close()
with open(os.path.join(games_dir, game + ".json"), "r") as open_file:
data = json.loads(open_file.read())
open_file.close()
with open(os.path.join(games_dir, game + ".json"), "w") as open_file:
data["hidden"] = not data["hidden"]
open_file.write(json.dumps(data, indent=4))
open_file.close()