for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import abc
import argparse
import sys
if sys.version_info >= (3, 9):
List = list
Type = type
else:
from typing import List
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) -> str:
raise NotImplementedError
def aliases(self) -> List[str]:
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: