-
-
Save maliciousgroup/0cc92961fd060b42a138561bd82c86aa to your computer and use it in GitHub Desktop.
Base Command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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