for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import abc
import argparse
from typing import Callable
from typing import List
from typing import Text
from typing import Type
from .lang import classproperty_readonly
from .utils import print_out
class BaseCommandExecutor(abc.ABC):
@abc.abstractmethod
def __init__(self, args: argparse.Namespace) -> None:
...
def __call__(self) -> None:
@staticmethod
def _print_input_args(**kwargs) -> None:
print_out(f"input args: {kwargs}")
class BaseCommand(abc.ABC):
@classproperty_readonly
def name(self) -> Text:
raise NotImplementedError
def aliases(self) -> List[Text]:
return []
def executor_class(self) -> Type[BaseCommandExecutor]:
@classmethod
def make_executor(cls, args=argparse.Namespace) -> BaseCommandExecutor:
return cls.executor_class(args)
def make_parser(cls, factory=argparse.ArgumentParser) -> argparse.ArgumentParser: