Skip to content

Commit 737b364

Browse files
authored
102 refactor use database for storing data (#113)
* Implemented sqlite database for userdata * Use 'with' to read file data
1 parent 2f1c300 commit 737b364

6 files changed

Lines changed: 657 additions & 136 deletions

File tree

datahandler/configHandle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def __new__(cls):
1818
cls._instance = super(ConfigHandle, cls).__new__(cls)
1919
cls.datapath = str(os.path.dirname(os.path.dirname(__file__))) + "/data/"
2020
# Reads in config.json
21-
cls.config = json.load(open(cls.datapath + "config.json"))
21+
with open(cls.datapath + "config.json", "r") as f:
22+
cls.config = json.load(f)
2223
return cls._instance
2324

2425
"""

0 commit comments

Comments
 (0)