更新设置
This commit is contained in:
parent
0fc33fccff
commit
204d8342bb
24
Common.py
24
Common.py
@ -36,11 +36,6 @@ config = {
|
|||||||
# 下播延迟投稿
|
# 下播延迟投稿
|
||||||
"dly": 30
|
"dly": 30
|
||||||
}
|
}
|
||||||
|
|
||||||
_config_fp = open("config.json", "r", encoding="utf8")
|
|
||||||
_config = json.load(_config_fp)
|
|
||||||
_config_fp.close()
|
|
||||||
del _config_fp
|
|
||||||
doCleanTime = datetime.now()
|
doCleanTime = datetime.now()
|
||||||
_clean_flag = None
|
_clean_flag = None
|
||||||
delay = 30
|
delay = 30
|
||||||
@ -65,6 +60,15 @@ network = [{
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
def reloadConfig():
|
||||||
|
global config
|
||||||
|
if(os.path.exists(config.json)):
|
||||||
|
_config_fp = open("config.json", "r", encoding="utf8")
|
||||||
|
_config = json.load(_config_fp)
|
||||||
|
config.update(_config)
|
||||||
|
_config_fp.close()
|
||||||
|
|
||||||
|
|
||||||
def resetDelay():
|
def resetDelay():
|
||||||
global delay
|
global delay
|
||||||
delay = config['dly']
|
delay = config['dly']
|
||||||
@ -147,16 +151,8 @@ def getCurrentStatus():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def reloadConfig():
|
|
||||||
global config
|
|
||||||
_config_fp = open("config.json", "r", encoding="utf8")
|
|
||||||
_config = json.load(_config_fp)
|
|
||||||
config.update(_config)
|
|
||||||
_config_fp.close()
|
|
||||||
|
|
||||||
|
|
||||||
dt_format = "%Y/%m/%d %H:%M:%S"
|
dt_format = "%Y/%m/%d %H:%M:%S"
|
||||||
|
reloadConfig()
|
||||||
broadcaster = ""
|
broadcaster = ""
|
||||||
streamUrl = ""
|
streamUrl = ""
|
||||||
isBroadcasting = False
|
isBroadcasting = False
|
||||||
|
Reference in New Issue
Block a user