Created
January 26, 2020 04:06
-
-
Save geoffkoh/1d84a653c8884061bd6dfbb575a244ee to your computer and use it in GitHub Desktop.
Factory pattern using decorators
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
class ExecutorBase(metaclass=ABCMeta): | |
""" Base class for an executor """ | |
def __init__(self, **kwargs): | |
""" Constructor """ | |
pass | |
@abstractmethod | |
def run(self, command: str) -> (str, str): | |
""" Abstract method to run a command """ | |
pass | |
# end class ExecutorBase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment