<spanid="evennia-utils-optionclasses"></span><h1>evennia.utils.optionclasses<aclass="headerlink"href="#module-evennia.utils.optionclasses"title="Permalink to this headline">¶</a></h1>
<dlclass="py class">
<dtid="evennia.utils.optionclasses.BaseOption">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.optionclasses.</code><codeclass="sig-name descname">BaseOption</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">handler</span></em>, <emclass="sig-param"><spanclass="n">key</span></em>, <emclass="sig-param"><spanclass="n">description</span></em>, <emclass="sig-param"><spanclass="n">default</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">handler</span></em>, <emclass="sig-param"><spanclass="n">key</span></em>, <emclass="sig-param"><spanclass="n">description</span></em>, <emclass="sig-param"><spanclass="n">default</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.__init__"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>handler</strong> (<aclass="reference internal"href="evennia.utils.optionhandler.html#evennia.utils.optionhandler.OptionHandler"title="evennia.utils.optionhandler.OptionHandler"><em>OptionHandler</em></a>) – The OptionHandler that ‘owns’ this Option.</p></li>
<li><p><strong>key</strong> (<em>str</em>) – The name this will be used for storage in a dictionary.
Must be unique per OptionHandler.</p></li>
<li><p><strong>description</strong> (<em>str</em>) – What this Option’s text will show in commands and menus.</p></li>
<li><p><strong>default</strong>– A default value for this Option.</p></li>
<emclass="property">property </em><codeclass="sig-name descname">changed</code><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.changed"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">default</code><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.default"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">value</code><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.value"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">set</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.set"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.set"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes user input and stores appropriately. This method allows for
passing extra instructions into the validator.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – The new value of this Option.</p></li>
<li><p><strong>kwargs</strong> (<em>any</em>) – Any kwargs will be passed into
<strong>self.validate(value, **kwargs)</strong> and <strong>self.save(**kwargs)</strong>.</p></li>
<codeclass="sig-name descname">load</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.load"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.load"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes the provided save data, validates it, and gets this Option ready to use.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>Boolean</em>– Whether loading was successful.</p>
<codeclass="sig-name descname">save</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.save"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.save"title="Permalink to this definition">¶</a></dt>
<dd><p>Stores the current value using <strong>.handler.save_handler(self.key, value, **kwargs)</strong>
where <strong>kwargs</strong> are a combination of those passed into this function and
the ones specified by the <strong>OptionHandler</strong>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>any</strong> (<em>any</em>) – Not used by default. These are passed in from self.set
and allows the option to let the caller customize saving by
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">serialize</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.serialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.serialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the save data for Attribute storage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>any (any)</em>– Whatever is best for storage.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">display</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span>→ str<aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#BaseOption.display"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.BaseOption.display"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Text.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Text.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Email.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Email.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Email.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Email.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Boolean.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Boolean.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">display</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Boolean.display"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Boolean.display"title="Permalink to this definition">¶</a></dt>
<dd><p>Renders the Option’s value as something pretty to look at.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>any</strong> (<em>any</em>) – These are options passed by the caller to potentially
customize display dynamically.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><p><em>str</em>–</p>
<dlclass="simple">
<dt>How the stored value should be projected to users (e.g. a raw</dt><dd><p>timedelta is pretty ugly).</p>
<codeclass="sig-name descname">serialize</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Boolean.serialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Boolean.serialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the save data for Attribute storage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>any (any)</em>– Whatever is best for storage.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Boolean.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Boolean.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Color.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Color.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">display</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Color.display"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Color.display"title="Permalink to this definition">¶</a></dt>
<dd><p>Renders the Option’s value as something pretty to look at.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>any</strong> (<em>any</em>) – These are options passed by the caller to potentially
customize display dynamically.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><p><em>str</em>–</p>
<dlclass="simple">
<dt>How the stored value should be projected to users (e.g. a raw</dt><dd><p>timedelta is pretty ugly).</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Color.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Color.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Timezone.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Timezone.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<emclass="property">property </em><codeclass="sig-name descname">default</code><aclass="headerlink"href="#evennia.utils.optionclasses.Timezone.default"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Timezone.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Timezone.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">serialize</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Timezone.serialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Timezone.serialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the save data for Attribute storage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>any (any)</em>– Whatever is best for storage.</p>
<codeclass="sig-name descname">validator_key</code><emclass="property"> = 'unsigned_integer'</em><aclass="headerlink"href="#evennia.utils.optionclasses.UnsignedInteger.validator_key"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#UnsignedInteger.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.UnsignedInteger.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#UnsignedInteger.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.UnsignedInteger.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#SignedInteger.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.SignedInteger.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#SignedInteger.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.SignedInteger.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#PositiveInteger.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.PositiveInteger.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#PositiveInteger.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.PositiveInteger.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Duration.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Duration.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Duration.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Duration.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">serialize</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Duration.serialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Duration.serialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the save data for Attribute storage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>any (any)</em>– Whatever is best for storage.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.optionclasses.Datetime">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.optionclasses.</code><codeclass="sig-name descname">Datetime</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">handler</span></em>, <emclass="sig-param"><spanclass="n">key</span></em>, <emclass="sig-param"><spanclass="n">description</span></em>, <emclass="sig-param"><spanclass="n">default</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Datetime"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Datetime"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Datetime.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Datetime.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
<codeclass="sig-name descname">deserialize</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">save_data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Datetime.deserialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Datetime.deserialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Perform sanity-checking on the save data as it is loaded from storage.
This isn’t the same as what validator-functions provide (those work on
user input). For example, save data might be a timedelta or a list or
some other object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>save_data</strong>– The data to check.</p>
<codeclass="sig-name descname">serialize</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Datetime.serialize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Datetime.serialize"title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the save data for Attribute storage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>any (any)</em>– Whatever is best for storage.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.optionclasses.Future">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.optionclasses.</code><codeclass="sig-name descname">Future</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">handler</span></em>, <emclass="sig-param"><spanclass="n">key</span></em>, <emclass="sig-param"><spanclass="n">description</span></em>, <emclass="sig-param"><spanclass="n">default</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Future"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Future"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Future.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Future.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.optionclasses.Lock">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.optionclasses.</code><codeclass="sig-name descname">Lock</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">handler</span></em>, <emclass="sig-param"><spanclass="n">key</span></em>, <emclass="sig-param"><spanclass="n">description</span></em>, <emclass="sig-param"><spanclass="n">default</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Lock"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Lock"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">validate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">value</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/optionclasses.html#Lock.validate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.optionclasses.Lock.validate"title="Permalink to this definition">¶</a></dt>
<dd><p>Validate user input, which is presumed to be a string.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>value</strong> (<em>str</em>) – User input.</p></li>
<li><p><strong>account</strong> (<aclass="reference internal"href="evennia.accounts.models.html#evennia.accounts.models.AccountDB"title="evennia.accounts.models.AccountDB"><em>AccountDB</em></a>) – The Account that is performing the validation.
This is necessary because of other settings which may affect the
check, such as an Account’s timezone affecting how their datetime
entries are processed.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>any (any)</em>– The results of the validation.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.prototypes.prototypes.html#evennia.prototypes.prototypes.ValidationError"title="evennia.prototypes.prototypes.ValidationError"><strong>ValidationError</strong></a>– If input value failed validation.</p>