mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 02:24:02 +03:00
bf978601ba
* Refactor services mini app with single container * Make few little fixes to single container app * Update requirements.txt for single container example * Refactor multiple containers example * Add single container docs page * Create multiple containers page
25 lines
576 B
Python
25 lines
576 B
Python
"""Main module."""
|
|
|
|
import sys
|
|
|
|
from .containers import Application
|
|
|
|
|
|
def main(email: str, password: str, photo: str) -> None:
|
|
application = Application()
|
|
|
|
application.config.from_yaml('config.yml')
|
|
application.core.configure_logging()
|
|
|
|
user_service = application.services.user()
|
|
auth_service = application.services.auth()
|
|
photo_service = application.services.photo()
|
|
|
|
user = user_service.get_user(email)
|
|
auth_service.authenticate(user, password)
|
|
photo_service.upload_photo(user, photo)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main(*sys.argv[1:])
|