2020-09-07 19:31:59 +03:00
|
|
|
"""Main module."""
|
2018-01-22 00:55:32 +03:00
|
|
|
|
|
|
|
import sys
|
|
|
|
|
2020-09-07 19:31:59 +03:00
|
|
|
from .containers import UseCases, Adapters, TestAdapters
|
2018-01-22 00:55:32 +03:00
|
|
|
|
|
|
|
|
2020-09-07 19:31:59 +03:00
|
|
|
def main(environment: str, email: str) -> None:
|
2021-10-01 02:01:31 +03:00
|
|
|
if environment == "prod":
|
2018-01-22 00:55:32 +03:00
|
|
|
adapters = Adapters()
|
2021-10-01 02:01:31 +03:00
|
|
|
elif environment == "test":
|
2018-01-22 00:55:32 +03:00
|
|
|
adapters = TestAdapters()
|
2020-09-07 19:31:59 +03:00
|
|
|
else:
|
2021-10-01 02:01:31 +03:00
|
|
|
raise RuntimeError("Unknown environment")
|
2018-01-22 00:55:32 +03:00
|
|
|
|
|
|
|
use_cases = UseCases(adapters=adapters)
|
|
|
|
|
|
|
|
use_case = use_cases.signup()
|
|
|
|
use_case.execute(email)
|
2020-09-07 19:31:59 +03:00
|
|
|
|
|
|
|
|
2021-10-01 02:01:31 +03:00
|
|
|
if __name__ == "__main__":
|
2020-09-07 19:31:59 +03:00
|
|
|
main(*sys.argv[1:])
|