处理异步事件的工具。
asyncdef.emitter的Python项目详细描述
处理异步事件的工具。
示例用法
这个项目是 EventEmitter 接口并严格遵循文档中描述的行为 events模块。
fromasyncdef.emitterimportEmitteremitter=Emitter()emitter.on('my_event',print)emitter.emit('my_event',True,False,None)
测试
所有测试套件都与它们测试和运行的模块一一配对 直接与同一模块相邻。所有的测试都有望通过 Python3.5及以上版本。要运行测试,请使用包含tox.ini文件的tox或 创建一个virtualenv并安装“[测试]”附加程序。
许可证
Copyright 2016 Kevin Conway
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 无任何明示或默示的保证或条件。 有关管理权限的特定语言和 许可下的限制。
贡献
首先,如果你正在修补,那么谢谢你!以下是一些建议 合并修补程序:
风格
只要代码通过pep8和pyflakes门,那么样式就是 可以接受。
文件
pep257门将检查所有公共方法是否都有docstring。如果你是 添加一些新的东西,比如helper函数,试试 napoleon style of docstrings。
测试
确保修补程序通过所有测试。如果要添加新功能,请不要 忘了投一两个测试。如果你正在修复一个bug,那么一定要添加 至少进行一次测试以防止回归。