2018-02-23 23:26:21 +00:00
|
|
|
from utils.loaders.single_loader import loadSingle
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2019-08-09 22:06:34 +00:00
|
|
|
class LoadmodCommand:
|
2019-01-26 18:58:21 +00:00
|
|
|
def __init__(self, *args):
|
|
|
|
self.loadmod(*args)
|
2018-02-23 23:26:21 +00:00
|
|
|
|
2022-09-05 06:20:30 +00:00
|
|
|
def loadmod(
|
|
|
|
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
|
|
|
|
):
|
2018-02-23 23:26:21 +00:00
|
|
|
if authed:
|
|
|
|
if length == 2:
|
2019-01-26 18:58:21 +00:00
|
|
|
rtrn = loadSingle(spl[1])
|
2022-07-21 12:40:05 +00:00
|
|
|
if rtrn is True:
|
2019-01-26 18:58:21 +00:00
|
|
|
success("Loaded module: %s" % spl[1])
|
|
|
|
return
|
|
|
|
elif rtrn == "RELOAD":
|
|
|
|
success("Reloaded module: %s" % spl[1])
|
2018-02-23 23:26:21 +00:00
|
|
|
return
|
|
|
|
else:
|
|
|
|
failure("Error loading module %s: %s" % (spl[1], rtrn))
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("loadmod")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|
|
|
|
return
|