evennia/docs/0.9.5/api/evennia.contrib.gendersub.html
Griatch e34f258a92 Revert "Updated HTML docs."
This reverts commit 51d5840b8b.
2022-11-14 22:43:45 +01:00

246 lines
No EOL
15 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.contrib.gendersub &#8212; Evennia 0.9.5 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>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</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" />
</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="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.gendersub</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.contrib.gendersub">
<span id="evennia-contrib-gendersub"></span><h1>evennia.contrib.gendersub<a class="headerlink" href="#module-evennia.contrib.gendersub" title="Permalink to this headline"></a></h1>
<p>Gendersub</p>
<p>Griatch 2015</p>
<p>This is a simple gender-aware Character class for allowing users to
insert custom markers in their text to indicate gender-aware
messaging. It relies on a modified msg() and is meant as an
inspiration and starting point to how to do stuff like this.</p>
<dl class="simple">
<dt>An object can have the following genders:</dt><dd><ul class="simple">
<li><p>male (he/his)</p></li>
<li><p>female (her/hers)</p></li>
<li><p>neutral (it/its)</p></li>
<li><p>ambiguous (they/them/their/theirs)</p></li>
</ul>
</dd>
</dl>
<p>When in use, messages can contain special tags to indicate pronouns gendered
based on the one being addressed. Capitalization will be retained.</p>
<ul class="simple">
<li><p><strong>|s</strong>, <strong>|S</strong>: Subjective form: he, she, it, He, She, It, They</p></li>
<li><p><strong>|o</strong>, <strong>|O</strong>: Objective form: him, her, it, Him, Her, It, Them</p></li>
<li><p><strong>|p</strong>, <strong>|P</strong>: Possessive form: his, her, its, His, Her, Its, Their</p></li>
<li><p><strong>|a</strong>, <strong>|A</strong>: Absolute Possessive form: his, hers, its, His, Hers, Its, Theirs</p></li>
</ul>
<p>For example,</p>
<p>char.msg(“%s falls on <a href="#id1"><span class="problematic" id="id2">|</span></a>p face with a thud.” % char.key)
“Tom falls on his face with a thud”</p>
<p>The default gender is “ambiguous” (they/them/their/theirs).</p>
<p>To use, have DefaultCharacter inherit from this, or change
setting.DEFAULT_CHARACTER to point to this class.</p>
<p>The <strong>&#64;gender</strong> command is used to set the gender. It needs to be added to the
default cmdset before it becomes available.</p>
<dl class="py class">
<dt id="evennia.contrib.gendersub.SetGender">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.gendersub.</code><code class="sig-name descname">SetGender</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/contrib/gendersub.html#SetGender"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.gendersub.SetGender" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.commands.command.html#evennia.commands.command.Command" title="evennia.commands.command.Command"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.command.Command</span></code></a></p>
<p>Sets gender on yourself</p>
<dl class="simple">
<dt>Usage:</dt><dd><p>&#64;gender male||female||neutral||ambiguous</p>
</dd>
</dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.key">
<code class="sig-name descname">key</code><em class="property"> = '&#64;gender'</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;sex']</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:all();call:all()'</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.contrib.gendersub.SetGender.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/contrib/gendersub.html#SetGender.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.func" title="Permalink to this definition"></a></dt>
<dd><p>Implements the command.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();call:all()'</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.gendersub.GenderCharacter">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.gendersub.</code><code class="sig-name descname">GenderCharacter</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <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/contrib/gendersub.html#GenderCharacter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter" title="evennia.objects.objects.DefaultCharacter"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultCharacter</span></code></a></p>
<p>This is a Character class aware of gender.</p>
<dl class="py method">
<dt id="evennia.contrib.gendersub.GenderCharacter.at_object_creation">
<code class="sig-name descname">at_object_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/gendersub.html#GenderCharacter.at_object_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.at_object_creation" title="Permalink to this definition"></a></dt>
<dd><p>Called once when the object is created.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.gendersub.GenderCharacter.msg">
<code class="sig-name descname">msg</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">text</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">from_obj</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">session</span><span class="o">=</span><span class="default_value">None</span></em>, <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/contrib/gendersub.html#GenderCharacter.msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.msg" title="Permalink to this definition"></a></dt>
<dd><p>Emits something to a session attached to the object.
Overloads the default msg() implementation to include
gender-aware markers in output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<em>str</em><em> or </em><em>tuple</em><em>, </em><em>optional</em>) The message to send. This
is treated internally like any send-command, so its
value can be a tuple if sending multiple arguments to
the <strong>text</strong> oob command.</p></li>
<li><p><strong>from_obj</strong> (<em>obj</em><em>, </em><em>optional</em>) object that is sending. If
given, at_msg_send will be called</p></li>
<li><p><strong>session</strong> (<a class="reference internal" href="evennia.server.session.html#evennia.server.session.Session" title="evennia.server.session.Session"><em>Session</em></a><em> or </em><em>list</em><em>, </em><em>optional</em>) session or list of
sessions to relay to, if any. If set, will
force send regardless of MULTISESSION_MODE.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<p><strong>at_msg_receive</strong> will be called on this Object.
All extra kwargs will be passed on to the protocol.</p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.gendersub.GenderCharacter.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter.DoesNotExist" title="evennia.objects.objects.DefaultCharacter.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultCharacter.DoesNotExist</span></code></a></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.gendersub.GenderCharacter.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned" title="evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned</span></code></a></p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.GenderCharacter.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.gendersub.GenderCharacter'</em><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.GenderCharacter.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'GenderCharacter'</em><a class="headerlink" href="#evennia.contrib.gendersub.GenderCharacter.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<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>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.contrib.gendersub.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li><a href="http://webchat.freenode.net/?channels=evennia&uio=MT1mYWxzZSY5PXRydWUmMTE9MTk1JjEyPXRydWUbb">IRC</a> -
<a href="https://discord.gg/NecFePw">Discord</a> -
<a href="https://groups.google.com/forum/#%21forum/evennia">Forums</a>
</li>
<li><a href="http://evennia.blogspot.com/">Evennia Dev blog</a> </li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="../../1.0-dev/index.html">1.0-dev (develop branch)</a></li>
<li><a href="evennia.contrib.gendersub.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></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="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.contrib.gendersub</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>