<liclass="toctree-l3"><aclass="reference internal"href="../setup-tools.html#get-the-mobase-stubs">1. Get the <codeclass="docutils literal notranslate"><spanclass="pre">mobase</span></code> stubs</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="../setup-tools.html#configure-visual-studio-code-for-mobase">2. Configure Visual Studio Code for <codeclass="docutils literal notranslate"><spanclass="pre">mobase</span></code></a></li>
<liclass="toctree-l3"><aclass="reference internal"href="../setup-tools.html#configure-mypy-to-find-the-mobase-stubs">3. Configure <codeclass="docutils literal notranslate"><spanclass="pre">mypy</span></code> to find the <codeclass="docutils literal notranslate"><spanclass="pre">mobase</span></code> stubs</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../faq.html#why-is-mo2-throwing-an-exception-when-i-try-to-create-a-type-inheriting-one-of-mo2-class">1. Why is MO2 throwing an exception when I try to create a type inheriting one of MO2 class?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../faq.html#how-can-i-be-sure-to-implement-all-the-required-methods-when-creating-a-plugin">2. How can I be sure to implement all the required methods when creating a plugin?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../faq.html#why-are-my-isinstance-x-qobject-and-isinstance-y-qwidget-not-working">3. Why are my <codeclass="docutils literal notranslate"><spanclass="pre">isinstance(x,</span><spanclass="pre">QObject)</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">isinstance(y,</span><spanclass="pre">QWidget)</span></code> not working?</a></li>
<h1>IModInterface<aclass="headerlink"href="#imodinterface"title="Permalink to this headline">¶</a></h1>
<dlclass="class">
<dtid="mobase.IModInterface">
<emclass="property">class </em><codeclass="sig-prename descclassname">mobase.</code><codeclass="sig-name descname">IModInterface</code><aclass="headerlink"href="#mobase.IModInterface"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">absolutePath</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.absolutePath"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>Absolute path to the mod to be used in file system operations.</p>
<codeclass="sig-name descname">addCategory</code><spanclass="sig-paren">(</span><emclass="sig-param">name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.addCategory"title="Permalink to this definition">¶</a></dt>
<dd><p>Assign a category to the mod. If the named category does not exist it is created.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>name</strong>– Name of the new category to assign.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="mobase.IModInterface.addNexusCategory">
<codeclass="sig-name descname">addNexusCategory</code><spanclass="sig-paren">(</span><emclass="sig-param">category_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.addNexusCategory"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the category id from a nexus category id. Conversion to MO ID happens internally.</p>
<p>If a mapping is not possible, the category is set to the default value.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>category_id</strong>– The Nexus category ID.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="mobase.IModInterface.categories">
<codeclass="sig-name descname">categories</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.categories"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">clearPluginSettings</code><spanclass="sig-paren">(</span><emclass="sig-param">plugin_name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.clearPluginSettings"title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all the settings of the specified plugin this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>plugin_name</strong>– Name of the plugin for which settings should be removed. This should always be <cite>IPlugin.name()</cite>
unless you have a really good reason to access settings of another plugin.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The old settings from the given plugin, as returned by <cite>pluginSettings()</cite>.</p>
<codeclass="sig-name descname">color</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.color"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The color of the ‘Notes’ column chosen by the user.</p>
<codeclass="sig-name descname">comments</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.comments"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The comments for this mod, if any.</p>
<codeclass="sig-name descname">converted</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.converted"title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the mod was marked as converted by the user.</p>
<p>When a mod is for a different game, a flag is shown to users to warn them, but
they can mark mods as converted to remove this flag.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if this mod was marked as converted by the user.</p>
<codeclass="sig-name descname">endorsedState</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.endorsedState"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The endorsement state of this mod.</p>
<codeclass="sig-name descname">fileTree</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.fileTree"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve a file tree corresponding to the underlying disk content of this mod.</p>
<p>The file tree should not be cached by plugins since it is already and updated when
required.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>A file tree representing the content of this mod.</p>
<codeclass="sig-name descname">gameName</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.gameName"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the short name of the game associated with this mod. This may differ
from the current game plugin (e.g. you can install a Skyrim LE game in a SSE
installation).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The name of the game associated with this mod.</p>
<codeclass="sig-name descname">ignoredVersion</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.ignoredVersion"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The ignored version of this mod (for update), or an invalid version if the user</p>
<codeclass="sig-name descname">installationFile</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.installationFile"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The absolute path to the file that was used to install this mod.</p>
<codeclass="sig-name descname">isBackup</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.isBackup"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if this mod represents a backup.</p>
<codeclass="sig-name descname">isForeign</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.isForeign"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if this mod represents a foreign mod, not managed by MO2.</p>
<codeclass="sig-name descname">isOverwrite</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.isOverwrite"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if this mod represents the overwrite mod.</p>
<codeclass="sig-name descname">isSeparator</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.isSeparator"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if this mod represents a separator.</p>
<codeclass="sig-name descname">name</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.name"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">newestVersion</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.newestVersion"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">nexusId</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.nexusId"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The Nexus ID of this mod.</p>
<codeclass="sig-name descname">notes</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.notes"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The notes for this mod, if any.</p>
<codeclass="sig-name descname">pluginSetting</code><spanclass="sig-paren">(</span><emclass="sig-param">plugin_name</em>, <emclass="sig-param">key</em>, <emclass="sig-param">default=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.pluginSetting"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the specified setting in this mod for a plugin.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>plugin_name</strong>– Name of the plugin for which to retrieve a setting. This should always be <cite>IPlugin.name()</cite>
unless you have a really good reason to access settings of another plugin.</p></li>
<li><p><strong>key</strong>– Identifier of the setting.</p></li>
<li><p><strong>default</strong>– The default value to return if the setting does not exist.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The setting, if found, or the default value.</p>
<codeclass="sig-name descname">pluginSettings</code><spanclass="sig-paren">(</span><emclass="sig-param">plugin_name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.pluginSettings"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the settings in this mod for a plugin.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>plugin_name</strong>– Name of the plugin for which to retrieve settings. This should always be <cite>IPlugin.name()</cite>
unless you have a really good reason to access settings of another plugin.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>A map from setting key to value. The map is empty if there are not settings for this mod.</p>
<codeclass="sig-name descname">primaryCategory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.primaryCategory"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The ID of the primary category of this mod.</p>
<codeclass="sig-name descname">removeCategory</code><spanclass="sig-paren">(</span><emclass="sig-param">name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.removeCategory"title="Permalink to this definition">¶</a></dt>
<dd><p>Unassign a category from this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>name</strong>– Name of the category to remove.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>True if the category was removed, False otherwise (e.g. if no such category</p>
<codeclass="sig-name descname">repository</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.repository"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The name of the repository from which this mod was installed.</p>
<codeclass="sig-name descname">setGameName</code><spanclass="sig-paren">(</span><emclass="sig-param">name</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setGameName"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the source game of this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>name</strong>– The new source game short name of this mod.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="mobase.IModInterface.setIsEndorsed">
<codeclass="sig-name descname">setIsEndorsed</code><spanclass="sig-paren">(</span><emclass="sig-param">endorsed</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setIsEndorsed"title="Permalink to this definition">¶</a></dt>
<dd><p>Set endorsement state of the mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>endorsed</strong>– New endorsement state of this mod.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="mobase.IModInterface.setNewestVersion">
<codeclass="sig-name descname">setNewestVersion</code><spanclass="sig-paren">(</span><emclass="sig-param">version</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setNewestVersion"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the latest known version of this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>version</strong>– The latest known version of this mod.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="mobase.IModInterface.setNexusID">
<codeclass="sig-name descname">setNexusID</code><spanclass="sig-paren">(</span><emclass="sig-param">nexus_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setNexusID"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the Nexus ID of this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>nexus_id</strong>– Thew new Nexus ID of this mod.</p>
<codeclass="sig-name descname">setPluginSetting</code><spanclass="sig-paren">(</span><emclass="sig-param">plugin_name</em>, <emclass="sig-param">key</em>, <emclass="sig-param">value</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setPluginSetting"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the specified setting in this mod for a plugin.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>plugin_name</strong>– Name of the plugin for which to retrieve a setting. This should always be <cite>IPlugin.name()</cite>
unless you have a really good reason to access settings of another plugin.</p></li>
<li><p><strong>key</strong>– Identifier of the setting.</p></li>
<li><p><strong>value</strong>– New value for the setting to set.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>True if the setting was set correctly, False otherwise.</p>
<codeclass="sig-name descname">setUrl</code><spanclass="sig-paren">(</span><emclass="sig-param">url</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setUrl"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the URL of this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>url</strong>– The URL of this mod.</p>
<codeclass="sig-name descname">setVersion</code><spanclass="sig-paren">(</span><emclass="sig-param">version</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.setVersion"title="Permalink to this definition">¶</a></dt>
<dd><p>Set the version of this mod.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>version</strong>– The new version of this mod.</p>
<codeclass="sig-name descname">trackedState</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.trackedState"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The tracked state of this mod.</p>
<codeclass="sig-name descname">url</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.url"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The URL of this mod, or an empty QString() if no URL is associated</p>
<codeclass="sig-name descname">validated</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.validated"title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the mod was marked as validated by the user.</p>
<p>MO2 uses ModDataChecker to check the content of mods, but sometimes these fail, in
which case mods are incorrectly marked as ‘not containing valid games data’. Users can
choose to mark these mods as valid to hide the warning / flag.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>True if th is mod was marked as containing valid game data.</p>
<codeclass="sig-name descname">version</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#mobase.IModInterface.version"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The current version of this mod.</p>