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:
|
2018-01-22 00:55:32 +03:00
|
|
|
if environment == 'prod':
|
|
|
|
adapters = Adapters()
|
|
|
|
elif environment == 'test':
|
|
|
|
adapters = TestAdapters()
|
2020-09-07 19:31:59 +03:00
|
|
|
else:
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main(*sys.argv[1:])
|