1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Changed writing method to file

This commit is contained in:
Phxntxm 2016-07-17 11:33:28 -05:00
parent 37b6c58713
commit 4d69756b2f

View file

@ -42,7 +42,7 @@ def closeConnection():
connection.close()
def saveContent(key: str, content):
with open("/home/phxntx5/public_html/Bonfire/config.json", "r+") as jf:
with open("/home/phxntx5/public_html/Bonfire/config.json", "rw") as jf:
data = json.load(jf)
data[key] = content
jf.seek(0)
@ -51,7 +51,7 @@ def saveContent(key: str, content):
def getContent(key: str):
try:
with open("/home/phxntx5/public_html/Bonfire/config.json", "r+") as jf:
with open("/home/phxntx5/public_html/Bonfire/config.json", "rw") as jf:
data = json.load(jf)
jf.close()
return data[key]