evennia/docs/2.x/api/evennia.commands.default.syscommands.html
2023-12-20 18:20:52 +01:00

293 lines
No EOL
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.commands.default.syscommands &#8212; Evennia 2.x documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.commands.default.system" href="evennia.commands.default.system.html" />
<link rel="prev" title="evennia.commands.default.muxcommand" href="evennia.commands.default.muxcommand.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.commands.default.system.html" title="evennia.commands.default.system"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.commands.default.muxcommand.html" title="evennia.commands.default.muxcommand"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.commands.html" >evennia.commands</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.commands.default.html" accesskey="U">evennia.commands.default</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.commands.default.syscommands</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.commands.default.muxcommand.html"
title="previous chapter">evennia.commands.default.muxcommand</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.commands.default.system.html"
title="next chapter">evennia.commands.default.system</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.commands.default.syscommands.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
<li><a href="https://github.com/evennia/evennia">Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
</div>
</div>
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.commands.default.syscommands">
<span id="evennia-commands-default-syscommands"></span><h1>evennia.commands.default.syscommands<a class="headerlink" href="#module-evennia.commands.default.syscommands" title="Permalink to this headline"></a></h1>
<p>System commands</p>
<p>These are the default commands called by the system commandhandler
when various exceptions occur. If one of these commands are not
implemented and part of the current cmdset, the engine falls back
to a default solution instead.</p>
<p>Some system commands are shown in this module
as a REFERENCE only (they are not all added to Evennias
default cmdset since they dont currently do anything differently from the
default backup systems hard-wired in the engine).</p>
<p>Overloading these commands in a cmdset can be used to create
interesting effects. An example is using the NoMatch system command
to implement a line-editor where you dont have to start each
line with a command (if there is no match to a known command,
the line is just added to the editor buffer).</p>
<dl class="py class">
<dt id="evennia.commands.default.syscommands.SystemNoInput">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.syscommands.</code><code class="sig-name descname">SystemNoInput</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemNoInput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.muxcommand.html#evennia.commands.default.muxcommand.MuxCommand" title="evennia.commands.default.muxcommand.MuxCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.muxcommand.MuxCommand</span></code></a></p>
<p>This is called when there is no input given</p>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.key">
<code class="sig-name descname">key</code><em class="property"> = '__noinput_command'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.syscommands.SystemNoInput.func">
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemNoInput.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.func" title="Permalink to this definition"></a></dt>
<dd><p>Do nothing.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' ', 'tags': '', 'text': '\n This is called when there is no input given\n '}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.commands.default.syscommands.SystemNoMatch">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.syscommands.</code><code class="sig-name descname">SystemNoMatch</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemNoMatch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.muxcommand.html#evennia.commands.default.muxcommand.MuxCommand" title="evennia.commands.default.muxcommand.MuxCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.muxcommand.MuxCommand</span></code></a></p>
<p>No command was found matching the given input.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.key">
<code class="sig-name descname">key</code><em class="property"> = '__nomatch_command'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.func">
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemNoMatch.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.func" title="Permalink to this definition"></a></dt>
<dd><p>This is given the failed raw string as input.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__nomatch_command', 'no_prefix': ' ', 'tags': '', 'text': '\n No command was found matching the given input.\n '}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.commands.default.syscommands.SystemMultimatch">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.syscommands.</code><code class="sig-name descname">SystemMultimatch</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemMultimatch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.muxcommand.html#evennia.commands.default.muxcommand.MuxCommand" title="evennia.commands.default.muxcommand.MuxCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.muxcommand.MuxCommand</span></code></a></p>
<p>Multiple command matches.</p>
<p>The cmdhandler adds a special attribute matches to this
system command.</p>
<blockquote>
<div><p>matches = [(cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname) , (cmdname, …), …]</p>
</div></blockquote>
<p>Here, <strong>cmdname</strong> is the commands name and <strong>args</strong> the rest of the incoming string,
without said command name. <strong>cmdobj</strong> is the Command instance, the cmdlen is
the same as len(cmdname) and mratio is a measure of how big a part of the
full input string the cmdname takes up - an exact match would be 1.0. Finally,
the <strong>raw_cmdname</strong> is the cmdname unmodified by eventual prefix-stripping.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.key">
<code class="sig-name descname">key</code><em class="property"> = '__multimatch_command'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.func">
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/syscommands.html#SystemMultimatch.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.func" title="Permalink to this definition"></a></dt>
<dd><p>Handle multiple-matches by using the at_search_result default handler.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__multimatch_command', 'no_prefix': ' ', 'tags': '', 'text': &quot;\n Multiple command matches.\n\n The cmdhandler adds a special attribute 'matches' to this\n system command.\n\n matches = [(cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname) , (cmdname, ...), ...]\n\n Here, `cmdname` is the command's name and `args` the rest of the incoming string,\n without said command name. `cmdobj` is the Command instance, the cmdlen is\n the same as len(cmdname) and mratio is a measure of how big a part of the\n full input string the cmdname takes up - an exact match would be 1.0. Finally,\n the `raw_cmdname` is the cmdname unmodified by eventual prefix-stripping.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
</div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.commands.default.system.html" title="evennia.commands.default.system"
>next</a> |</li>
<li class="right" >
<a href="evennia.commands.default.muxcommand.html" title="evennia.commands.default.muxcommand"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.commands.html" >evennia.commands</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.commands.default.html" >evennia.commands.default</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.commands.default.syscommands</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2023, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>