Skip to content

Instantly share code, notes, and snippets.

@maliciousgroup

maliciousgroup/BaseCommand.py Secret

Created Apr 7, 2021
Embed
What would you like to do?
Base Command
from src.core.base.abstract.AbstractCommand import AbstractCommand
from src.core.registry.CommandRegistry import CommandRegistry
class BaseCommand(AbstractCommand):
def __init_subclass__(cls, **kwargs) -> None:
try:
assert isinstance(cls, type(BaseCommand))
CommandRegistry(cls)
super().__init_subclass__(**kwargs)
except AssertionError:
pass
async def execute(self) -> None:
"""
Base Coroutine that executes the Command logic
:return: None
"""
async def main(self) -> None:
"""
Base Coroutine that starts the Command chain
:return: None
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment