python-dependency-injector/examples/miniapps/use-cases/example/__main__.py
2021-09-30 19:01:31 -04:00

24 lines
486 B
Python

"""Main module."""
import sys
from .containers import UseCases, Adapters, TestAdapters
def main(environment: str, email: str) -> None:
if environment == "prod":
adapters = Adapters()
elif environment == "test":
adapters = TestAdapters()
else:
raise RuntimeError("Unknown environment")
use_cases = UseCases(adapters=adapters)
use_case = use_cases.signup()
use_case.execute(email)
if __name__ == "__main__":
main(*sys.argv[1:])