Implement counting keyword events and a unified buffers system for when the master channel is unavailable

This commit is contained in:
2018-03-04 17:25:57 +00:00
parent eae4315562
commit da6c45f093
16 changed files with 60 additions and 19 deletions

View File

@@ -97,6 +97,13 @@ class Key:
if not obj.addr in MonitorPool:
MonitorPool.append(obj.addr)
success("Keyword monitoring enabled")
if len(masterbuf) == 0:
return
rtrn = []
for i in range(len(masterbuf)):
rtrn.append(masterbuf.pop(0))
saveConf("masterbuf")
info("\n".join(rtrn))
return
else:
failure("Keyword monitoring is already enabled")
@@ -129,7 +136,7 @@ class Key:
info("\n".join(exceptMap))
return
elif spl[1] == "master":
info(" - ".join(config["Master"]))
info(" - ".join([str(i) for i in config["Master"]]))
return
elif spl[1] == "monitor":
if obj.addr in MonitorPool:

View File

@@ -14,7 +14,7 @@ class Save:
elif spl[1] == "all":
for i in filemap.keys():
saveConf(i)
success("Saved %s from %s" % (i, filemap[i][0]))
success("Saved %s to %s" % (i, filemap[i][0]))
return
else:
incUsage("save")