pyioc:pyioc-是Python中的单个文件IoC(或ServiceLocator)

时间:2021-05-06 14:49:39
【文件属性】:
文件名称:pyioc:pyioc-是Python中的单个文件IoC(或ServiceLocator)
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-06 14:49:39
Python 皮约克 pyioc是的单个文件IoC(或ServiceLocator),用于在脚本中的任何位置解析(定位)服务。 特征 单例和实例容器 自动解决__init__函数的参数依赖性 使用“键”和/或“类型”来解析服务 安装 $ git clone https://github.com/noodleflake/pyioc 样品用量 在pyioc资料库中,请参阅sample目录 from libs . service_locator import ServiceLocator #Either Register Singleton (Entire lifetime of application) postgres_connection = PostgresConnection ( 'ConnectionStringHere' ) smtp = Smtp ( postgres_connectio
【文件预览】:
pyioc-master
----sample()
--------services()
--------bootstrapper.py(2KB)
--------libs()
--------main.py(273B)
--------tests.py(3KB)
----README.md(2KB)
----lib()
--------service_locator.py(4KB)

网友评论