File: import3

package info (click to toggle)
python-fysom 2.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: python: 1,538; makefile: 3
file content (10 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env python3
from fysom import Fysom

fsm = Fysom({'initial': 'green',
             'events': [
                  {'name': 'warn', 'src': 'green', 'dst': 'yellow'},
                  {'name': 'panic', 'src': 'yellow', 'dst': 'red'},
                  {'name': 'calm', 'src': 'red', 'dst': 'yellow'},
                  {'name': 'clear', 'src': 'yellow', 'dst': 'green'}]})
print(fsm.current)