finesm

Installation
pip install finesm
Usage
from finesm import State, StateMachine
class MyStateMachine(StateMachine):
stop = State(default=True)
go = State()
@stop.on_message('switch')
def stop_switch(self):
self.set_state(go)
@stop.on_exit
def stop_exit(self):
print('exiting stop state')
@go.on_enter
def go_enter(self):
print('entering go state')
@go.on_update
def go_update(self):
print('tick')
sm = MyStateMachine()
sm.state # stop
sm.update() #
sm.send_message('switch') # exiting stop state
# entering go state
sm.update() # tick
Metadata
Release files for finesm 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| finesm-1.0.0.tar.gz | 2.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| finesm-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.3 kB
Release files / finesm-1.0.0.tar.gz
| Download URL | finesm-1.0.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c1f780106ab4cad7100f2abdcf485a7278779e9d101cc68aeae7a59e8107b5e
|
|
BLAKE2b-256 checksum How to use checksums |
007af5f62e8a0843f1aee356e886a1049d09e45b332f256b0484b0e41acf37eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
|
Release files / finesm-1.0.0-py3-none-any.whl
| Download URL | finesm-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3cde691e83a00b8b70d76822b6382e94b164b0cc1db83559b03c9d7ba8f3e699
|
|
BLAKE2b-256 checksum How to use checksums |
2f4daa428923218183cd4ecd7f846edd4958c67e8a9cdab924ee405914460caa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
|