1
0
Fork 0
mirror of synced 2024-06-29 19:50:25 +12:00

Added saveContent method

This commit is contained in:
Phxntxm 2016-07-16 15:26:30 -05:00
parent 5b5a22c03b
commit c849dd2bf6

View file

@ -1,6 +1,7 @@
import yaml import yaml
import pymysql.cursors import pymysql.cursors
import asyncio import asyncio
import json
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
@ -39,3 +40,9 @@ def getCursor():
def closeConnection(): def closeConnection():
connection.commit() connection.commit()
connection.close() connection.close()
def saveContent(key: str, content):
with open("/home/phxntx5/public_html/Bonfire/config.json", "r+") as f:
jfile = json.load(f)
if key in content:
jfile[key]= content