2018-02-23 22:05:40 +00:00
|
|
|
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)
|
2018-03-04 17:25:57 +00:00
|
|
|
success("Saved %s to %s" % (i, filemap[i][0]))
|
2018-02-23 22:05:40 +00:00
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("save")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("save")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|