Revert "Reformat project"

This reverts commit 64e3e1160aa76d191740342ab3edc68807f890fb.
This commit is contained in:
2022-07-21 13:40:01 +01:00
parent da678617d8
commit 27cafa1def
57 changed files with 214 additions and 519 deletions

View File

@@ -1,9 +1,10 @@
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):
@@ -14,15 +15,11 @@ 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))

View File

@@ -1,11 +1,12 @@
import sys
from importlib import reload
from os import listdir
from importlib import reload
import sys
import commands
from main import CommandMap
from utils.logging.debug import debug
from utils.logging.log import *
import commands
from main import CommandMap
def loadSingle(commandName):
@@ -14,9 +15,7 @@ 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)