Reformat legacy project

This commit is contained in:
2022-09-05 07:20:30 +01:00
parent 6b082adeb2
commit 8b9ad05089
59 changed files with 538 additions and 198 deletions

View File

@@ -13,11 +13,15 @@ def loadCommands(allowDup=False):
# try:
module = __import__("commands.%s" % commandName)
if commandName not in CommandMap:
CommandMap[commandName] = getattr(getattr(module, commandName), className)
CommandMap[commandName] = getattr(
getattr(module, commandName), className
)
debug("Registered command: %s" % commandName)
else:
if allowDup:
CommandMap[commandName] = getattr(getattr(module, commandName), className)
CommandMap[commandName] = getattr(
getattr(module, commandName), className
)
debug("Registered command: %s" % commandName)
error("Duplicate command: %s" % (commandName))

View File

@@ -12,7 +12,9 @@ def loadSingle(commandName):
try:
if commandName in CommandMap.keys():
reload(sys.modules["commands." + commandName])
CommandMap[commandName] = getattr(sys.modules["commands." + commandName], className)
CommandMap[commandName] = getattr(
sys.modules["commands." + commandName], className
)
debug("Reloaded command: %s" % commandName)
return "RELOAD"
module = __import__("commands.%s" % commandName)