def __new__(cls, name, bases, attrs): super_new = super(RegisterEngine, cls).__new__ new_class = super_new(cls, name, bases, attrs) if(name != "BaseEngine"): EngineRegistrar.registerPackage(new_class, new_class.__name__, new_class.categories) methodList = [method for method in dir(new_class) if callable(getattr(new_class, method))] registeredMethods = [method for method in methodList if hasattr(getattr(new_class, method), "registerThis")] for method in registeredMethods: CommandRegistrar.registerCommand(new_class.__name__, getattr(new_class, method), getattr(new_class, method).__name__) return new_class
def registerEngine(cls): EngineRegistrar.registerPackage(cls, cls.__name__, cls.categories)