Fix evmenu doc example
This commit is contained in:
parent
ecb0c29edc
commit
596a081a64
1 changed files with 5 additions and 6 deletions
|
|
@ -645,9 +645,6 @@ def _gamble(caller, raw_string, **kwargs):
|
||||||
else:
|
else:
|
||||||
return "win"
|
return "win"
|
||||||
|
|
||||||
def _try_again(caller, raw_string, **kwargs):
|
|
||||||
return None # reruns the same node
|
|
||||||
|
|
||||||
template_string = """
|
template_string = """
|
||||||
|
|
||||||
## node start
|
## node start
|
||||||
|
|
@ -660,8 +657,8 @@ he says.
|
||||||
|
|
||||||
## options
|
## options
|
||||||
|
|
||||||
1. Roll the dice -> gamble()
|
1: Roll the dice -> gamble()
|
||||||
2. Try to talk yourself out of rolling -> ask_again()
|
2: Try to talk yourself out of rolling -> start
|
||||||
|
|
||||||
## node win
|
## node win
|
||||||
|
|
||||||
|
|
@ -687,7 +684,9 @@ says Death.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
goto_callables = {"gamble": _gamble, "ask_again": _ask_again}
|
# map the in-template callable-name to real python code
|
||||||
|
goto_callables = {"gamble": _gamble}
|
||||||
|
# this starts the evmenu for the caller
|
||||||
evmenu.template2menu(caller, template_string, goto_callables)
|
evmenu.template2menu(caller, template_string, goto_callables)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue