Reformat project

This commit is contained in:
2022-07-21 13:39:59 +01:00
parent 4669096fcb
commit da678617d8
57 changed files with 523 additions and 218 deletions

View File

@@ -1,10 +1,9 @@
from os import listdir
import commands
from main import CommandMap
from utils.logging.debug import debug
from utils.logging.log import *
import commands
from main import CommandMap
def loadCommands(allowDup=False):
@@ -15,11 +14,15 @@ def loadCommands(allowDup=False):
try:
module = __import__("commands.%s" % commandName)
if not commandName 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))