mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-29 13:04:02 +03:00
Update run script for services example
This commit is contained in:
parent
dde52a5d0f
commit
c93b6fcfdf
16
README.rst
16
README.rst
|
@ -147,17 +147,11 @@ several IoC containers for some example application:
|
||||||
auth_service=Services.auth,
|
auth_service=Services.auth,
|
||||||
photos_service=Services.photos)
|
photos_service=Services.photos)
|
||||||
|
|
||||||
Next example demonstrates run of dependency injection example application
|
Next example demonstrates run of example application defined above:
|
||||||
defined above:
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
"""Run dependency injection example application.
|
"""Run example application."""
|
||||||
|
|
||||||
Instructions for running:
|
|
||||||
|
|
||||||
python run.py 1 secret photo.jpg
|
|
||||||
"""
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
@ -192,12 +186,6 @@ defined above:
|
||||||
# photos_service=example.services.Photos(logger=logger,
|
# photos_service=example.services.Photos(logger=logger,
|
||||||
# db=database,
|
# db=database,
|
||||||
# s3=s3))
|
# s3=s3))
|
||||||
#
|
|
||||||
# Output:
|
|
||||||
#
|
|
||||||
# User 1 has been found in database
|
|
||||||
# User 1 has been successfully authenticated
|
|
||||||
# Photo photo.jpg has been successfully uploaded by user 1
|
|
||||||
|
|
||||||
Alternative definition styles of providers
|
Alternative definition styles of providers
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
"""Run dependency injection example application.
|
"""Run example application."""
|
||||||
|
|
||||||
Instructions for running:
|
|
||||||
|
|
||||||
python run.py 1 secret photo.jpg
|
|
||||||
"""
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
@ -38,9 +33,3 @@ if __name__ == '__main__':
|
||||||
# photos_service=example.services.Photos(logger=logger,
|
# photos_service=example.services.Photos(logger=logger,
|
||||||
# db=database,
|
# db=database,
|
||||||
# s3=s3))
|
# s3=s3))
|
||||||
#
|
|
||||||
# Output:
|
|
||||||
#
|
|
||||||
# User 1 has been found in database
|
|
||||||
# User 1 has been successfully authenticated
|
|
||||||
# Photo photo.jpg has been successfully uploaded by user 1
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user