2018-03-14 20:13:40 +00:00
|
|
|
import main
|
2018-02-23 23:26:21 +00:00
|
|
|
from utils.loaders.single_loader import loadSingle
|
|
|
|
|
|
|
|
class Loadmod:
|
|
|
|
def __init__(self, register):
|
|
|
|
register("loadmod", self.loadmod)
|
|
|
|
|
|
|
|
def loadmod(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
|
|
|
if authed:
|
|
|
|
if length == 2:
|
2018-03-14 20:13:40 +00:00
|
|
|
rtrn = loadSingle(spl[1], main.register)
|
2018-02-23 23:26:21 +00:00
|
|
|
if rtrn == True:
|
|
|
|
success("Loaded module %s" % spl[1])
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
failure("Error loading module %s: %s" % (spl[1], rtrn))
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("loadmod")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|
|
|
|
return
|