Added saveContent method
This commit is contained in:
parent
5b5a22c03b
commit
c849dd2bf6
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue