根据内容匹配Python参数并进行调度。
项目描述
匹配与调度
根据内容匹配Python参数并进行调度。
入门指南
创建调度器
from mnd.dispatch import Dispatcher, handle
d = Dispatcher()
使用便捷的装饰器
>>> @handler(d, msg="hello")
>>> def say(msg=None)
... print "got message: ", msg
尝试调度一些事件
```python
>>> d.dispatch(msg="gets filtered out..."))
>>> d.dispatch(msg="hello"))
got message: hello
安装
$ pip install mnd
根据内容匹配Python参数并进行调度。
入门指南
创建调度器
from mnd.dispatch import Dispatcher, handle
d = Dispatcher()
使用便捷的装饰器
>>> @handler(d, msg="hello")
>>> def say(msg=None)
... print "got message: ", msg
尝试调度一些事件
```python
>>> d.dispatch(msg="gets filtered out..."))
>>> d.dispatch(msg="hello"))
got message: hello
安装
$ pip install mnd
项目详情
关闭
mnd-0.2.1.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0b0372fcf1058bce569acf8008525c4a923990833b62f9ea9a77d9e86c1f7574 |
|
MD5 | e19a061d7286bce77960d48967007c98 |
|
BLAKE2b-256 | 5346e5db9d08ba87f00eab7d1f3f292c6c1cec59f9885fcc4889d490e38d9ade |