<spanid="evennia-utils-create"></span><h1>evennia.utils.create<aclass="headerlink"href="#module-evennia.utils.create"title="Permalink to this headline">¶</a></h1>
<li><p><strong>permissions</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – A list of permission strings or tuples (permstring, category).</p></li>
<li><p><strong>locks</strong> (<em>str</em>) – one or more lockstrings, separated by semicolons.</p></li>
<li><p><strong>aliases</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – A list of alternative keys or tuples (aliasstring, category).</p></li>
<li><p><strong>tags</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List of tag keys or tuples (tagkey, category) or (tagkey, category, data).</p></li>
<li><p><strong>attributes</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – Tuples on the form (key, value) or (key, value, category),
(key, value, lockstring) or (key, value, lockstring, default_access).
<li><p><strong>nattributes</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – Non-persistent tuples on the form (key, value). Note that
adding this rarely makes sense since this data will not survive a reload.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>object (Object)</em>– A newly created object of the given typeclass.</p>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.objects.models.html#evennia.objects.models.ObjectDB.DoesNotExist"title="evennia.objects.models.ObjectDB.DoesNotExist"><strong>ObjectDB.DoesNotExist</strong></a>– If trying to create an Object with
<strong>location</strong> or <strong>home</strong> that can’t be found.</p>
<dd><p>Create a new script. All scripts are a combination of a database
object that communicates with the database, and an typeclass that
‘decorates’ the database object into being different types of
scripts. It’s behaviour is similar to the game objects except
scripts has a time component and are more limited in scope.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>typeclass</strong> (<em>class</em><em> or </em><em>str</em>) – Class or python path to a typeclass.</p></li>
<li><p><strong>key</strong> (<em>str</em>) – Name of the new object. If not set, a name of
#dbref will be set.</p></li>
<li><p><strong>obj</strong> (<em>Object</em>) – The entity on which this Script sits. If this
is <strong>None</strong>, we are creating a “global” script.</p></li>
<li><p><strong>account</strong> (<em>Account</em>) – The account on which this Script sits. It is
exclusiv to <strong>obj</strong>.</p></li>
<li><p><strong>locks</strong> (<em>str</em>) – one or more lockstrings, separated by semicolons.</p></li>
<li><p><strong>interval</strong> (<em>int</em>) – The triggering interval for this Script, in
seconds. If unset, the Script will not have a timing
component.</p></li>
<li><p><strong>start_delay</strong> (<em>bool</em>) – If <strong>True</strong>, will wait <strong>interval</strong> seconds
before triggering the first time.</p></li>
<li><p><strong>repeats</strong> (<em>int</em>) – The number of times to trigger before stopping.
If unset, will repeat indefinitely.</p></li>
<li><p><strong>persistent</strong> (<em>bool</em>) – If this Script survives a server shutdown
or not (all Scripts will survive a reload).</p></li>
<li><p><strong>autostart</strong> (<em>bool</em>) – If this Script will start immediately when
created or if the <strong>start</strong> method must be called explicitly.</p></li>
<li><p><strong>report_to</strong> (<em>Object</em>) – The object to return error messages to.</p></li>
<li><p><strong>desc</strong> (<em>str</em>) – Optional description of script</p></li>
<li><p><strong>tags</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List of tags or tuples (tag, category).</p></li>
<li><p><strong>attributes</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List if tuples (key, value) or (key, value, category)
(key, value, lockstring) or (key, value, lockstring, default_access).</p></li>
<li><p><strong>receivers</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>Script</em><em>, </em><em>str</em><em> or </em><em>list</em>) – An Account/Object to send
to, or a list of them. If a string, it’s an identifier for an external
<li><p><strong>tags</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – A list of tags or tuples <strong>(tag, category)</strong>.</p></li>
<li><p><strong>key</strong> (<em>str</em>) – The account’s name. This should be unique.</p></li>
<li><p><strong>email</strong> (<em>str</em><em> or </em><em>None</em>) – Email on valid <aclass="reference external"href="mailto:addr%40addr.domain">addr<span>@</span>addr<span>.</span>domain</a> form. If
the empty string, will be set to None.</p></li>
<li><p><strong>password</strong> (<em>str</em>) – Password in cleartext.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>typeclass</strong> (<em>str</em>) – The typeclass to use for the account.</p></li>
<li><p><strong>is_superuser</strong> (<em>bool</em>) – Wether or not this account is to be a superuser</p></li>
<li><p><strong>permission</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List of permission strings.</p></li>
<li><p><strong>tags</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List of Tags on form <strong>(key, category[, data])</strong></p></li>
<li><p><strong>attributes</strong> (<aclass="reference internal"href="evennia.contrib.barter.html#evennia.contrib.barter.TradeHandler.list"title="evennia.contrib.barter.TradeHandler.list"><em>list</em></a>) – List of Attributes on form
<strong>(key, value [, category, [,lockstring [, default_pass]]])</strong></p></li>
<li><p><strong>report_to</strong> (<em>Object</em>) – An object with a msg() method to report
errors to. If not given, errors will be logged.</p></li>
</ul>
</dd>
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>Account</em>– The newly created Account.</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>ValueError</strong>– If <strong>key</strong> already exists in database.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Usually only the server admin should need to be superuser, all
other access levels can be handled with more fine-grained
permissions or groups. A superuser bypasses all lock checking
operations and is thus not suitable for play-testing the game.</p>