New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EvMenu exec option behavior does not conform to docs, raises traceback #1429
Comments
|
This example indicates that |
That |
Sorry, it took me a while to understand that distinction, that a string name of a function is handled completely differently (treated as a node) as opposed to directly providing the function object itself. I think that's where I got tripped up, since it seemed like |
@RyanStein: I however agree this can be made clearer in the doc. :) |
The traceback reported, from #1457: Error in menu node 'check_choice'.
Traceback (most recent call last):
File "c:\users\user\my documents\python\evennia\evennia\commands\cmdhandler.py", line 509, in _run_command
ret = yield cmd.func()
File "c:\users\user\my documents\python\evennia\evennia\utils\evmenu.py", line 266, in func
menu._input_parser(menu, self.raw_string, caller)
File "c:\users\user\my documents\python\evennia\evennia\utils\evmenu.py", line 404, in evtable_parse_input
menuobject.callback_goto(callback, goto, raw_string)
File "c:\users\user\my documents\python\evennia\evennia\utils\evmenu.py", line 733, in callback_goto
self.goto(goto, raw_string)
File "c:\users\user\my documents\python\evennia\evennia\utils\evmenu.py", line 806, in goto
nodetext, options = self._execute_node(nodename, raw_string)
File "c:\users\user\my documents\python\evennia\evennia\utils\evmenu.py", line 698, in _execute_node
nodetext, options = node(self.caller, raw_string)
ValueError: too many values to unpack
An untrapped error occurred.
(Traceback was logged 2017-10-01 19:14:38+1100).
Traceback (most recent call last):
File "c:\users\user\my documents\python\evennia\evennia\commands\cmdhandler.py", line 653, in cmdhandler
unformatted_raw_string, cmdset, session, player)
ErrorReported: 1 |
The |
Brief summary of issue / Description of requested feature:
According to the documentation for EvMenu, the
exec
option on a menu node should call a function and if it returns a single string argument, the menu will redirect to that node instead. It seems like they're being treated likegoto
options but the return arguments are ignored, and there must be at least two returns or it tracebacks.Steps to reproduce the issue / Reasons for adding feature:
Error output / Expected result of feature
Tracebacks if
exec
does not return two values, which seem to be ignored either way.Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
Evennia 0.6 63ccac8
The text was updated successfully, but these errors were encountered: