20 lines
471 B
Python
20 lines
471 B
Python
# pip install dependency-injector
|
|
# https://python-dependency-injector.ets-labs.org/index.html
|
|
from dependency_injector.wiring import Provide, inject
|
|
|
|
from containers import Container
|
|
from services import BusinessLogic
|
|
|
|
|
|
@inject
|
|
def main(business: BusinessLogic = Provide(Container.business_logic)) -> None:
|
|
business.send("me")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
container = Container()
|
|
container.init_resources()
|
|
container.wire(modules=[__name__])
|
|
|
|
main()
|