Skip to content

Commit

Permalink
read settings major fix
Browse files Browse the repository at this point in the history
  • Loading branch information
karastoyanov committed Jul 25, 2023
1 parent e78d8f7 commit 1b1cee8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Binary file modified settings/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified settings/__pycache__/settings_handler.cpython-310.pyc
Binary file not shown.
File renamed without changes.
16 changes: 7 additions & 9 deletions settings/settings_handler.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from json import (load,
dump,
)
#!/usr/bin/python3

import json


def read_file(filename):
with open(filename, "r") as file:
return load(file)
return json.load(file)


# def save_file(filename):
Expand All @@ -17,14 +17,14 @@ def get_plane_settings():
"""
:return: dictionary with the plane settings
"""
return read_file("planes_settings.json")
pass


def get_game_settings():
def get_game_settings(file):
"""
:return: dictionary with the game settings
"""
return read_file("settings.json")
return read_file(file)


def overwrite_game_settings(**kwargs):
Expand All @@ -33,8 +33,6 @@ def overwrite_game_settings(**kwargs):





# def overwrite_settings(self, **kwargs):
# kwargs = {k.lower(): v for k, v in kwargs.items()}
#
Expand Down

0 comments on commit 1b1cee8

Please sign in to comment.