monolith/commands/save.py

27 lines
853 B
Python

from core.main import *
class Save:
def __init__(self, register):
register("save", self.save)
def save(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
if length == 2:
if spl[1] in filemap.keys():
saveConf(spl[1])
success("Saved %s to %s" % (spl[1], filemap[spl[1]][0]))
return
elif spl[1] == "all":
for i in filemap.keys():
saveConf(i)
success("Saved %s from %s" % (i, filemap[i][0]))
return
else:
incUsage("save")
return
else:
incUsage("save")
return
else:
incUsage(None)