aglyph是python的依赖注入框架。
Aglyph的Python项目详细描述
aglyph-python依赖注入
http://ninthtest.info/aglyph-python-dependency-injection/
简介
aglyph是python的依赖注入框架,它…
- 支持类型2(setter)和类型3(构造函数)依赖注入
- 可以组装prototype、singleton、borg和weakref组件
- 支持模板(即组件继承)和生命周期方法
- 使用您将遇到的任何类型的对象创建模式:
- 构造函数
- 工厂功能或方法
- 隐藏在属性或属性访问后面的对象创建
- 通过一个流畅的api或 使用简单的xml语法(请参见Aglyph DTD)
- 是非侵入性的:
- 只有一个依赖项(Autologging)超出了Python标准 库
不需要修改现有的源代码(即没有)。 装饰器、特定的命名约定或任何其他类型的 语法上的“魔力”是必要的)
安装
安装aglyph最简单的方法是使用pip:
$ pip install Aglyph
要验证安装是否成功:
>>>importaglyph>>>aglyph.__version__'3.0.0.post1'
安装后,查看Getting started with Aglyph和 Aglyph cookbook。
下面介绍了其他源和二进制安装选项。
源安装
克隆或分叉存储库:
$ git clone https://github.com/mzipay/Aglyph.git
或者,下载并提取源.zip或.tar.gz存档 从https://github.com/mzipay/Aglyph/releases, https://pypi.python.org/pypi/Aglyph/或 https://sourceforge.net/projects/aglyph/files/aglyph/
运行测试套件并安装aglyph
包:
$ cd Aglyph $ python setup.py test $ python setup.py install
二进制安装
下载python控制盘(.whl)或.exe/.msiwindows安装程序 来自https://pypi.python.org/pypi/Aglyph/或 https://sourceforge.net/projects/aglyph/files/aglyph/
使用pip或 wheel安装.whl,或 运行Windows安装程序。