summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README5
1 files changed, 3 insertions, 2 deletions
diff --git a/README b/README
index 4a1fe6b..ed65737 100644
--- a/README
+++ b/README
@@ -185,7 +185,8 @@ Dynamically generated event names
Sometimes you have to compute the name of an event you want to trigger on the
fly. Instead of relying on `getattr` you can use the `trigger` method, which takes
-a string (the event name) as a parameter.
+a string (the event name) as a parameter, followed by any arguments/keyword
+arguments you want to pass to the event method.
This is also arguably better if you're not sure if the event exists at all
(FysomError vs. AttributeError, see below).
@@ -200,7 +201,7 @@ This is also arguably better if you're not sure if the event exists at all
{'name': 'calm', 'src': 'red', 'dst': 'yellow'},
{'name': 'clear', 'src': 'yellow', 'dst': 'green'} ] })
- fsm.trigger('warn') # equivalent to fsm.warn()
+ fsm.trigger('warn', msg="danger") # equivalent to fsm.warn(msg="danger")
fsm.trigger('unknown') # FysomError, event does not exist
fsm.unknown() # AttributeError, event does not exist