通用灵活的python状态机库
pysm的Python项目详细描述
PYSM—Python状态机BR/> ------------BR/> BR/>通用灵活的Python状态机库。
BR/> BR/>图片:https://travis-ci.org/pgularski/pysm.svg?branch=master
:目标:https://travis ci.org/pgularski/pysm
…图片::https://coveralls.io/repos/github/pgularski/pysm/badge.svg?branch=master
:目标:https://coveralls.io/github/pgularski/pysm?分支=主
…图片::https://api.codacy.com/project/badge/grade/6f18f01639c242a0b83280a52245539d
:目标:https://www.codacy.com/app/pgularski/pysm?utm_source=github.com&;utm_medium=referration&;utm_content=pgularski/pysm&;utm_campaign=Badge_Grade
图片::https://landscape.io/github/pgularski/pysm/master/landscape.svg?style=flat
:目标:https://landscape.io/github/pgularski/pysm/master
:alt:code health
…图片::https://readthedocs.org/projects/pysm/badge/?version=latest
:目标:http://pysm.readthedocs.io/en/latest/?badge=latest
:alt:Documentation Status
实现简单和复杂的状态机
---------------------------
图片::https://cloud.githubusercontent.com/assets/3026621/15031178/bf5efb2a-124e-11e6-9748-0b5a5be60a30.png
图片::https://cloud.githubusercontent.com/assets/3026621/15031148/ad955f06-124e-11e6-865e-c7e3340f14cb.png
---------
`状态模式<;https://en.wikipedia.org/wiki/State椆Pattern>;`\br/>解决了许多问题,解开了代码并保存了理智。
它有点僵硬,不能伸缩。这个库的目标是给
接近状态模式的简单性和更大的灵活性。以及,
如果需要,完整的状态机功能,包括“FSM
<;https://en.wikipedia.org/wiki/Finite-state\u machine>;”、“HSM
<;https://en.wikipedia.org/wiki/UML\u state\u machine
;“BR/> BR/> BR/>目标-BR/> -BR/>< BR/> *提供一种状态模式,如行为更灵活(参见
文件http://PysM.Read DecsIO/En/最新/示例).html(gt;< < BR/>示例)
********************************************************************************输入(不仅仅是字符串)-解析
字符串又酷了!
*保持简单,即使对于不太熟悉fsm术语的人也一样
-输入、退出和其他事件处理程序
*条目和退出操作与状态关联,不转换
*只要事件是可散列的,事件就可以是任何事件
*状态历史和转换到以前的状态
*条件转换(if/elif/else-like-logic)
*显式行为(不向包含状态机的对象添加方法或属性)
*无需扩展具有状态机类的类(组合优先于继承)
*快速(即使有数百个转换规则)
*不会有太多pythonis,因此它很容易移植到其他语言(例如,`JavaScript<;https://github.com/pgularski/smjs>;````.
*Micropython支持
Installation
----
Install pysm from`PyPI<;https://pypi.python.org/pypi/pysm/>;`:
>或克隆“github pysm存储库”<;https://github.com/pgularski/pysm/>;`:
git克隆https://github.com/pgularski/pysm
cd pysm
python setup.py install
文档
----
阅读文档获取API文档和示例-http://pysm.Read the docs.io/
请参阅单元测试以了解它的工作和广泛测试。
Micropython支持
----
库与pyboards一起工作!
>upip.install('upysm'upism')
-
*`documentation<;http://pysm.readthedocs.io>;` `<
*`installation<;http://pysm.readthedocs.io/en/最新/installing.html>;` ` ` ` ` ` ` `<
*`github<;http://pythub.com/pgularski/pysmki/pysm>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` https://github.com/pgularski/pysm/issues>;`
*`examples<;http://pysm.readthedocs.io/en/latest/examples.html>;`
BR/> BR/>图片:https://travis-ci.org/pgularski/pysm.svg?branch=master
:目标:https://travis ci.org/pgularski/pysm
…图片::https://coveralls.io/repos/github/pgularski/pysm/badge.svg?branch=master
:目标:https://coveralls.io/github/pgularski/pysm?分支=主
…图片::https://api.codacy.com/project/badge/grade/6f18f01639c242a0b83280a52245539d
:目标:https://www.codacy.com/app/pgularski/pysm?utm_source=github.com&;utm_medium=referration&;utm_content=pgularski/pysm&;utm_campaign=Badge_Grade
图片::https://landscape.io/github/pgularski/pysm/master/landscape.svg?style=flat
:目标:https://landscape.io/github/pgularski/pysm/master
:alt:code health
…图片::https://readthedocs.org/projects/pysm/badge/?version=latest
:目标:http://pysm.readthedocs.io/en/latest/?badge=latest
:alt:Documentation Status
实现简单和复杂的状态机
---------------------------
图片::https://cloud.githubusercontent.com/assets/3026621/15031178/bf5efb2a-124e-11e6-9748-0b5a5be60a30.png
图片::https://cloud.githubusercontent.com/assets/3026621/15031148/ad955f06-124e-11e6-865e-c7e3340f14cb.png
`状态模式<;https://en.wikipedia.org/wiki/State椆Pattern>;`\br/>解决了许多问题,解开了代码并保存了理智。
它有点僵硬,不能伸缩。这个库的目标是给
接近状态模式的简单性和更大的灵活性。以及,
如果需要,完整的状态机功能,包括“FSM
<;https://en.wikipedia.org/wiki/Finite-state\u machine>;”、“HSM
<;https://en.wikipedia.org/wiki/UML\u state\u machine
;“BR/> BR/> BR/>目标-BR/> -BR/>< BR/> *提供一种状态模式,如行为更灵活(参见
文件http://PysM.Read DecsIO/En/最新/示例).html(gt;< < BR/>示例)
********************************************************************************输入(不仅仅是字符串)-解析
字符串又酷了!
*保持简单,即使对于不太熟悉fsm术语的人也一样
-输入、退出和其他事件处理程序
*条目和退出操作与状态关联,不转换
*只要事件是可散列的,事件就可以是任何事件
*状态历史和转换到以前的状态
*条件转换(if/elif/else-like-logic)
*显式行为(不向包含状态机的对象添加方法或属性)
*无需扩展具有状态机类的类(组合优先于继承)
*快速(即使有数百个转换规则)
*不会有太多pythonis,因此它很容易移植到其他语言(例如,`JavaScript<;https://github.com/pgularski/smjs>;````.
*Micropython支持
Installation
----
Install pysm from`PyPI<;https://pypi.python.org/pypi/pysm/>;`:
>或克隆“github pysm存储库”<;https://github.com/pgularski/pysm/>;`:
git克隆https://github.com/pgularski/pysm
cd pysm
python setup.py install
文档
----
阅读文档获取API文档和示例-http://pysm.Read the docs.io/
请参阅单元测试以了解它的工作和广泛测试。
Micropython支持
----
库与pyboards一起工作!
>upip.install('upysm'upism')
-
*`documentation<;http://pysm.readthedocs.io>;` `<
*`installation<;http://pysm.readthedocs.io/en/最新/installing.html>;` ` ` ` ` ` ` `<
*`github<;http://pythub.com/pgularski/pysmki/pysm>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` https://github.com/pgularski/pysm/issues>;`
*`examples<;http://pysm.readthedocs.io/en/latest/examples.html>;`