mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 10:34:01 +03:00
24 lines
486 B
Python
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:])
|