2018-02-23 23:26:21 +00:00
|
|
|
from os import listdir
|
2018-03-14 20:13:40 +00:00
|
|
|
import main
|
2018-02-23 23:26:21 +00:00
|
|
|
from utils.logging.log import *
|
|
|
|
import commands
|
|
|
|
|
|
|
|
def loadSingle(command, func):
|
|
|
|
if command+".py" in listdir("commands"):
|
|
|
|
try:
|
2018-03-14 20:13:40 +00:00
|
|
|
if command in main.CommandMap.keys():
|
2018-02-23 23:26:21 +00:00
|
|
|
return "Cannot reload modules"
|
|
|
|
else:
|
|
|
|
className = command.capitalize()
|
|
|
|
__import__("commands.%s" % command)
|
|
|
|
eval("commands.%s.%s(func)" % (command, className))
|
|
|
|
return True
|
|
|
|
except Exception as err:
|
|
|
|
return err
|