Skip to content

Instantly share code, notes, and snippets.

@maliciousgroup
Created April 7, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maliciousgroup/0cc92961fd060b42a138561bd82c86aa to your computer and use it in GitHub Desktop.
Save maliciousgroup/0cc92961fd060b42a138561bd82c86aa to your computer and use it in GitHub Desktop.
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