<spanid="evennia-utils-evmenu"></span><h1>evennia.utils.evmenu<aclass="headerlink"href="#module-evennia.utils.evmenu"title="Link to this heading">¶</a></h1>
<p>EvMenu</p>
<p>This implements a full menu system for Evennia.</p>
<p>To start the menu, just import the EvMenu class from this module.
<p>Where caller is the object using the menu and input_string is the
command entered by the user on the <em>previous</em> node (the command
entered to get to this node). The node function code will only be
executed once per node-visit and the system will accept nodes with
both one or two arguments interchangeably. It also accepts nodes
that takes <strong>**kwargs</strong>.</p>
<p>The menu tree itself is available on the caller as
<strong>caller.ndb._evmenu</strong>. This makes it a convenient place to store
temporary state variables between nodes, since this NAttribute is
deleted when the menu is exited.</p>
<p>The return values must be given in the above order, but each can be
returned as None as well. If the options are returned as None, the
menu is immediately exited and the default “look” command is called.</p>
<ulclass="simple">
<li><dlclass="simple">
<dt><strong>text</strong> (str, tuple or None): Text shown at this node. If a tuple, the</dt><dd><p>second element in the tuple holds either a string or a dict. If a string,
this is the help text to show when <strong>auto_help</strong> is active for the menu and
the user presses <strong>h</strong>. If a dict, this is a mapping of <strong>‘help topic’: ‘help text’</strong> to
show in that menu. This can be used to show information without having to
switch to another node.</p>
</dd>
</dl>
</li>
<li><p><strong>options</strong> (tuple, dict or None): If <strong>None</strong>, this exits the menu.
If a single dict, this is a single-option node. If a tuple,
it should be a tuple of option dictionaries. Option dicts have the following keys:</p>
<ul>
<li><p><strong>key</strong> (str or tuple, optional): What to enter to choose this option.
If a tuple, it must be a tuple of strings, where the first string is the
key which will be shown to the user and the others are aliases.
If unset, the options’ number will be used. The special key <strong>_default</strong>
marks this option as the default fallback when no other option matches
the user input. There can only be one <strong>_default</strong> option per node. It
will not be displayed in the list.</p></li>
<li><p><strong>desc</strong> (str, optional): This describes what choosing the option will do.</p></li>
<li><p><strong>goto</strong> (str, tuple or callable): If string, should be the name of node to go to
when this option is selected. If a callable, it has the signature
<strong>callable(caller[,raw_input][,**kwargs])</strong>. If a tuple, the first element
is the callable and the second is a dict with the <strong>**kwargs</strong> to pass to
the callable. Those kwargs will also be passed into the next node if possible.
Such a callable should return either a str or a (str, dict), where the
string is the name of the next node to go to and the dict is the new,
(possibly modified) kwarg to pass into the next node. If the callable returns
None or the empty string, the current node will be revisited.</p></li>
</ul>
</li>
</ul>
<p>If <strong>key</strong> is not given, the option will automatically be identified by
its number 1..N.</p>
<p>Example:</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># in menu_module.py</span>
<spanclass="p">{</span><spanclass="s2">"desc"</span><spanclass="p">:</span><spanclass="s2">"Go to node 3."</span><spanclass="p">,</span>
<emclass="property"><spanclass="k"><spanclass="pre">exception</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">EvMenuError</span></span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenuError"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuError"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="k"><spanclass="pre">exception</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">EvMenuGotoAbortMessage</span></span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenuGotoAbortMessage"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuGotoAbortMessage"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">CmdEvMenuNode</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdEvMenuNode"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'__noinput_command'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">aliases</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">['__nomatch_command']</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.aliases"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">locks</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'cmd:all()'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.locks"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">help_category</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'menu'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.help_category"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">auto_help_display_key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'<menu</span><spanclass="pre">commands>'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.auto_help_display_key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_help</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdEvMenuNode.get_help"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.get_help"title="Link to this definition">¶</a></dt>
<dd><p>Return the help message for this command and this caller.</p>
<p>By default, return self.__doc__ (the docstring just under
the class definition). You can override this behavior,
though, and even customize it depending on the caller, or other
<li><p><strong>caller</strong> (<em>Object</em><em> or </em><em>Account</em>) – the caller asking for help on the command.</p></li>
<li><p><strong>cmdset</strong> (<aclass="reference internal"href="evennia.commands.cmdhandler.html#evennia.commands.cmdhandler.CmdSet"title="evennia.commands.cmdhandler.CmdSet"><em>CmdSet</em></a>) – the command set (if you need additional commands).</p></li>
<spanclass="sig-name descname"><spanclass="pre">func</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdEvMenuNode.func"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.func"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">lock_storage</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'cmd:all()'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.lock_storage"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">search_index_entry</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">{'aliases':</span><spanclass="pre">'__nomatch_command',</span><spanclass="pre">'category':</span><spanclass="pre">'menu',</span><spanclass="pre">'key':</span><spanclass="pre">'__noinput_command',</span><spanclass="pre">'no_prefix':</span><spanclass="pre">'</span><spanclass="pre">__nomatch_command',</span><spanclass="pre">'tags':</span><spanclass="pre">'',</span><spanclass="pre">'text':</span><spanclass="pre">'\nCommand</span><spanclass="pre">to</span><spanclass="pre">handle</span><spanclass="pre">all</span><spanclass="pre">user</span><spanclass="pre">input</span><spanclass="pre">targeted</span><spanclass="pre">at</span><spanclass="pre">the</span><spanclass="pre">menu</span><spanclass="pre">while</span><spanclass="pre">the</span><spanclass="pre">menu</span><spanclass="pre">is</span><spanclass="pre">active.\n\n'}</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdEvMenuNode.search_index_entry"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">EvMenuCmdSet</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">cmdsetobj</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">key</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenuCmdSet"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'menu_cmdset'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">priority</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">1</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.priority"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">mergetype</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'Replace'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.mergetype"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_objs</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.no_objs"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_exits</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.no_exits"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_channels</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">False</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.no_channels"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">at_cmdset_creation</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenuCmdSet.at_cmdset_creation"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.at_cmdset_creation"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">path</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'evennia.utils.evmenu.EvMenuCmdSet'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenuCmdSet.path"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">node_border_char</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'_'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.node_border_char"title="Link to this definition">¶</a></dt>
<li><p><strong>caller</strong> (<em>Object</em><em>, </em><em>Account</em><em> or </em><aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a>) – The user of the menu.</p></li>
<li><p><strong>menudata</strong> (<em>str</em><em>, </em><em>module</em><em> or </em><em>dict</em>) – The full or relative path to the module
holding the menu tree data. All global functions in this module
whose name doesn’t start with ‘_ ‘ will be parsed as menu nodes.
Also the module itself is accepted as input. Finally, a dictionary
menu tree can be given directly. This must then be a mapping
<strong>{“nodekey”:callable,…}</strong> where <strong>callable</strong> must be called as
and return the data expected of a menu node. This allows for
dynamic menu creation.</p></li>
<li><p><strong>startnode</strong> (<em>str</em><em>, </em><em>optional</em>) – The starting node name in the menufile.</p></li>
<li><p><strong>cmdset_mergetype</strong> (<em>str</em><em>, </em><em>optional</em>) –‘Replace’ (default) means the menu
commands will be exclusive - no other normal commands will
be usable while the user is in the menu. ‘Union’ does merge the menu
command, but note that the only command used in EvMenu has key/alias
of NOINPUT/NOMATCH. So if you merge with ‘Union’ and a high <strong>cmdset_prio</strong>
(below), you won’t replace individual normal commands as you may
expect. Instead commands will work normally and you’ll only always fall
back to menu commands when no other command is found. There is no way
to partially replace normal commands with EvMenu actions - to do this,
remove the normal command from the caller’s cmdset - if not found
the menu’s version will kick in instead.</p></li>
<li><p><strong>cmdset_priority</strong> (<em>int</em><em>, </em><em>optional</em>) – The merge priority for the
menu command set. The default (1) is usually enough for most
types of menus.</p></li>
<li><p><strong>auto_quit</strong> (<em>bool</em><em>, </em><em>optional</em>) – Allow user to use “q”, “quit” or
“exit” to leave the menu at any point. Recommended during
development!</p></li>
<li><p><strong>auto_look</strong> (<em>bool</em><em>, </em><em>optional</em>) – Automatically make “looK” or “l” to
re-show the last node. Turning this off means you have to handle
re-showing nodes yourself, but may be useful if you need to
use “l” for some other purpose.</p></li>
<li><p><strong>auto_help</strong> (<em>bool</em><em>, </em><em>optional</em>) – Automatically make “help” or “h” show
the current help entry for the node. If turned off, eventual
help must be handled manually, but it may be useful if you
need ‘h’ for some other purpose, for example.</p></li>
<li><p><strong>cmd_on_exit</strong> (<em>callable</em><em>, </em><em>str</em><em> or </em><em>None</em><em>, </em><em>optional</em>) – When exiting the menu
(either by reaching a node with no options or by using the
in-built quit command (activated with <strong>allow_quit</strong>), this
callback function or command string will be executed.
The callback function takes two parameters, the caller then the
EvMenu object. This is called after cleanup is complete.
Set to None to not call any command.</p></li>
<li><p><strong>persistent</strong> (<em>bool</em><em>, </em><em>optional</em>) – Make the Menu persistent (i.e. it will
survive a reload. This will make the Menu cmdset persistent. Use
with caution - if your menu is buggy you may end up in a state
you can’t get out of! Also note that persistent mode requires
that all formatters, menu nodes and callables are possible to
<em>pickle</em>. When the server is reloaded, the latest node shown will be completely
re-run with the same input arguments - so be careful if you are counting
up some persistent counter or similar - the counter may be run twice if
reload happens on the node that does that. Note that if <strong>debug</strong> is True,
this setting is ignored and assumed to be False.</p></li>
<li><p><strong>startnode_input</strong> (<em>str</em><em> or </em><em>(</em><em>str</em><em>, </em><em>dict</em><em>)</em><em>, </em><em>optional</em>) – Send an input text to <strong>startnode</strong> as if
a user input text from a fictional previous node. If including the dict, this will
be passed as <strong>kwargs to that node. When the server reloads,
the latest visited node will be re-run as **node(caller, raw_string, **kwargs)</strong>.</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – This is useful when calling EvMenu from an account
in multisession mode > 2. Note that this session only really relevant
for the very first display of the first node - after that, EvMenu itself
will keep the session updated from the command input. So a persistent
menu will <em>not</em> be using this same session anymore after a reload.</p></li>
<li><p><strong>debug</strong> (<em>bool</em><em>, </em><em>optional</em>) – If set, the ‘menudebug’ command will be made available
by default in all nodes of the menu. This will print out the current state of
the menu. Deactivate for production use! When the debug flag is active, the
<strong>persistent</strong> flag is deactivated.</p></li>
<li><p><strong>**kwargs</strong>– All kwargs will become initialization variables on <strong>caller.ndb._evmenu</strong>,
<ddclass="field-even"><p><aclass="reference internal"href="#evennia.utils.evmenu.EvMenuError"title="evennia.utils.evmenu.EvMenuError"><strong>EvMenuError</strong></a>– If the start/end node is not found in menu tree.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>While running, the menu is stored on the caller as <strong>caller.ndb._evmenu</strong>. Also
the current Session (from the Command, so this is still valid in multisession
environments) is available through <strong>caller.ndb._evmenu._session</strong>. The <strong>_evmenu</strong>
property is a good one for storing intermediary data on between nodes since it
will be automatically deleted when the menu closes.</p>
<p>In persistent mode, all nodes, formatters and callbacks in the menu must be
possible to be <em>pickled</em>, this excludes e.g. callables that are class methods
or functions defined dynamically or as part of another function. In
non-persistent mode no such restrictions exist.</p>
<spanclass="sig-name descname"><spanclass="pre">goto</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">nodename_or_callable</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">raw_string</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.goto"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.goto"title="Link to this definition">¶</a></dt>
<dd><p>Run a node by name, optionally dynamically generating that name first.</p>
<spanclass="sig-name descname"><spanclass="pre">close_menu</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.close_menu"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.close_menu"title="Link to this definition">¶</a></dt>
<dd><p>Shutdown menu; occurs when reaching the end node or using the quit command.</p>
<spanclass="sig-name descname"><spanclass="pre">print_debug_info</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">arg</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.print_debug_info"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.print_debug_info"title="Link to this definition">¶</a></dt>
<dd><p>Messages the caller with the current menu state, for debug purposes.</p>
<spanclass="sig-name descname"><spanclass="pre">msg</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">txt</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.msg"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.msg"title="Link to this definition">¶</a></dt>
<dd><p>This is a central point for sending return texts to the caller. It
allows for a central point to add custom messaging when creating custom
<spanclass="sig-name descname"><spanclass="pre">parse_input</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">raw_string</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.parse_input"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.parse_input"title="Link to this definition">¶</a></dt>
<dd><p>Parses the incoming string from the menu user. This is the entry-point for all input
<spanclass="sig-name descname"><spanclass="pre">display_nodetext</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.display_nodetext"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.display_nodetext"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">display_helptext</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.display_helptext"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.display_helptext"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">display_tooltip</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">cmd</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.display_tooltip"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.display_tooltip"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">nodetext_formatter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">nodetext</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.nodetext_formatter"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.nodetext_formatter"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">helptext_formatter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">helptext</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.helptext_formatter"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.helptext_formatter"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">options_formatter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">optionlist</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.options_formatter"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.options_formatter"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">node_formatter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">nodetext</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">optionstext</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#EvMenu.node_formatter"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.EvMenu.node_formatter"title="Link to this definition">¶</a></dt>
<li><p><strong>nodetext</strong> (<em>str</em>) – The node text as returned by <strong>self.nodetext_formatter</strong>.</p></li>
<li><p><strong>optionstext</strong> (<em>str</em>) – The options display as returned by <strong>self.options_formatter</strong>.</p></li>
<li><p><strong>caller</strong> (<em>Object</em><em>, </em><em>Account</em><em> or </em><em>None</em><em>, </em><em>optional</em>) – The caller of the node.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">list_node</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">option_generator</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">select</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pagesize</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">10</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#list_node"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.list_node"title="Link to this definition">¶</a></dt>
<dd><p>Decorator for making an EvMenu node into a multi-page list node. Will add new options,
<li><p><strong>option_generator</strong> (<em>callable</em><em> or </em><em>list</em>) – A list of strings indicating the options, or a callable
that is called as option_generator(caller) to produce such a list.</p></li>
<li><p><strong>select</strong> (<em>callable</em><em> or </em><em>str</em><em>, </em><em>optional</em>) – Node to redirect a selection to. Its <strong>**kwargs</strong> will
contain the <strong>available_choices</strong> list and <strong>selection</strong> will hold one of the elements in
that list. If a callable, it will be called as
<strong>select(caller, menuchoice, **kwargs)</strong> where menuchoice is the chosen option as a
string and <strong>available_choices</strong> is a kwarg mapping the option keys to the choices
offered by the option_generator. The callable whould return the name of the target node
to goto after this selection (or None to repeat the list-node). Note that if this is not
given, the decorated node must itself provide a way to continue from the node!</p></li>
<li><p><strong>pagesize</strong> (<em>int</em>) – How many options to show per page.</p></li>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">CmdGetInput</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdGetInput"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'__nomatch_command'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">aliases</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">['__noinput_command']</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.aliases"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">func</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdGetInput.func"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.func"title="Link to this definition">¶</a></dt>
<dd><p>This is called when user enters anything.</p>
<spanclass="sig-name descname"><spanclass="pre">help_category</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'general'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.help_category"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">lock_storage</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'cmd:all();'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.lock_storage"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">search_index_entry</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">{'aliases':</span><spanclass="pre">'__noinput_command',</span><spanclass="pre">'category':</span><spanclass="pre">'general',</span><spanclass="pre">'key':</span><spanclass="pre">'__nomatch_command',</span><spanclass="pre">'no_prefix':</span><spanclass="pre">'</span><spanclass="pre">__noinput_command',</span><spanclass="pre">'tags':</span><spanclass="pre">'',</span><spanclass="pre">'text':</span><spanclass="pre">'\nEnter</span><spanclass="pre">your</span><spanclass="pre">data</span><spanclass="pre">and</span><spanclass="pre">press</span><spanclass="pre">return.\n'}</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdGetInput.search_index_entry"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">InputCmdSet</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">cmdsetobj</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">key</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#InputCmdSet"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'input_cmdset'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">priority</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">1</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.priority"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">mergetype</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'Replace'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.mergetype"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_objs</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.no_objs"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_exits</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.no_exits"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_channels</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">False</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.no_channels"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">at_cmdset_creation</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#InputCmdSet.at_cmdset_creation"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.at_cmdset_creation"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">path</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'evennia.utils.evmenu.InputCmdSet'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.InputCmdSet.path"title="Link to this definition">¶</a></dt>
<li><p><strong>caller</strong> (<em>Account</em><em> or </em><em>Object</em>) – The entity being asked the question. This
should usually be an object controlled by a user.</p></li>
<li><p><strong>prompt</strong> (<em>str</em>) – This text will be shown to the user, in order to let them
know their input is needed.</p></li>
<li><p><strong>callback</strong> (<em>callable</em>) – A function that will be called
when the user enters a reply. It must take three arguments: the
<strong>caller</strong>, the <strong>prompt</strong> text and the <strong>result</strong> of the input given by
the user. If the callback doesn’t return anything or return False,
the input prompt will be cleaned up and exited. If returning True,
the prompt will remain and continue to accept input.</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – This allows to specify the
session to send the prompt to. It’s usually only needed if <strong>caller</strong>
is an Account in multisession modes greater than 2. The session is
then updated by the command and is available (for example in
callbacks) through <strong>caller.ndb.getinput._session</strong>.</p></li>
<li><p><strong>*args</strong> (<em>any</em>) – Extra arguments to pass to <strong>callback</strong>. To utilise <strong>*args</strong>
(and <strong>**kwargs</strong>), a value for the <strong>session</strong> argument must also be
provided.</p></li>
<li><p><strong>**kwargs</strong> (<em>any</em>) – Extra kwargs to pass to <strong>callback</strong>.</p></li>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">CmdYesNoQuestion</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdYesNoQuestion"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'__noinput_command'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">aliases</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">['__nomatch_command',</span><spanclass="pre">'a',</span><spanclass="pre">'yes',</span><spanclass="pre">'abort',</span><spanclass="pre">'no',</span><spanclass="pre">'y',</span><spanclass="pre">'n']</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">arg_regex</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">re.compile('^$',</span><spanclass="pre">re.IGNORECASE)</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.arg_regex"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">func</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#CmdYesNoQuestion.func"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.func"title="Link to this definition">¶</a></dt>
<dd><p>This is called when user enters anything.</p>
<spanclass="sig-name descname"><spanclass="pre">help_category</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'general'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.help_category"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">lock_storage</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'cmd:all();'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.lock_storage"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">search_index_entry</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">{'aliases':</span><spanclass="pre">'__nomatch_command</span><spanclass="pre">a</span><spanclass="pre">yes</span><spanclass="pre">abort</span><spanclass="pre">no</span><spanclass="pre">y</span><spanclass="pre">n',</span><spanclass="pre">'category':</span><spanclass="pre">'general',</span><spanclass="pre">'key':</span><spanclass="pre">'__noinput_command',</span><spanclass="pre">'no_prefix':</span><spanclass="pre">'</span><spanclass="pre">__nomatch_command</span><spanclass="pre">a</span><spanclass="pre">yes</span><spanclass="pre">abort</span><spanclass="pre">no</span><spanclass="pre">y</span><spanclass="pre">n',</span><spanclass="pre">'tags':</span><spanclass="pre">'',</span><spanclass="pre">'text':</span><spanclass="pre">'\nHandle</span><spanclass="pre">a</span><spanclass="pre">prompt</span><spanclass="pre">for</span><spanclass="pre">yes</span><spanclass="pre">or</span><spanclass="pre">no.</span><spanclass="pre">Press</span><spanclass="pre">[return]</span><spanclass="pre">for</span><spanclass="pre">the</span><spanclass="pre">default</span><spanclass="pre">choice.\n\n'}</span></em><aclass="headerlink"href="#evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">YesNoQuestionCmdSet</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">cmdsetobj</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">key</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#YesNoQuestionCmdSet"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">key</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'yes_no_question_cmdset'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.key"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">priority</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">1</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.priority"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">mergetype</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'Replace'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.mergetype"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_objs</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.no_objs"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_exits</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.no_exits"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">no_channels</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">False</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.no_channels"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">at_cmdset_creation</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#YesNoQuestionCmdSet.at_cmdset_creation"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.at_cmdset_creation"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">path</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'evennia.utils.evmenu.YesNoQuestionCmdSet'</span></em><aclass="headerlink"href="#evennia.utils.evmenu.YesNoQuestionCmdSet.path"title="Link to this definition">¶</a></dt>
<li><p><strong>caller</strong> (<em>Object</em>) – The entity being asked.</p></li>
<li><p><strong>prompt</strong> (<em>str</em>) – The yes/no question to ask. This takes an optional formatting
marker <strong>{options}</strong> which will be filled with ‘Y/N’, ‘[Y]/N’ or
‘Y/[N]’ depending on the setting of <strong>default</strong>. If <strong>allow_abort</strong> is set,
then the ‘A(bort)’ option will also be available.</p></li>
<li><p><strong>yes_action</strong> (<em>callable</em><em> or </em><em>str</em>) – If a callable, this will be called
with <strong>(caller, *args, **kwargs)</strong> when the Yes-choice is made.
If a string, this string will be echoed back to the caller.</p></li>
<li><p><strong>no_action</strong> (<em>callable</em><em> or </em><em>str</em>) – If a callable, this will be called
with <strong>(caller, *args, **kwargs)</strong> when the No-choice is made.
If a string, this string will be echoed back to the caller.</p></li>
<li><p><strong>default</strong> (<em>str optional</em>) – This is what the user will get if they just press the
return key without giving any input. One of ‘N’, ‘Y’, ‘A’ or <strong>None</strong>
for no default (an explicit choice must be given). If ‘A’ (abort)
is given, <strong>allow_abort</strong> kwarg is ignored and assumed set.</p></li>
<li><p><strong>allow_abort</strong> (<em>bool</em><em>, </em><em>optional</em>) – If set, the ‘A(bort)’ option is available
(a third option meaning neither yes or no but just exits the prompt).</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – This allows to specify the
session to send the prompt to. It’s usually only needed if <strong>caller</strong>
is an Account in multisession modes greater than 2. The session is
then updated by the command and is available (for example in
callbacks) through <strong>caller.ndb._yes_no_question.session</strong>.</p></li>
<li><p><strong>*args</strong>– Additional arguments passed on into callables.</p></li>
<li><p><strong>**kwargs</strong>– Additional keyword args passed on into callables.</p></li>
<ddclass="field-even"><p><strong>RuntimeError</strong><strong>, </strong><strong>FooError</strong>– If default and <strong>allow_abort</strong> clashes.</p>
</dd>
</dl>
<pclass="rubric">Example</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># just returning strings</span>
<spanclass="n">ask_yes_no</span><spanclass="p">(</span><spanclass="n">caller</span><spanclass="p">,</span><spanclass="s2">"Are you happy </span><spanclass="si">{options}</span><spanclass="s2">?"</span><spanclass="p">,</span>
<spanclass="n">ask_yes_no</span><spanclass="p">(</span><spanclass="n">caller</span><spanclass="p">,</span><spanclass="s2">"Are you sad </span><spanclass="si">{options}</span><spanclass="s2">?"</span><spanclass="p">,</span>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.evmenu.</span></span><spanclass="sig-name descname"><spanclass="pre">parse_menu_template</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">caller</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">menu_template</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">goto_callables</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evmenu.html#parse_menu_template"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.evmenu.parse_menu_template"title="Link to this definition">¶</a></dt>
<dd><p>Parse menu-template string. The main function of the EvMenu templating system.</p>