<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>home</strong> (<em>Object</em><em> or </em><em>str</em>) – Obj or #dbref to use as the object’s
home location.</p></li>
<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>report_to</strong> (<em>Object</em>) – The object to return error messages to.</p></li>
<li><p><strong>nohome</strong> (<em>bool</em>) – This allows the creation of objects without a
default home location; only used when creating the default
location itself or during unittests.</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).
to set as Attributes on the new object.</p></li>
<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>
</dd>
<dtclass="field-odd">Raises</dt>
<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>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>script (obj)</em>– An instance of the script created</p>
</dd>
</dl>
<p>See evennia.scripts.manager for methods to manipulate existing
<dd><p>Create a new communication Msg. Msgs represent a unit of
database-persistent communication between entites.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>senderobj</strong> (<em>Object</em><em> or </em><em>Account</em>) – The entity sending the Msg.</p></li>
<li><p><strong>message</strong> (<em>str</em>) – Text with the message. Eventual headers, titles
etc should all be included in this text string. Formatting
will be retained.</p></li>
<li><p><strong>channels</strong> (<em>Channel</em><em>, </em><em>key</em><em> or </em><em>list</em>) – A channel or a list of channels to
send to. The channels may be actual channel objects or their
unique key strings.</p></li>
<li><p><strong>receivers</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>str</em><em> or </em><em>list</em>) – An Account/Object to send
to, or a list of them. May be Account objects or accountnames.</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>) – 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>