1. Why is MO2 throwing an exception when I try to create a type inheriting one of MO2 class?

2. How can I be sure to implement all the required methods when creating a plugin?

gameDependency() (mobase.PluginRequirementFactory static method)

pluginDependency() (mobase.PluginRequirementFactory static method)

Union[InstallResult, IFileTree, tuple[InstallResult, IFileTree, str, int]]

Retrieve the file version of the given executable.

Args:
    filepath: Absolute path to the executable.

Returns:
    The file version, or an empty string if the file version could not be retrieved.

Retrieve the icon of an executable. Currently this always extracts the biggest icon.

Args:
    executable: Absolute path to the executable.

Returns:
    The icon for this executable, if any.

Retrieve the product version of the given executable.

Args:

Returns:
    The product version, or an empty string if the product version could not be retrieved.

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

- attribute access:

  >>> Color.RED
  <Color.RED: 1>

- value lookup:

  >>> Color(1)

- name lookup:

  >>> Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3

>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own
attributes -- see the documentation for details.

Generate the next value when not given.

name: the name of the member
start: the initial start value or None
count: the number of existing members
last_values: the list of values assigned

Describes how good the code considers a guess (i.e. for a mod name) this is used to
determine if a name from another source should overwrite or not.

Represent an entry in a file tree, either a file or a directory. This class
inherited by IFileTree so that operations on entry are the same for a file or
a directory.

This class provides convenience methods to query information on the file, like its
name or the its last modification time. It also provides a convenience astree() method
that can be used to retrieve the tree corresponding to its entry in case the entry
represent a directory.

Detach this entry from its parent tree.

Returns:
    True if the entry was removed correctly, False otherwise.

Check if this entry has the given suffix.

Args:
    suffix: Suffix to check.

Returns:
    True if this entry is a file and has the given suffix.

Returns:
    True if this entry is a directory, False otherwise.

Move this entry to the given tree.

Args:
    tree: The tree to move this entry to.

Returns:
    True if the entry was moved correctly, False otherwise.

Returns:
    The parent tree containing this entry, or a `None` if this entry is the root
or the parent tree is unreachable.

Retrieve the path from this entry up to the root of the tree.

This method propagate up the tree so is not constant complexity as
the full path is never stored.

Args:
    sep: The type of separator to use to create the path.

Returns:
    The path from this entry to the root, including the name of this entry.

Retrieve the path from the given tree to this entry.

Args:
    tree: The tree to reach, must be a parent of this entry.

Returns:
    The path from the given tree to this entry, including the name of this entry, or
an empty string if the given tree is not a parent of this entry.

Retrieve the "last" extension of this entry.

The "last" extension is everything after the last dot in the file name.

Returns:
    The last extension of this entry, or an empty string if the file has no extension
or is directory.

Base class for all game features, cannot be inherited, used only for typing
purpose in Python.

Helper class that provides a standard way to create an ABC using
inheritance.

Represents a string that may be set from different places. Each time the value is
changed a "quality" is specified to say how probable it is the value is the best choice.
Only the best choice should be used in the end but alternatives can be queried. This
class also allows a filter to be set. If a "guess" doesn't pass the filter, it is ignored.

Creates a GuessedString with the given value and quality.

Args:
    value: Initial value of the GuessedString.
    quality: Quality of the initial value.

Reset this GuessedString object by copying the given one, only
if the given one has better quality.

Args:
    other: The GuessedString to copy.

Returns:
    This GuessedString object.

Set the filter for this GuessedString.

The filter is applied on every `update()` and can reject the new value
altogether or modify it (by returning a new value).

Args:
    filter: The new filter.

Update this GuessedString by adding a new variants with the given quality.

If the specified quality is better than the current one, the actual value of
the GuessedString is also updated.

The GuessedString is only updated if the given value passes the filter.

Args:
    value: The new variant to add.
    quality: The quality of the variant.

Returns:

Retrieve the (absolute) path of the specified download.

Args:
    id: ID of the download.

Returns:
    The absolute path to the file corresponding to the given download. This file
may not exist yet if the download is incomplete.

Installs a handler to be called when a download completes.

Args:
    callback: The function to be called when a download complete. The parameter is the download ID.

Returns:
    True if the handler was installed properly (there are currently no reasons for this to fail).

Installs a handler to be called when a download fails.

Args:
    callback: The function to be called when a download fails. The parameter is the download ID.

Returns:

Installs a handler to be called when a download is paused.

Args:
    callback: The function to be called when a download is paused. The parameter is the download ID.

Returns:

Installs a handler to be called when a download is removed.

Args:
    callback: The function to be called when a download is removed. The parameter is the download ID.

Returns:

Download a file from www.nexusmods.com/<game>. <game> is always the game
currently being managed.

Args:
    mod_id: ID of the mod to download the file from.
    file_id: ID of the file to download.

Returns:
    An ID identifying the download.

Download a file by url.

The list can contain alternative URLs to allow the download manager to switch
in case of download problems

Args:
    urls: List of urls to download from.

Returns:

Interface for the game features, accessible through IOrganizer.gameFeatures().

Retrieve the given game feature, if one exists.

Args:
    feature_type: The class of feature to retrieve.

Returns:
    The game feature corresponding to the given type, or `None` if the feature is
not available.

Register game feature for all games.

This method register a game feature to combine or replace with other features
of the same kind. Some features are merged (e.g., ModDataContent,
ModDataChecker), while other override previous features (e.g., SaveGameInfo).

For features that can be combined, the priority argument indicates the order of
priority (e.g., the order of the checks for ModDataChecker). For other features,
the feature with the highest priority will be used. The features provided by the
game plugin itself always have lowest priority.

The feature is associated to the plugin that registers it, if the plugin is
disabled, the feature will not be available.

This function will return True if the feature was registered, even if the
feature is not used du to its low priority.

Args:
    feature: Game feature to register.
    priority: Priority of the game feature. If the plugin registering the feature
        is a game plugin, this parameter is ignored.
    replace: If True, remove features of the same kind registered by the current plugin,
        otherwise add the feature alongside existing ones.

Returns:
    True if the game feature was properly registered, False otherwise.

Unregister the given game feature.

This function is safe to use even if the given feature was never registered.

Args:
    feature: Feature to unregister.

Returns:
    True if the feature was successfully unregistered, False otherwise.

Unregister all features of the given type registered by the calling plugin.

This function is safe to use even if the plugin has no feature of the given type
register.

Args:
    feature_type: The class of feature to unregister.

Returns:
    The number of unregistered features.

Create a new file on the disk corresponding to the given entry.

This method can be used by installer that needs to create files that are not in the original
archive. At the end of the installation, if there are entries in the final tree that were used
to create files, the corresponding files will be moved to the mod folder.

Temporary files corresponding to created files are automatically cleaned up at the end of
the installation.

Args:
    entry: The entry for which a temporary file should be created.

Returns:
    The path to the created file, or an empty string if the file could not be created.

Extract the specified file from the currently opened archive to a temporary
location.

This method cannot be used to extract directory.

The call will fail with an exception if no archive is open (plugins deriving from
IPluginInstallerSimple can rely on that, custom installers should not). The temporary
file is automatically cleaned up after the installation. This call can be very slow
if the archive is large and "solid".

Args:
    entry: Entry corresponding to the file to extract.
    silent: If true, the dialog showing extraction progress will not be shown.

Returns:
    The absolute path to the temporary file, or an empty string if the file was not extracted.

Extract the specified files from the currently opened archive to a temporary
location.

This method cannot be used to extract directories.

files are automatically cleaned up after the installation. This call can be very slow

Args:
    entries: Entries corresponding to the files to extract.

Returns:
    A list containing absolute paths to the temporary files.

Returns:
    The extensions of archives supported by this installation manager.

Install the given archive.

Args:
    mod_name: Suggested name of the mod.
    archive: Path to the archive to install.
    mod_id: ID of the mod, if available.

Returns:
    The result of the installation.

Returns:
    Absolute path to the mod to be used in file system operations.

Assign a category to the mod. If the named category does not exist it is created.

Args:
    name: Name of the new category to assign.

Set the category id from a nexus category id. Conversion to MO ID happens internally.

If a mapping is not possible, the category is set to the default value.

Args:
    category_id: The Nexus category ID.

Remove all the settings of the specified plugin this mod.

Args:
    plugin_name: Name of the plugin for which settings should be removed. This should always be `IPlugin.name()`
        unless you have a really good reason to access settings of another plugin.

Returns:
    The old settings from the given plugin, as returned by `pluginSettings()`.

Returns:
    The color of the 'Notes' column chosen by the user.

Check if the mod was marked as converted by the user.

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.

Returns:
    True if this mod was marked as converted by the user.

Retrieve a file tree corresponding to the underlying disk content of this mod.

The file tree should not be cached by plugins since it is already and updated when
required.

Returns:
    A file tree representing the content of this mod.

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).

Returns:
    The name of the game associated with this mod.

Returns:
    The ignored version of this mod (for update), or an invalid version if the user
did not ignore version for this mod.

Returns:
    The absolute path to the file that was used to install this mod.

Returns:
    True if this mod represents a foreign mod, not managed by MO2.

Returns:
    The newest version of this mod (as known by MO2). If this matches version(),
then the mod is up-to-date.

Retrieve the specified setting in this mod for a plugin.

Args:
    plugin_name: Name of the plugin for which to retrieve a setting. This should always be `IPlugin.name()`
    key: Identifier of the setting.
    default: The default value to return if the setting does not exist.

Returns:
    The setting, if found, or the default value.

Retrieve the settings in this mod for a plugin.

Args:
    plugin_name: Name of the plugin for which to retrieve settings. This should always be `IPlugin.name()`

Returns:
    A map from setting key to value. The map is empty if there are not settings for this mod.

Unassign a category from this mod.

Args:
    name: Name of the category to remove.

Returns:
    True if the category was removed, False otherwise (e.g. if no such category
was assigned).

Returns:
    The name of the repository from which this mod was installed.

Set the source game of this mod.

Args:
    name: The new source game short name of this mod.

Set endorsement state of the mod.

Args:
    endorsed: New endorsement state of this mod.

Set the latest known version of this mod.

Args:
    version: The latest known version of this mod.

Set the Nexus ID of this mod.

Args:
    nexus_id: Thew new Nexus ID of this mod.

Set the specified setting in this mod for a plugin.

Args:
    value: New value for the setting to set.

Returns:
    True if the setting was set correctly, False otherwise.

Set the version of this mod.

Args:
    version: The new version of this mod.

Returns:
    The URL of this mod, or an empty QString() if no URL is associated
with this mod.

Check if the mod was marked as validated by the user.

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.

Returns:
    True if th is mod was marked as containing valid game data.

Interface to the mod-list.

All api functions in this interface work need the internal name of a mod to find a
mod. For regular mods (mods the user installed) the display name (as shown to the user)
and internal name are identical. For other mods (non-MO mods) there is currently no way
to translate from display name to internal name because the display name might not me un-ambiguous.

Returns:
    A list containing the internal names of all installed mods.

Returns:
    The list of mod (names), sorted according to the current profile priorities.

Retrieve the display name of a mod from its internal name.

If you received an internal name from the API (e.g. `IPluginList.origin`) then you should use
that name to identify the mod in all other api calls but use this function to retrieve the name
to show to the user.

Args:
    name: Internal name of the mod.

Returns:
    The display name of the given mod.

Retrieve an interface to a mod using its name.

Args:
    name: Name of the mod to retrieve.

Returns:
    An interface to the given mod, or `None` if there is no mod with this name.

Install a new handler to be called when a new mod is installed.

Args:
    callback: The function to call when a mod is installed. The parameter of the function is the name of the
        newly installed mod.

Returns:

Install a handler to be called when a mod is moved.

Args:
    callback: The function to call when a mod is moved. The first argument is the internal name of the
        mod, the second argument the old priority and the third argument the new priority.

Returns:

Install a new handler to be called when a mod is removed.

Args:
    callback: The function to call when a mod is removed. The parameter of the function is the name of the
        removed mod.

Returns:

Install a handler to be called when mod states change (enabled/disabled, endorsed, ...).

Args:
    callback: The function to call when the states of mod change. The argument is a map containing the
        mods whose states have changed. Keys are internal mod names and values are mod states.

Returns:

Retrieve the priority of a mod.

Args:

Returns:
    The priority of the given mod.

Remove a mod (from disc and from the UI).

Args:
    mod: The mod to remove.

Returns:
    True if the mod was removed, False otherwise.

Rename the given mod.

This method usually invalidates the given mod so you should use the returned value
after calling it instead of the passed value.

Args:
    mod: The mod to rename.
    name: The new name of the mod.

Returns:
    A valid reference to the given mod after renaming it.

Enable or disable a mod.

Calling this will cause MO to re-evaluate its virtual file system so this is
a fairly expensive call.

Args:
    name: Internal name of the mod to enable or disable.
    active: True to enable the mod, False to disable it.

Returns:
    True on success, False otherwise.

Change the priority of a mod.

`priority` is the new priority after the move. Keep in mind that the mod disappears from its
old location and all mods with higher priority than the moved mod decrease in priority by one.

Args:
    priority: The new priority of the mod.

Returns:
    True if the priority was changed, False otherwise (if the name or priority were invalid).

Retrieve the state of a mod.

Args:

Returns:
    The state of the given mod.

Interface to class that provides information about the running session
of Mod Organizer to be used by plugins.

Returns:
    The absolute path to the base directory of Mod Organizer.

Create a new mod with the specified name.

If a mod with the same name already exists, the user will be queried. If the user chooses
to merge or replace, the call will succeed, otherwise the call will fail.

Args:
    name: Name of the mod to create.

Returns:
    An interface to the newly created mod that can be used to modify it, or `None` if the mod
could not be created.

Create a new Nexus interface.

Returns:
    The newly created Nexus interface.

Find files in the virtual directory matching the specified filter.

Args:
    path: The path to search in (relative to the 'data' folder).
    filter: The function to use to filter files. Should return True for the files to keep.

Returns:
    The list of `QFileInfo` corresponding to the matching files.

Find files in the given folder that matches the given glob pattern.

Args:
    pattern: The glob pattern to use to filter files.

Returns:
    The list of matching files.

Retrieve the file origins for the specified file.

The origins are listed with their internal name. The internal name of a mod can differ
from the display name for disambiguation.

Args:
    filename: Path to the file to retrieve origins for (relative to the 'data' folder).

Returns:
    The list of origins that contain the specified file, sorted by their priority.

Retrieve the game plugin matching the given name.

Args:
    name: Name of the game (short name).

Returns:
    The plugin for the given game, or `None` if none was found.

Returns:
    The directory for plugin data, typically plugins/data.

Install a mod archive at the specified location.

Args:
    filename: Absolute filepath to the archive to install.
    name_suggestion: Suggested name for this mod. This can still be changed by the user.

Returns:
    An interface to the new installed mod, or `None` if no installation took place (canceled or failure).

Check if a plugin is enabled.

Args:
    plugin: The name of the plugin to check.

Returns:
    True if the plugin is enabled, False otherwise.

Retrieve the list of (virtual) subdirectories in the given path.

Args:
    directory: Path to the directory to list (relative to the 'data' folder).

Returns:
    The list of directories in the given directory.

Notify the organizer that the given mod has changed.

Args:
    mod: The mod that has changed.

Install a new handler to be called when an application is about to run.

Multiple handlers can be installed. If any of the handler returns `False`, the
application will not run.

Args:
    callback: The function to call when an application is about to run. The parameter
        is the absolute path to the application to run. The function can return False
        to prevent the application from running.

Returns:
    True if the handler was installed properly (there are currently no reasons for
this to fail).

Install a new handler to be called when an application has finished running.

Args:
    callback: The function to call when an application has finished running. The first parameter is the absolute
        path to the application, and the second parameter is the exit code of the application.

Returns:

Install a new handler to be called on the next refresh or immediately.

Args:
    callback: Function to call on the next refresh (or immediately).
    immediate_if_possible: If True, immediately run the callback if no refresh is currently running.

Returns:

Install a new handler to be called when the given plugin is disabled.

Args:
    name: Name of the plugin to watch.
    callback: The function to call when the plugin is disabled.

Install a new handler to be called when the given plugin is enabled.

Args:
    callback: The function to call when the plugin is enabled.

Install a new handler to be called when a plugin setting is changed.

Args:
    callback: The function to call when a plugin setting is changed. The parameters are: The name of the plugin, the
        name of the setting, the old value (or `None` if the setting did not exist before) and the new value
        of the setting (or `None` if the setting has been removed).

Returns:

Install a new handler to be called when the current profile is changed.

The function is called when the profile is changed but some operations related to
the profile might not be finished when this is called (e.g., the virtual file system
might not be up-to-date).

Args:
    callback: The function to call when the current profile is changed. The first parameter is the old profile (can
        be `None`, e.g. at startup), and the second parameter is the new profile (cannot be `None`).

Returns:

Install a new handler to be called when a new profile is created.

Args:
    callback: The function to call when a new profile is created. The parameter is the new profile (can be
        a temporary object and should not be stored).

Returns:

Install a new handler to be called when a profile is remove.

The callbacks are called after the profile has been removed so the profile is not accessible
anymore.

Args:
    callback: The function to call when a profile is remove. The parameter is the name of the profile that was
        removed.

Returns:

Install a new handler to be called when a profile is renamed.

Args:
    callback: The function to call when a profile is renamed. The first parameter is the profile being renamed,
        the second parameter the previous name and the third parameter the new name.

Returns:

Install a new handler to be called when the UI has been fully initialized.

Args:
    callback: The function to call when the user-interface has been fully initialized. The parameter is the main
        window of the application (`QMainWindow`).

Returns:

Retrieve the specified persistent value for a plugin.

A persistent is an arbitrary value that the plugin can set and retrieve that is persistently stored
by the main application. There is no UI for the user to change this value but they can directly access
the storage

Args:
    plugin_name: Name of the plugin for which to retrieve the value. This should always be `IPlugin.name()` unless you have a
        really good reason to access data of another mod AND if you can verify that plugin is actually installed.
    default: Default value to return if the key is not set (yet).

Returns:
    The value corresponding to the given persistent setting, or `def` is the key is not found.

Retrieve the path to a directory where plugin data should be stored.

For python plugins, it is recommended to use a dedicated folder (per plugin) if you need to
store data (resources, or multiple python files).

Returns:
    Path to a directory where plugin data should be stored.

Retrieve settings of plugins.

Args:
    plugin_name: Name of the plugin to retrieve the setting for.
    key: Name of the setting to retrieve the value for.

Returns:
    The value of the setting.

Returns:
    The name of the current profile, or an empty string if no profile has been loaded (yet).

Returns:
    The absolute path to the active profile or an empty string if no profile has been loaded (yet).

Refresh the internal mods file structure from disk. This includes the mod list, the plugin
list, data tab and other smaller things like problems button (same as pressing F5).

The main part of the refresh of the mods file structure, mod list and plugin list is done
asynchronously, so you should not expect them to be up-to-date when this function returns.

Args:
    save_changes: If True, the relevant profile information is saved first (enabled mods and order of mods).

Resolves a path relative to the virtual data directory to its absolute real path.

Args:
    filename: Path to resolve.

Returns:
    The absolute real path, or an empty string if the path was not found.

Set the specified persistent value for a plugin.

This does not update the in-memory value for this setting, see `setPluginSetting()` for this.

Args:
    plugin_name: Name of the plugin for which to change a value. This should always be `IPlugin.name()` unless you have a
    value: New value for the setting.
    sync: If True, the storage is immediately written to disc. This costs performance but is safer against data loss.

Set the specified setting for a plugin.

This automatically notify handlers register with `onPluginSettingChanged`, so you do not have to do it yourself.

Args:

Starts an application with virtual filesystem active.

Args:
    executable: Name or path of the executable. If this is only a filename, it will only work if it has been configured
        in MO as an executable. If it is a relative path it is expected to be relative to the game directory.
    args: Arguments to pass to the executable. If the list is empty, and `executable` refers to a configured executable,
        the configured arguments are used.
    cwd: The working directory for the executable. If this is empty, the path to the executable is used unless `executable`
        referred to a configured MO executable, in which case the configured cwd is used.
    profile: Profile to use. If this is empty (the default) the current profile is used.
    forcedCustomOverwrite: The mod to set as the custom overwrite, regardless of what the profile has configured.
    ignoreCustomOverwrite: Set to true to ignore the profile's configured custom overwrite.

Returns:
    The handle to the started application, or 0 if the application failed to start.

Retrieve a IFileTree object representing the virtual file tree.

Returns:
    An IFileTree representing the virtual file tree.

Wait for the application corresponding to the given handle to finish.

This will always show the lock overlay, regardless of whether the
user has disabled locking in the setting, so use this with care.
Note that the lock overlay will always allow the user to unlock, in
which case this will return False.

Args:
    handle: Handle of the application to wait for (as returned by `startApplication()`).
    refresh: Whether ModOrganizer should refresh after the process completed or not.

Returns:
    A tuple `(result, exitcode)`, where `result` is a boolean indicating if the application
completed successfully, and `exitcode` is the exit code of the application.

Check whether this plugin should be enabled by default.

Returns:
    True if this plugin should be enabled by default, False otherwise.

Initialize this plugin.

Note that this function may never be called if no `IOrganizer` is available
at that time, such as when creating the first instance in MO.

Plugins will probably want to store the organizer pointer. It is guaranteed
to be valid as long as the plugin is loaded.

These functions may be called before `init()`:

  - `name()`
  - see `IPluginGame` for more.

Args:
    organizer: The main organizer interface.

Returns:
    True if the plugin was initialized correctly, False otherwise.

Retrieve the localized name of the plugin.

Unlike `name()`, this method can (and should!) return a localized name for the plugin.
This method returns name() by default.

Returns:
    The localized name of the plugin.

Retrieve the master plugin of this plugin.

It is often easier to implement a functionality as multiple plugins in MO2, but ship the
plugins together, e.g. as a Python module or using `createFunctions()`. In this case, having
a master plugin (one of the plugin, or a separate one) tells MO2 that these plugins are
linked and should also be displayed together in the UI. If MO2 ever implements automatic
updates for plugins, the `master()` plugin will also be used for this purpose.

Returns:
    The master plugin of this plugin, or a null pointer if this plugin does not have a master.

Retrieve the name of the plugin.

The name of the plugin is used for internal storage purpose so it should not change,
and it should be static. In particular, you should not use a localized string (`tr()`)
for the plugin name.

In the future, we will provide a way to localized plugin names using a distinct method,
such as `localizedName()`.

Returns:
    The name of the plugin.

Retrieve the requirements for this plugin.

This method is called right after `init()` and the ownership the requirements is

Returns:
    The list of requirements for this plugin.

Determine if a plugin has a .esl extension.

Args:
    name: Filename of the plugin (without path but with file extension).

Returns:
    True if the given file has a .esl extension, False otherwise or if the
file does not exist.

Determine if a plugin has a .esm extension.

Args:

Returns:
    True if the given file has a .esm extension, False otherwise or if the

Determine if a plugin has no records.

Args:

Returns:
    True if the given file plugin contains no records, False if it does OR if the

Determine if a plugin is flagged as light.

In gamebryo games, a master file will usually have a .esl file extension but
technically an esp can be flagged as light.

Args:

Returns:
    True if the given plugin is a light plugin, False otherwise or if the

Determine if a plugin is flagged as mater, i.e., a library, reference by
other plugins.

In gamebryo games, a master file will usually have a .esm file extension but
technically an esp can be flagged as master and an esm might not be.

Args:

Returns:
    True if the given plugin is a master plugin, False otherwise or if the

Determine if a plugin is flagged as medium.

This plugin flag was added in Starfield and signifies plugin records that
update existing records

Args:

Returns:
    True if the given plugin is a medium plugin, False otherwise or if the

Retrieve the load order of a plugin.

Args:

Returns:
    The load order of the plugin (the order in which the game loads it). If all plugins are enabled this
is the same as the priority but disabled plugins will have a load order of -1. This also returns -1
if the plugin does not exist.

Retrieve the list of masters required for a plugin.

Args:

Returns:
    The list of masters for the plugin (filenames with extension, no path).

Install a new handler to be called when a plugin is moved.

Args:
    callback: The function to call when a plugin is moved. The first parameter is the plugin name, the
        second the old priority of the plugin and the third one the new priority.

Returns:

Install a new handler to be called when plugin states change.

Args:
    callback: The function to call when a plugin states change. The parameter is a map from plugin names to new
        plugin states for the plugin whose states have changed.

Returns:

Install a new handler to be called when the list of plugins is refreshed.

Args:
    callback: The function to call when the list of plugins is refreshed.

Returns:

Retrieve the origin of a plugin. This is either the (internal) name of a mod, `"overwrite"` or `"data"`.

The internal name of a mod can differ from the display name for disambiguation.

Args:

Returns:
    The name of the origin of the plugin, or an empty string if the plugin does not exist.

Retrieve the priority of a plugin.

The higher the priority, the more important.

Args:

Returns:
    The priority of the given plugin, or -1 if the plugin does not exist.

Set the load order.

Plugins not included in the list will be placed at highest priority in the order they
were before.

Args:
    loadorder: The new load order, specified by the list of plugin names, sorted.

Change the priority of a plugin.

Args:
    priority: New priority of the plugin.

Returns:
    True on success, False if the priority change was not possible. This is usually because
one of the parameters is invalid. The function returns true even if the plugin was not moved
at the specified priority (e.g. when trying to move a non-master plugin before a master one).

Set the state of a plugin.

Args:
    state: New state of the plugin (`INACTIVE` or `ACTIVE`).

Retrieve the state of a plugin.

Args:

Returns:
    The state of the plugin.

Args:
    short_description: Short description of the problem.
    long_description: Long description of the problem.

Check if the requirement is met, and return a problem if not.

Args:
    organizer: The IOrganizer instance.

Returns:
    The problem found if the requirement is not met, otherwise None.

Retrieve the absolute file path to the corresponding INI file for this profile.

If iniFile does not correspond to a file in the list of INI files for the
current game (as returned by IPluginGame::iniFiles), the path to the global
file will be returned (if iniFile is absolute, iniFile is returned, otherwise
the path is assumed relative to the game documents directory).

Args:
    inifile: INI file to retrieve a path for. This can either be the name of a file or a path to the
        absolute file outside of the profile.

Returns:
    The absolute path for the given INI file for this profile.

Returns:
    True if automatic archive invalidation is enabled for this profile, False otherwise.

Returns:
    True if profile-specific saves are enabled for this profile, False otherwise.

Returns:
    True if profile-specific game settings are enabled for this profile, False otherwise.

Retrieve the creation time of the save.

The creation time of a save is not always the same as the creation time of
the file containing the save.

Returns:
    The creation time of the save.

Returns:
    The path name to the (main) file or folder for the save.

Retrieve the name of the group this files belong to.

The name can be used to identify sets of saves to transfer between profiles. For
RPG games, this is usually the name of a character.

Returns:
    The group identifier for this save game.

Creates a Mapping with the given parameters.

Args:
    source: The source of this mapping (absolute path), i.e. the path to the actual file.
    destination: Destination of this mapping (absolute path), i.e. the path in the virtual file system.
    is_directory: True if this mapping corresponds to a directory, False otherwise.
    create_target: True if file creation (including move or copy) should be redirected to source.

Create a basic requirement.

Args:
    checker: The callable to use to check if the requirement is met. Should return True
        if the requirement is met, False otherwise.
    description: The description of the problem, when the requirement is not met.

Returns:
    The constructed requirement.

Construct a requirement from a diagnose plugin.

If the wrapped diagnose plugin reports a problem, the requirement fails
and the associated message is the one from the diagnose plugin (or the
list of messages if multiple problems were reported).

Args:
    diagnose: The diagnose plugin to wrap in this requirement.

Returns:

Create a new game dependency requirement.

The requirement is met when the managed game is the specified game.

Args:
    game: The name of the required game.

Returns:

Create a new plugin dependency requirement.

The requirement is met when the specified plugin is enabled.

Args:
    plugin: The name of the plugin that must be enabled.

Returns:

Class to hold the user-configurable parameters a plugin accepts. The purpose of this class is
only to inform the application what settings to offer to the user, it does not hold the actual value.

Args:
    key: Name of the setting.
    description: Description of the setting.
    default_value: Default value of the setting.

Construct a VersionInfo using the given elements.

Args:
    major: Major version.
    minor: Minor version.
    subminor: Subminor version.
    release_type: Type of release.

Returns:
    A canonical string representing this version, that can be stored and then parsed using the parse() method.

Args:
    forced_segments: The number of version segments to display even if the version is 0. 1 is major, 2 is major
        and minor, etc. The only implemented ranges are (-inf,2] for major/minor, [3] for major/minor/subminor,
        and [4,inf) for major/minor/subminor/subsubminor. This only versions with a regular scheme.

Returns:
    A string for display to the user. The returned string may not contain enough information to reconstruct this version info.

Returns:
    True if this VersionInfo is valid, False otherwise.

Update this VersionInfo by parsing the given string using the given scheme.

Args:
    value: String to parse.
    scheme: Scheme to use to parse the string.
    is_manual: True if the given string should be treated as user input.

Returns:
    The version scheme in effect for this VersionInfo.

Add an archive to the archive list.

Args:
    profile: Profile to add the archive to.
    index: Index to insert before. Use 0 for the beginning of the list or INT_MAX for
        the end of the list).
    name: Name of the archive to add.

Retrieve the list of archives in the given profile.

Args:
    profile: Profile to retrieve archives from.

Returns:
    The list of archives in the given profile.

Remove the given archive from the given profile.

Args:
    profile: Profile to remove the archive from.
    name: Name of the archive to remove.

Retrieve the list of vanilla archives.

Vanilla archives are archive files that are shipped with the original
game.

Returns:
    The list of vanilla archives.

Returns:
    True if light plugins are supported, False otherwise.

Returns:
    True if medium plugins are supported, False otherwise.

Interface to classes that provides way to visualize and alter file trees. The tree
may not correspond to an actual file tree on the disk (e.g., inside an archive,
from a QTree Widget, ...).

Read-only operations on the tree are thread-safe, even when the tree has not been populated
yet.

In order to prevent wrong usage of the tree, implementing classes may throw
UnsupportedOperationException if an operation is not supported. By default, all operations
are supported, but some may not make sense in many situations.

The goal of this is not reflect the change made to a IFileTree to the disk, but child
classes may override relevant methods to do so.

The tree is built upon FileTreeEntry. A given tree holds shared pointers to its entries
while each entry holds a weak pointer to its parent, this means that the descending link
are strong (shared pointers) but the uplink are weak.

Accessing the parent is always done by locking the weak pointer so that returned pointer
or either null or valid. This structure implies that as long as the initial root lives,
entry should not be destroyed, unless the entry are detached from the root and no shared
pointers are kept.

However, it is not guarantee that one can go up the tree from a single node entry. If the
root node is destroyed, it will not be possible to go up the tree, even if we still have
a valid shared pointer.

Enumeration that can be returned by the callback for the `walk()` method to stop the
walking operation early.

Retrieve the entry at the given index in this tree.

Args:
    index: Index of the entry to retrieve, must be less than the size.

Returns:
    The entry at the given index.

Raises:
    IndexError: If the given index is not in range for this tree.

Retrieves an iterator for entries directly under this tree.

This method does not recurse into subtrees, see `walk()` for this.

Returns:
    An iterator object that can be used to iterate over entries in this tree.

Create a new directory tree under this tree.

This method will create missing folders in the given path and will
not fail if the directory already exists but will fail if the given
path contains "." or "..".
This method invalidates iterators to this tree and all the subtrees
present in the given path.

Args:
    path: Path to the directory to create.

Returns:
    An IFileTree corresponding to the created directory.

Raises:
    RuntimeError: If the directory could not be created.

Create a new file directly under this tree.

This method will fail if the file already exists and `replace_if_exists` is `False`.
This method invalidates iterators to this tree and all the subtrees present in the
given path.

Args:
    path: Path to the file to create.
    replace_if_exists: If True and an entry already exists at the given location, it will be replaced by
        a new entry. This will replace both files and directories.

Returns:
    A FileTreeEntry corresponding to the created file.

Raises:
    RuntimeError: If the file could not be created.

Delete (detach) all the entries from this tree.

This method will go through the entries in this tree and stop at the first
entry that cannot be deleted, this means that the tree can be partially cleared.

Returns:
    True if all entries have been detached, False otherwise.

Move the given entry to the given path under this tree.

The entry must not be a parent tree of this tree. This method can also be used
to rename entries.

If the insert policy if FAIL_IF_EXISTS, the call will fail if an entry
at the same location already exists. If the policy is REPLACE, an existing
entry will be replaced. If MERGE, the entry will be merged with the existing
one (if the entry is a file, and a file exists, the file will be replaced).

This method invalidates iterator to this tree, to the parent tree of the given
entry, and to subtrees of this tree if the insert policy is MERGE.

Args:
    entry: Entry to copy.
    path: The path to copy the entry to. If the path ends with / or \, the entry will
        be copied in the corresponding directory instead of replacing it. If the
        given path is empty (`""`), the entry is copied directly under this tree.
    insert_policy: Policy to use to resolve conflicts.

Returns:
    The new entry (copy of the specified entry).

Raises:
    RuntimeError: If the entry could not be copied.

Create a new orphan empty tree.

Args:
    name: Name of the tree.

Returns:
    A new tree without any parent.

Check if the given entry exists.

Args:
    path: Path to the entry, separated by / or \.
    type: The type of the entry to check.

Returns:
    True if the entry was found, False otherwise.

Retrieve the given entry.

If no entry exists at the given path, or if the entry is not of the right
type, `None` is returned.

Args:

Returns:
    The entry at the given location, or `None` if the entry was not found or
was not of the correct type.

Insert the given entry in this tree, removing it from its
previous parent.

The entry must not be this tree or a parent entry of this tree.

  - If the insert policy if `FAIL_IF_EXISTS`, the call will fail if an entry
    with the same name already exists.
  - If the policy is `REPLACE`, an existing entry will be replaced by the given entry.
  - If the policy is `MERGE`:

    - If there is no entry with the same name, the new entry is inserted.
    - If there is an entry with the same name:

      - If both entries are files, the old file is replaced by the given entry.
      - If both entries are directories, a merge is performed as if using merge().
      - Otherwise the insertion fails (two entries with different types).

Args:
    entry: Entry to insert.
    policy: Policy to use to resolve conflicts.

Returns:
    True if the entry was insert, False otherwise.

Merge the given tree with this tree, i.e., insert all entries
of the given tree into this tree.

The tree must not be this tree or a parent entry of this tree. Files present in both tree
will be replaced by files in the given tree. After a merge, the source tree will be
empty but still attached to its parent.

If `overwrites` is `True`, a map from overridden files to new files will be returned.

Note that the merge process makes no distinction between files and directories
when merging: if a directory is present in this tree and a file from source
is in conflict with it, the tree will be removed and the file inserted; if a file
is in this tree and a directory from source is in conflict with it, the file will
be replaced with the directory.

This method invalidates iterators to this tree, all the subtrees under this tree
present in the given path, and all the subtrees of the given source.

Args:
    other: Tree to merge.
    overwrites: If True, a mapping from overridden files to new files will be returned.

Returns:
    If `overwrites` is True, a mapping from overridden files to new files, otherwise
the number of overwritten entries.

Raises:
    RuntimeError: If the merge failed.

Args:
    entry: Entry to move.
    path: The path to move the entry to. If the path ends with / or \, the entry will
        be inserted in the corresponding directory instead of replacing it. If the
        given path is empty (`""`), this is equivalent to `insert()`.

Returns:

Retrieve the path from this tree to the given entry.

Args:
    entry: The entry to reach, must be in this tree.

Returns:
    The path from this tree to the given entry, including the name of the entry, or
an empty string if the given entry was not found under this tree.

Delete the given entry.

Args:
    entry: Entry to delete. The entry must belongs to this tree (and not to a subtree).

Returns:
    True if the entry was deleted, False otherwise.

Delete the entries with the given names from the tree.

This method does not recurse into subtrees, so only entries accessible
directly from this tree will be removed. This method invalidates iterators.

Args:
    names: Names of the entries to delete.

Returns:
    The number of deleted entry.

Delete entries matching the given predicate from the tree.

Args:
    filter: Predicate that should return true for entries to delete.

Returns:

Walk this tree, calling the given function for each entry in it.

The given callback will be called with two parameters: the path from this tree to the given entry
(with a trailing separator, not including the entry name), and the actual entry. The method returns
a `WalkReturn` object to indicates what to do.

Args:
    callback: Method to call for each entry in the tree.
    sep: Type of separator to use to construct the path.

Request description of a mod.

Args:
    game_name: Name of the game containing the mod.
    mod_id: Nexus ID of the mod.
    user_data: User data to be returned with the result.

Request download URL for mod file.0

Args:
    file_id: ID of the file for which a URL should be returned.

Args:
    file_id: ID of the file for which information is requested.

Request the list of files belonging to a mod.

Args:

Args:
    mod_version: Version of the mod.
    endorse:

Plugins that create problem reports to be displayed in the UI.

This can be used to report problems related to the same plugin (which implements further
interfaces) or as a stand-alone diagnosis tool.

Retrieve the list of active problems found by this plugin.

This method returns a list of problem IDs, that are then used when calling other methods
such as `shortDescription()` or `hasGuidedFix()`.

Returns:
    The list of active problems for this plugin.

Retrieve the full description of the problem corresponding to the given key.

Args:
    key: ID of the problem.

Returns:
    The full description of the problem.

Raises:
    IndexError: If the key is not valid.

Check if the problem corresponding to the given key has a guided fix.

Args:

Returns:
    True if there is a guided fix for the problem, False otherwise.

Raises:

Retrieve the short description of the problem corresponding to the given key.

Args:

Returns:
    The short description of the problem.

Raises:

Starts a guided fix for the problem corresponding to the given key.

This method should throw `ValueError` if there is no guided fix for the corresponding
problem.

Args:

Raises:
    ValueError: If there is no guided fix for this problem.

Base classes for game plugins.

Each game requires a specific game plugin. These plugins were initially designed for
Bethesda games, so a lot of methods and attributes are irrelevant for other games. If
you wish to write a plugin for a much simpler game, please consider the `basic_games`
plugin: https://github.com/ModOrganizer2/modorganizer-basic_games

Returns:
    The list of esp/esm files that are part of known DLCs.

Returns:
    The name of the default executable to run (relative to the game folder).

Returns:
    The path to the directory containing data (absolute path).

Detect the game.

This method is the first called for game plugins (before `init()`). The following
methods should work properly after the call to `detectGame()` (and before `init()`):

  - gameName()
  - isInstalled()
  - gameIcon()
  - gameDirectory()
  - dataDirectory()
  - gameVariants()
  - looksValid()

See `IPlugin.init()` for more.

Returns:
    The name of the game to user for display, default to gameName().

Returns:
    The directory of the documents folder where configuration files and such for this game reside.

Returns:
    A list of plugins enabled by the game but not in a strict load order.

Returns:
    A list of automatically discovered libraries that can be force loaded with executables.

Returns:
    A list of automatically discovered executables of the game itself and tools surrounding it.

Retrieve the list of variants for this game.

If there are multiple variants of a game (and the variants make a difference to the
plugin), like a regular one and a GOTY-edition, the plugin can return a list of them
and the user gets to chose which one he owns.

Returns:
    The list of variants of the game.

Returns:
    The name of the launcher executable to run (relative to the game folder), or an
empty string if there is no launcher.

Returns:
    The list of INI files this game uses. The first file in the list should be the
'main' INI file.

Initialize a profile for this game.

The MO app does not yet support virtualizing only specific aspects but plugins should be written
with this future functionality in mind.

This function will be used to initially create a profile, potentially to repair it or upgrade/downgrade
it so the implementations have to gracefully handle the case that the directory already contains files.

Args:
    directory: The directory where the profile is to be initialized.
    settings: The parameters for how the profile should be initialized.

Returns:
    True if this game has been discovered as installed, False otherwise.

List saves in the given directory.

Args:
    folder: The folder to list saves from.

Returns:
    The list of game saves in the given folder.

Check if the given directory looks like a valid game installation.

Args:
    directory: Directory to check.

Returns:
    True if the directory looks like a valid installation of this game, False otherwise.

Returns:
    The game name to use when calling LOOT from MO2, default to gameShortName().

Retrieve the Nexus game ID for this game.

Example: For Skyrim, the Nexus game ID is 110.

Returns:
    The Nexus game ID for this game.

Retrieve the Nexus mod ID of Mod Organizer for this game.

Example: For Skyrim SE, the mod ID of MO2 is 6194. You can find the mod ID in the URL:
  https://www.nexusmods.com/skyrimspecialedition/mods/6194

Returns:
    The Nexus mod ID of Mod Organizer for this game.

Returns:
    The list of plugins that are part of the game and not considered optional.

Retrieve primary alternative 'short' names for this game.

This is used to determine if a Nexus (or other) download source should be considered
as a primary source for the game so that it is not flagged as an alternative one.

Returns:
    The list of primary alternative 'short' names for this game, or an empty list.

Retrieve the list of secondary data directories. Each directories should be
assigned a unique name that differs from "data" which is the name of the main
data directory returned by dataDirectory().

Returns:
    A mapping from unique name to secondary data directories.

Set the path to the managed game.

This is called during instance creation if the game is not auto-detected and the user has
to specify the installation location. This is not called if the game has been auto-detected,
so `isInstalled()` should call this.

Args:
    path: Path to the game installation.

Set the game variant.

If there are multiple variants of game (as returned by `gameVariants()`), this will be
called on start with the user-selected game variant.

Args:
    variant: The game variant selected by the user.

Retrieve the Steam app ID for this game.

If the game is not available on Steam, this should return an empty string.

If a game is available in multiple versions, those might have different app ids. The plugin
should try to return the right one

Returns:
    The Steam app ID for this game. Should be empty for games not available on steam.

Retrieve the valid 'short' names for this game.

This is used to determine if a Nexus download is valid for the current game since not all
game variants have their own nexus pages and others can handle downloads from other nexus
game pages and should be allowed to do so (e.g., you can install some Skyrim LE mod even
when using Skyrim SE).

The short name should be considered the primary handler for a directly supported game
for purposes of auto-launching an instance.

Returns:
    The list of valid short names for this game.

This is the top-level class for installer. Actual installers should inherit either:

  - `IPluginInstallerSimple` if the installer can work directly with the archive. This is what
    most installers use.
  - `IPluginInstallerCustom` if the installer needs to perform custom operations. This is only
    used by the external NCC installer and the OMOD installer.

Check if the given file tree corresponds to a supported archive for this installer.

Args:
    tree: The tree representing the content of the archive.

Returns:
    True if this installer can handle the archive, False otherwise.

Check if this installer is a manual installer.

Returns:
    True if this installer is a manual installer, False otherwise.

Method calls at the end of the installation process. This method is only called once
per installation process, even for recursive installations (e.g. with the bundle installer).

Args:
    result: The result of the installation.
    new_mod: If the installation succeeded (result is RESULT_SUCCESS), contains the newly
        installed mod, otherwise it contains a null pointer.

Method calls at the start of the installation process, before any other methods.
This method is only called once per installation process, even for recursive
installations (e.g. with the bundle installer).

If `reinstallation` is true, then the given mod is the mod being reinstalled (the one
selected by the user). If `reinstallation` is false and `currentMod` is not null, then
it corresponds to a mod MO2 thinks corresponds to the archive (e.g. based on matching Nexus ID
or name).

The default implementation does nothing.

Args:
    archive: Path to the archive that is going to be installed.
    reinstallation: True if this is a reinstallation, False otherwise.
    current_mod: A currently installed mod corresponding to the archive being installed, or None
        if there is no such mod.

Retrieve the priority of this installer.

If multiple installers are able to handle an archive, the one with the highest priority wins.

Returns:
    The priority of this installer.

Set the installation manager for this installer.

Python plugins usually do not need to re-implement this and can directly access the installation
manager using `_manager()`.

Args:
    manager: The installation manager.

Set the parent widget for this installer.

Python plugins usually do not need to re-implement this and can directly access the parent
widget using `_parentWidget()` once the UI has been initialized.

Args:
    parent: The parent widget.

Check if the plugin handles the specified download.

Args:
    page_url: URL of the page that contains the download link.
    download_url: The download URL.
    fileinfo: Not usable in python.

Returns:
    True if this plugin wants to handle the specified download, False otherwise.

Returns:
    The URL to open when the user wants to visit this mod page.

Set the parent widget for this mod page.

Args:

Indicates if the page should be displayed in the integrated browser.

Unless the page provides a special means of starting downloads (like the nxm:// url schema
on nexus),  it will not be possible to handle downloads unless the integrated browser is used!

Returns:
    True if the page should be opened in the integrated browser, False otherwise.

These plugins add support for previewing files in the data pane. Right now all image formats supported
by qt are implemented (including dds) but no audio files and no 3d mesh formats.

Generate a preview widget from in-memory data.

Args:
    file_data: In-memory data to preview.
    filename: Name of the file the data comes from.
    max_size: Maximum size of the generated widget.

Returns:
    The widget showing a preview of the in-memory data.

Generate a preview widget for the specified file.

Args:
    filename: Path to the file to preview.

Returns:
    The widget showing a preview of the file.

Returns:
    The list of file extensions that are supported by this preview plugin.

Check if this preview plugin supports preview from in-memory data.

Returns:
    True if the plugin supports preview from raw data, False otherwise.

This is the simplest of plugin interfaces. Such plugins simply place an icon inside the tools sub-menu
and get invoked when the user clicks it. They are expected to have a user interface of some sort. These
are almost like independent applications except they can access all Mod Organizer interfaces like querying
and modifying the current profile, mod list, load order, use MO to install mods and so on. A tool plugin
can (and should!) integrate its UI as a window inside MO and thus doesn't have to initialize a windows
application itself.

Returns:
    The display name for this tool, as shown in the tool menu.

Returns:
    The icon for this tool, or a default-constructed QICon().

Set the parent widget for this tool.

Args:

Set the save file to display in this widget.

Args:
    save: The save to display in the widget

Check that the given filetree represent a valid mod layout, or can be easily
fixed.

This method is mainly used during installation (to find which installer should
be used or to recurse into multi-level archives), or to quickly indicates to a
user if a mod looks valid.

This method does not have to be exact, it only has to indicate if the given tree
looks like a valid mod or not by quickly checking the structure (heavy operations
should be avoided).

If the tree can be fixed by the `fix()` method, this method should return `FIXABLE`.
`FIXABLE` should only be returned when it is guaranteed that `fix()` can fix the tree.

Args:
    filetree: The tree starting at the root of the "data" folder.

Returns:
    Whether the tree is invalid, fixable or valid.

Try to fix the given tree.

This method is used during installation to try to fix invalid archives and will only be
called if dataLooksValid returned `FIXABLE`.

Args:
    filetree: The tree to try to fix. Can be modified during the process.

Returns:
    The fixed tree, or a null pointer if the tree could not be fixed.

The ModDataContent feature is used (when available) to indicate to users the content
of mods in the "Content" column.

The feature exposes a list of possible content types, each associated with an ID, a name
and an icon. The icon is the path to either:

  - A Qt resource or;
  - A file on the disk.

In order to facilitate the implementation, MO2 already provides a set of icons that can
be used. Those icons are all under ``:/MO/gui/content`` (e.g. ``:/MO/gui/content/plugin`` or ``:/MO/gui/content/music`` `).

The list of available icons is:

  - ``plugin``: |plugin-icon|
  - ``skyproc``: |skyproc-icon|
  - ``texture``: |texture-icon|
  - ``music``: |music-icon|
  - ``sound``: |sound-icon|
  - ``interface``: |interface-icon|
  - ``skse``: |skse-icon|
  - ``script``: |script-icon|
  - ``mesh``: |mesh-icon|
  - ``string``: |string-icon|
  - ``bsa``: |bsa-icon|
  - ``menu``: |menu-icon|
  - ``inifile``: |inifile-icon|
  - ``modgroup``: |modgroup-icon|

.. |plugin-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/jigsaw-piece.png
.. |skyproc-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/hand-of-god.png
.. |texture-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/empty-chessboard.png
.. |music-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/double-quaver.png
.. |sound-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/lyre.png
.. |interface-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/usable.png
.. |skse-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/checkbox-tree.png
.. |script-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/tinker.png
.. |mesh-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/breastplate.png
.. |string-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/conversation.png
.. |bsa-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/locked-chest.png
.. |menu-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/config.png
.. |inifile-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/feather-and-scroll.png
.. |modgroup-icon| image:: https://raw.githubusercontent.com/ModOrganizer2/modorganizer/master/src/resources/contents/xedit.png

Args:
    id: ID of this content.
    name: Name of this content.
    icon: Path to the icon for this content. Can be either a path
        to an image on the disk, or to a resource. Can be an empty string if filterOnly
        is true.
    filter_only: Indicates if the content should only be show in the filter
        criteria and not in the actual Content column.

Returns:
    True if this content is only meant to be used as a filter criteria.

Returns:
    The list of all possible contents for the corresponding game.

Retrieve the list of contents in the given tree.

Args:
    filetree: The tree corresponding to the mod to retrieve contents for.

Returns:
    The IDs of the content in the given tree.

Retrieve missing assets from the save.

Args:
    save: The save to find missing assets for.

Returns:
    A collection of missing assets and the modules that can supply those assets.

Retrieve a widget to display over the save game list.

This method is allowed to return `None` in case no widget has been implemented.

Args:

Returns:
    A SaveGameInfoWidget to display information about save game.

Returns:
    True if the script extender is installed, False otherwise.

Returns:
    The loader to use to ensure the game runs with the script extender.

Returns:
    The script extender plugin path, relative to the data folder.

Retrieve the extension of script extender save files.

Returns:
    The extension of script extender save files (e.g. "skse").

Retrieve the display name of a given mod.

Args:
    mod_name: Internal name of the mod.

Returns:
    The display name of the mod.

Retrieve the list of unmanaged mods for the corresponding game.

Args:
    official_only: Retrieve only unmanaged official mods.

Returns:
    The list of unmanaged mods (internal names).

Retrieve the reference file for the requested mod.

Example: For Bethesda games, the reference file may be the main
plugin (esp or esm) for the game or a DLCs.

Args:

Returns:
    The reference file (absolute path) for the requested mod.

Retrieve the secondary files for the requested mod.

Example: For Bethesda games, the secondary files may be the archives
corresponding to the reference file.

Args:

Returns:
    The secondary files (absolute paths) for the request mod.

Custom installer for mods. Custom installers receive the archive name and have to go
from there. They have to be able to extract the archive themselves.

Example of such installers are the external NCC installer or the OMOD installer.

The mod needs to be created by calling `IOrganizer.createMod` first.

Args:
    mod_name: Name of the mod to install. As an input parameter this is the suggested name
        (e.g. from meta data) The installer may change this parameter to rename the mod).
    game_name: Name of the game for which the mod is installed.
    archive_name: Name of the archive to install.
    version: Version of the mod. May be empty if the version is not yet known. The plugin is responsible
        for setting the version on the created mod.
    nexus_id: ID of the mod or -1 if unknown. The plugin is responsible for setting the mod ID for the
        created mod.

Returns:
    The result of the installation process.

Check if the given file is a supported archive for this installer.

Args:
    archive_name: Name of the archive.

Returns:

Returns:
    A list of file extensions that this installer can handle.

Simple installer for mods. Simple installers only deal with an in-memory structure
representing the archive and can modify what to install and where by editing this structure.
Actually extracting the archive is handled by the manager.

Install a mod from an archive filetree.

The installer can modify the given tree and use the manager to extract or create new
files.

This method returns different type of objects depending on the actual result of the
installation. The C++ bindings for this method always returns a tuple (result, tree,
version, id).

Args:
    name: Name of the mod to install. As an input parameter this is the suggested name
    tree: In-memory representation of the archive content.
    version: Version of the mod, or an empty string is unknown.
    nexus_id: ID of the mod, or -1 if unknown.

Returns:
    In case of failure, the result of the installation, otherwise the modified tree or
a tuple (result, tree, version, id) containing the result of the installation, the
modified tree, the new version and the new ID. The tuple can be returned even if the
installation did not succeed.

:param profile: Profile to add the archive to.
:param index: Index to insert before. Use 0 for the beginning of the list or INT_MAX for
              the end of the list).
:param name: Name of the archive to add.

:param profile: Profile to retrieve archives from.

:returns: The list of archives in the given profile.

:param profile: Profile to remove the archive from.
:param name: Name of the archive to remove.

game.

:returns: The list of vanilla archives.

title: str, binary: Union[str, os.PathLike[str], PyQt6.QtCore.QFileInfo]

:returns: True if the entry was removed correctly, False otherwise.

:param suffix: Suffix to check.

:returns: True if this entry is a file and has the given suffix.

:param tree: The tree to move this entry to.

:returns: True if the entry was moved correctly, False otherwise.

:returns: The parent tree containing this entry, or a `None` if this entry is the root

:param sep: The type of separator to use to create the path.

:returns: The path from this entry to the root, including the name of this entry.

:param tree: The tree to reach, must be a parent of this entry.

:returns: The path from the given tree to this entry, including the name of this entry, or

:returns: The last extension of this entry, or an empty string if the file has no extension

:returns: True if light plugins are supported, False otherwise.

:returns: True if medium plugins are supported, False otherwise.

:param value: Initial value of the GuessedString.
:param quality: Quality of the initial value.

:param other: The GuessedString to copy.

:returns: This GuessedString object.

:param filter: The new filter.

:param value: The new variant to add.
:param quality: The quality of the variant.

:param id: ID of the download.

:returns: The absolute path to the file corresponding to the given download. This file

:param callback: The function to be called when a download complete. The parameter is the download ID.

:returns: True if the handler was installed properly (there are currently no reasons for this to fail).

:param callback: The function to be called when a download fails. The parameter is the download ID.

:param callback: The function to be called when a download is paused. The parameter is the download ID.

:param callback: The function to be called when a download is removed. The parameter is the download ID.

:param mod_id: ID of the mod to download the file from.
:param file_id: ID of the file to download.

:returns: An ID identifying the download.

:param urls: List of urls to download from.

:param index: Index of the entry to retrieve, must be less than the size.

:returns: The entry at the given index.

:raises IndexError: If the given index is not in range for this tree.

:returns: An iterator object that can be used to iterate over entries in this tree.

:param path: Path to the directory to create.

:returns: An IFileTree corresponding to the created directory.

:raises RuntimeError: If the directory could not be created.

:param path: Path to the file to create.
:param replace_if_exists: If True and an entry already exists at the given location, it will be replaced by
                          a new entry. This will replace both files and directories.

:returns: A FileTreeEntry corresponding to the created file.

:raises RuntimeError: If the file could not be created.

:returns: True if all entries have been detached, False otherwise.

:param entry: Entry to copy.
:param path: The path to copy the entry to. If the path ends with / or \, the entry will
             be copied in the corresponding directory instead of replacing it. If the
             given path is empty (`""`), the entry is copied directly under this tree.
:param insert_policy: Policy to use to resolve conflicts.

:returns: The new entry (copy of the specified entry).

:raises RuntimeError: If the entry could not be copied.

entry: FileTreeEntry, path: str = '', insert_policy: IFileTree = InsertPolicy.FAIL_IF_EXISTS

:param name: Name of the tree.

:returns: A new tree without any parent.

:param path: Path to the entry, separated by / or \.
:param type: The type of the entry to check.

:returns: True if the entry was found, False otherwise.

path: str, type: FileTreeEntry = FileTreeEntry.FileTypes.FILE_OR_DIRECTORY

:returns: The entry at the given location, or `None` if the entry was not found or

:param entry: Entry to insert.
:param policy: Policy to use to resolve conflicts.

:returns: True if the entry was insert, False otherwise.

entry: FileTreeEntry, policy: IFileTree = InsertPolicy.FAIL_IF_EXISTS

:param other: Tree to merge.
:param overwrites: If True, a mapping from overridden files to new files will be returned.

:returns: If `overwrites` is True, a mapping from overridden files to new files, otherwise

:raises RuntimeError: If the merge failed.

:param entry: Entry to move.
:param path: The path to move the entry to. If the path ends with / or \, the entry will
             be inserted in the corresponding directory instead of replacing it. If the
             given path is empty (`""`), this is equivalent to `insert()`.

entry: FileTreeEntry, path: str, policy: IFileTree = InsertPolicy.FAIL_IF_EXISTS

:param entry: The entry to reach, must be in this tree.

:returns: The path from this tree to the given entry, including the name of the entry, or

:param entry: Entry to delete. The entry must belongs to this tree (and not to a subtree).

:returns: True if the entry was deleted, False otherwise.

:param names: Names of the entries to delete.

:returns: The number of deleted entry.

:param filter: Predicate that should return true for entries to delete.

:param callback: Method to call for each entry in the tree.
:param sep: Type of separator to use to construct the path.

callback: Callable[[str, FileTreeEntry], IFileTree], sep: str = '\\'

:param feature_type: The class of feature to retrieve.

:returns: The game feature corresponding to the given type, or `None` if the feature is

:param feature: Game feature to register.
:param priority: Priority of the game feature. If the plugin registering the feature
                 is a game plugin, this parameter is ignored.
:param replace: If True, remove features of the same kind registered by the current plugin,
                otherwise add the feature alongside existing ones.

:returns: True if the game feature was properly registered, False otherwise.

games: Sequence[str], feature: GameFeature, priority: int, replace: bool = False

game: IPluginGame, feature: GameFeature, priority: int, replace: bool = False

:param feature: Feature to unregister.

:returns: True if the feature was successfully unregistered, False otherwise.

register.

:param feature_type: The class of feature to unregister.

:returns: The number of unregistered features.

:param entry: The entry for which a temporary file should be created.

:returns: The path to the created file, or an empty string if the file could not be created.

location.

:param entry: Entry corresponding to the file to extract.
:param silent: If true, the dialog showing extraction progress will not be shown.

:returns: The absolute path to the temporary file, or an empty string if the file was not extracted.

location.

:param entries: Entries corresponding to the files to extract.

:returns: A list containing absolute paths to the temporary files.

:returns: The extensions of archives supported by this installation manager.

:param mod_name: Suggested name of the mod.
:param archive: Path to the archive to install.
:param mod_id: ID of the mod, if available.

:returns: The result of the installation.

mod_name: GuessedString, archive: Union[str, os.PathLike[str], PyQt6.QtCore.QFileInfo], mod_id: int = 0

:returns: Absolute path to the mod to be used in file system operations.

:param name: Name of the new category to assign.

:param category_id: The Nexus category ID.

:param plugin_name: Name of the plugin for which settings should be removed. This should always be `IPlugin.name()`
                    unless you have a really good reason to access settings of another plugin.

:returns: The old settings from the given plugin, as returned by `pluginSettings()`.

:returns: True if this mod was marked as converted by the user.

required.

:returns: A file tree representing the content of this mod.

:returns: The name of the game associated with this mod.

:returns: The ignored version of this mod (for update), or an invalid version if the user

:returns: The absolute path to the file that was used to install this mod.

:returns: True if this mod represents a foreign mod, not managed by MO2.

:returns: The newest version of this mod (as known by MO2). If this matches version(),

:param plugin_name: Name of the plugin for which to retrieve a setting. This should always be `IPlugin.name()`
:param key: Identifier of the setting.
:param default: The default value to return if the setting does not exist.

:returns: The setting, if found, or the default value.

:param plugin_name: Name of the plugin for which to retrieve settings. This should always be `IPlugin.name()`

:returns: A map from setting key to value. The map is empty if there are not settings for this mod.

:param name: Name of the category to remove.

:returns: True if the category was removed, False otherwise (e.g. if no such category

:returns: The name of the repository from which this mod was installed.

:param name: The new source game short name of this mod.

:param endorsed: New endorsement state of this mod.

:param version: The latest known version of this mod.

:param nexus_id: Thew new Nexus ID of this mod.

:param value: New value for the setting to set.

:returns: True if the setting was set correctly, False otherwise.

:param version: The new version of this mod.

:returns: The URL of this mod, or an empty QString() if no URL is associated

:returns: True if th is mod was marked as containing valid game data.

:returns: A list containing the internal names of all installed mods.

:returns: The list of mod (names), sorted according to the current profile priorities.

:param name: Internal name of the mod.

:returns: The display name of the given mod.

:param name: Name of the mod to retrieve.

:returns: An interface to the given mod, or `None` if there is no mod with this name.

:param callback: The function to call when a mod is installed. The parameter of the function is the name of the
                 newly installed mod.

:param callback: The function to call when a mod is moved. The first argument is the internal name of the
                 mod, the second argument the old priority and the third argument the new priority.

:param callback: The function to call when a mod is removed. The parameter of the function is the name of the
                 removed mod.

:param callback: The function to call when the states of mod change. The argument is a map containing the
                 mods whose states have changed. Keys are internal mod names and values are mod states.

:returns: The priority of the given mod.

:param mod: The mod to remove.

:returns: True if the mod was removed, False otherwise.

:param mod: The mod to rename.
:param name: The new name of the mod.

:returns: A valid reference to the given mod after renaming it.

:param name: Internal name of the mod to enable or disable.
:param active: True to enable the mod, False to disable it.

:returns: True on success, False otherwise.

:param priority: The new priority of the mod.

:returns: True if the priority was changed, False otherwise (if the name or priority were invalid).

:returns: The state of the given mod.

:param game_name: Name of the game containing the mod.
:param mod_id: Nexus ID of the mod.
:param user_data: User data to be returned with the result.

:param file_id: ID of the file for which a URL should be returned.

:param file_id: ID of the file for which information is requested.

:param mod_version: Version of the mod.
:param endorse:

game_name: str, mod_id: int, mod_version: str, endorse: bool, user_data: MoVariant

:returns: The absolute path to the base directory of Mod Organizer.

:param name: Name of the mod to create.

:returns: An interface to the newly created mod that can be used to modify it, or `None` if the mod

:returns: The newly created Nexus interface.

:param path: The path to search in (relative to the 'data' folder).
:param filter: The function to use to filter files. Should return True for the files to keep.

:returns: The list of `QFileInfo` corresponding to the matching files.

path: Union[str, os.PathLike[str], PyQt6.QtCore.QDir], filter: Callable[[FileInfo], bool]

:param pattern: The glob pattern to use to filter files.

:returns: The list of matching files.

path: Union[str, os.PathLike[str], PyQt6.QtCore.QDir], filter: Callable[[str], bool]

path: Union[str, os.PathLike[str], PyQt6.QtCore.QDir], patterns: Sequence[str]

path: Union[str, os.PathLike[str], PyQt6.QtCore.QDir], pattern: str

:param filename: Path to the file to retrieve origins for (relative to the 'data' folder).

:returns: The list of origins that contain the specified file, sorted by their priority.

:param name: Name of the game (short name).

:returns: The plugin for the given game, or `None` if none was found.

:returns: The directory for plugin data, typically plugins/data.

:param filename: Absolute filepath to the archive to install.
:param name_suggestion: Suggested name for this mod. This can still be changed by the user.

:returns: An interface to the new installed mod, or `None` if no installation took place (canceled or failure).

filename: Union[str, os.PathLike[str], PyQt6.QtCore.QFileInfo], name_suggestion: str = ''

:param plugin: The name of the plugin to check.

:returns: True if the plugin is enabled, False otherwise.

:param directory: Path to the directory to list (relative to the 'data' folder).

:returns: The list of directories in the given directory.

:param mod: The mod that has changed.

:param callback: The function to call when an application is about to run. The parameter
                 is the absolute path to the application to run. The function can return False
                 to prevent the application from running.

:returns: True if the handler was installed properly (there are currently no reasons for

:param callback: The function to call when an application has finished running. The first parameter is the absolute
                 path to the application, and the second parameter is the exit code of the application.

:param callback: Function to call on the next refresh (or immediately).
:param immediate_if_possible: If True, immediately run the callback if no refresh is currently running.

callback: Callable[[], None], immediate_if_possible: bool = True

:param name: Name of the plugin to watch.
:param callback: The function to call when the plugin is disabled.

:param callback: The function to call when the plugin is enabled.

:param callback: The function to call when a plugin setting is changed. The parameters are: The name of the plugin, the
                 name of the setting, the old value (or `None` if the setting did not exist before) and the new value
                 of the setting (or `None` if the setting has been removed).

:param callback: The function to call when the current profile is changed. The first parameter is the old profile (can
                 be `None`, e.g. at startup), and the second parameter is the new profile (cannot be `None`).

:param callback: The function to call when a new profile is created. The parameter is the new profile (can be
                 a temporary object and should not be stored).

anymore.

:param callback: The function to call when a profile is remove. The parameter is the name of the profile that was
                 removed.

:param callback: The function to call when a profile is renamed. The first parameter is the profile being renamed,
                 the second parameter the previous name and the third parameter the new name.

:param callback: The function to call when the user-interface has been fully initialized. The parameter is the main
                 window of the application (`QMainWindow`).

:param plugin_name: Name of the plugin for which to retrieve the value. This should always be `IPlugin.name()` unless you have a
                    really good reason to access data of another mod AND if you can verify that plugin is actually installed.
:param default: Default value to return if the key is not set (yet).

:returns: The value corresponding to the given persistent setting, or `def` is the key is not found.

:returns: Path to a directory where plugin data should be stored.

:param plugin_name: Name of the plugin to retrieve the setting for.
:param key: Name of the setting to retrieve the value for.

:returns: The value of the setting.

:returns: The name of the current profile, or an empty string if no profile has been loaded (yet).

:returns: The absolute path to the active profile or an empty string if no profile has been loaded (yet).

:param save_changes: If True, the relevant profile information is saved first (enabled mods and order of mods).

:param filename: Path to resolve.

:returns: The absolute real path, or an empty string if the path was not found.

:param plugin_name: Name of the plugin for which to change a value. This should always be `IPlugin.name()` unless you have a
:param value: New value for the setting.
:param sync: If True, the storage is immediately written to disc. This costs performance but is safer against data loss.

:param executable: Name or path of the executable. If this is only a filename, it will only work if it has been configured
                   in MO as an executable. If it is a relative path it is expected to be relative to the game directory.
:param args: Arguments to pass to the executable. If the list is empty, and `executable` refers to a configured executable,
             the configured arguments are used.
:param cwd: The working directory for the executable. If this is empty, the path to the executable is used unless `executable`
            referred to a configured MO executable, in which case the configured cwd is used.
:param profile: Profile to use. If this is empty (the default) the current profile is used.
:param forcedCustomOverwrite: The mod to set as the custom overwrite, regardless of what the profile has configured.
:param ignoreCustomOverwrite: Set to true to ignore the profile's configured custom overwrite.

:returns: The handle to the started application, or 0 if the application failed to start.

executable: Union[str, os.PathLike[str], PyQt6.QtCore.QFileInfo], args: Sequence[str] = [], cwd: Union[str, os.PathLike[str], PyQt6.QtCore.QDir] = '', profile: str = '', forcedCustomOverwrite: str = '', ignoreCustomOverwrite: bool = False

:returns: An IFileTree representing the virtual file tree.

:param handle: Handle of the application to wait for (as returned by `startApplication()`).
:param refresh: Whether ModOrganizer should refresh after the process completed or not.

:returns: A tuple `(result, exitcode)`, where `result` is a boolean indicating if the application

:returns: True if this plugin should be enabled by default, False otherwise.

  - `name()`

:param organizer: The main organizer interface.

:returns: True if the plugin was initialized correctly, False otherwise.

:returns: The localized name of the plugin.

:returns: The master plugin of this plugin, or a null pointer if this plugin does not have a master.

:returns: The name of the plugin.

:returns: The list of requirements for this plugin.

:returns: The list of active problems for this plugin.

:param key: ID of the problem.

:returns: The full description of the problem.

:raises IndexError: If the key is not valid.

:returns: True if there is a guided fix for the problem, False otherwise.

:returns: The short description of the problem.

problem.

:raises ValueError: If there is no guided fix for this problem.

:returns: The list of esp/esm files that are part of known DLCs.

:returns: The name of the default executable to run (relative to the game folder).

:returns: The path to the directory containing data (absolute path).

:returns: The name of the game to user for display, default to gameName().

:returns: The directory of the documents folder where configuration files and such for this game reside.

:returns: A list of plugins enabled by the game but not in a strict load order.

:returns: A list of automatically discovered libraries that can be force loaded with executables.

:returns: A list of automatically discovered executables of the game itself and tools surrounding it.

:returns: The list of variants of the game.

:returns: The name of the launcher executable to run (relative to the game folder), or an

:returns: The list of INI files this game uses. The first file in the list should be the

:param directory: The directory where the profile is to be initialized.
:param settings: The parameters for how the profile should be initialized.

:returns: True if this game has been discovered as installed, False otherwise.

:param folder: The folder to list saves from.

:returns: The list of game saves in the given folder.

:param directory: Directory to check.

:returns: True if the directory looks like a valid installation of this game, False otherwise.

:returns: The game name to use when calling LOOT from MO2, default to gameShortName().

:returns: The Nexus game ID for this game.

:returns: The Nexus mod ID of Mod Organizer for this game.

:returns: The list of plugins that are part of the game and not considered optional.

:returns: The list of primary alternative 'short' names for this game, or an empty list.

:returns: A mapping from unique name to secondary data directories.

:param path: Path to the game installation.

:param variant: The game variant selected by the user.

:returns: The Steam app ID for this game. Should be empty for games not available on steam.

:returns: The list of valid short names for this game.

:param tree: The tree representing the content of the archive.

:returns: True if this installer can handle the archive, False otherwise.

:returns: True if this installer is a manual installer, False otherwise.

:param result: The result of the installation.
:param new_mod: If the installation succeeded (result is RESULT_SUCCESS), contains the newly
                installed mod, otherwise it contains a null pointer.

or name).

:param archive: Path to the archive that is going to be installed.
:param reinstallation: True if this is a reinstallation, False otherwise.
:param current_mod: A currently installed mod corresponding to the archive being installed, or None
                    if there is no such mod.

:returns: The priority of this installer.

:param manager: The installation manager.

:param parent: The parent widget.

:param mod_name: Name of the mod to install. As an input parameter this is the suggested name
                 (e.g. from meta data) The installer may change this parameter to rename the mod).
:param game_name: Name of the game for which the mod is installed.
:param archive_name: Name of the archive to install.
:param version: Version of the mod. May be empty if the version is not yet known. The plugin is responsible
                for setting the version on the created mod.
:param nexus_id: ID of the mod or -1 if unknown. The plugin is responsible for setting the mod ID for the
                 created mod.

:returns: The result of the installation process.

mod_name: GuessedString, game_name: str, archive_name: str, version: str, nexus_id: int

:param archive_name: Name of the archive.

:returns: A list of file extensions that this installer can handle.

files.

:param name: Name of the mod to install. As an input parameter this is the suggested name
             (e.g. from meta data) The installer may change this parameter to rename the mod).
:param tree: In-memory representation of the archive content.
:param version: Version of the mod, or an empty string is unknown.
:param nexus_id: ID of the mod, or -1 if unknown.

:returns: In case of failure, the result of the installation, otherwise the modified tree or

name: GuessedString, tree: IFileTree, version: str, nexus_id: int

:param name: Filename of the plugin (without path but with file extension).

:returns: True if the given file has a .esl extension, False otherwise or if the

:returns: True if the given file has a .esm extension, False otherwise or if the

:returns: True if the given file plugin contains no records, False if it does OR if the

:returns: True if the given plugin is a light plugin, False otherwise or if the

:returns: True if the given plugin is a master plugin, False otherwise or if the

:returns: True if the given plugin is a medium plugin, False otherwise or if the

:returns: The load order of the plugin (the order in which the game loads it). If all plugins are enabled this

:returns: The list of masters for the plugin (filenames with extension, no path).

:param callback: The function to call when a plugin is moved. The first parameter is the plugin name, the
                 second the old priority of the plugin and the third one the new priority.

:param callback: The function to call when a plugin states change. The parameter is a map from plugin names to new
                 plugin states for the plugin whose states have changed.

:param callback: The function to call when the list of plugins is refreshed.

:returns: The name of the origin of the plugin, or an empty string if the plugin does not exist.

:returns: The priority of the given plugin, or -1 if the plugin does not exist.

:param loadorder: The new load order, specified by the list of plugin names, sorted.

:param priority: New priority of the plugin.

:returns: True on success, False if the priority change was not possible. This is usually because

:param state: New state of the plugin (`INACTIVE` or `ACTIVE`).

:returns: The state of the plugin.

:param page_url: URL of the page that contains the download link.
:param download_url: The download URL.
:param fileinfo: Not usable in python.

:returns: True if this plugin wants to handle the specified download, False otherwise.

page_url: PyQt6.QtCore.QUrl, download_url: PyQt6.QtCore.QUrl, fileinfo: ModRepositoryFileInfo

:returns: The URL to open when the user wants to visit this mod page.

:returns: True if the page should be opened in the integrated browser, False otherwise.

:param file_data: In-memory data to preview.
:param filename: Name of the file the data comes from.
:param max_size: Maximum size of the generated widget.

:returns: The widget showing a preview of the in-memory data.

file_data: PyQt6.QtCore.QByteArray, filename: str, max_size: PyQt6.QtCore.QSize

:param filename: Path to the file to preview.

:returns: The widget showing a preview of the file.

:returns: The list of file extensions that are supported by this preview plugin.

:returns: True if the plugin supports preview from raw data, False otherwise.

:param short_description: Short description of the problem.
:param long_description: Long description of the problem.

:param organizer: The IOrganizer instance.

:returns: The problem found if the requirement is not met, otherwise None.

:returns: The display name for this tool, as shown in the tool menu.

:returns: The icon for this tool, or a default-constructed QICon().

:param inifile: INI file to retrieve a path for. This can either be the name of a file or a path to the
                absolute file outside of the profile.

:returns: The absolute path for the given INI file for this profile.

:returns: True if automatic archive invalidation is enabled for this profile, False otherwise.

:returns: True if profile-specific saves are enabled for this profile, False otherwise.

:returns: True if profile-specific game settings are enabled for this profile, False otherwise.

:returns: The creation time of the save.

:returns: The path name to the (main) file or folder for the save.

:returns: The group identifier for this save game.

:param save: The save to display in the widget

:param source: The source of this mapping (absolute path), i.e. the path to the actual file.
:param destination: Destination of this mapping (absolute path), i.e. the path in the virtual file system.
:param is_directory: True if this mapping corresponds to a directory, False otherwise.
:param create_target: True if file creation (including move or copy) should be redirected to source.

source: str, destination: str, is_directory: bool, create_target: bool = False

fixed.

:param filetree: The tree starting at the root of the "data" folder.

:returns: Whether the tree is invalid, fixable or valid.

:param filetree: The tree to try to fix. Can be modified during the process.

:returns: The fixed tree, or a null pointer if the tree could not be fixed.

:param id: ID of this content.
:param name: Name of this content.
:param icon: Path to the icon for this content. Can be either a path
             to an image on the disk, or to a resource. Can be an empty string if filterOnly
             is true.
:param filter_only: Indicates if the content should only be show in the filter
                    criteria and not in the actual Content column.

:returns: True if this content is only meant to be used as a filter criteria.

:returns: The list of all possible contents for the corresponding game.

:param filetree: The tree corresponding to the mod to retrieve contents for.

:returns: The IDs of the content in the given tree.

:param checker: The callable to use to check if the requirement is met. Should return True
                if the requirement is met, False otherwise.
:param description: The description of the problem, when the requirement is not met.

:returns: The constructed requirement.

:param diagnose: The diagnose plugin to wrap in this requirement.

:param game: The name of the required game.

:param plugin: The name of the plugin that must be enabled.

:param key: Name of the setting.
:param description: Description of the setting.
:param default_value: Default value of the setting.

:param save: The save to find missing assets for.

:returns: A collection of missing assets and the modules that can supply those assets.

:returns: A SaveGameInfoWidget to display information about save game.

:returns: True if the script extender is installed, False otherwise.

:returns: The loader to use to ensure the game runs with the script extender.

:returns: The script extender plugin path, relative to the data folder.

:returns: The extension of script extender save files (e.g. "skse").

:param mod_name: Internal name of the mod.

:returns: The display name of the mod.

:param official_only: Retrieve only unmanaged official mods.

:returns: The list of unmanaged mods (internal names).

:returns: The reference file (absolute path) for the requested mod.

:returns: The secondary files (absolute paths) for the request mod.

:param major: Major version.
:param minor: Minor version.
:param subminor: Subminor version.
:param release_type: Type of release.

major: int, minor: int, subminor: int, subsubminor: int, release_type: ReleaseType = ReleaseType.FINAL

major: int, minor: int, subminor: int, release_type: ReleaseType = ReleaseType.FINAL

:returns: A canonical string representing this version, that can be stored and then parsed using the parse() method.

:param forced_segments: The number of version segments to display even if the version is 0. 1 is major, 2 is major
                        and minor, etc. The only implemented ranges are (-inf,2] for major/minor, [3] for major/minor/subminor,
                        and [4,inf) for major/minor/subminor/subsubminor. This only versions with a regular scheme.

:returns: A string for display to the user. The returned string may not contain enough information to reconstruct this version info.

:param value: String to parse.
:param scheme: Scheme to use to parse the string.
:param is_manual: True if the given string should be treated as user input.

value: str, scheme: VersionScheme = VersionScheme.DISCOVER, is_manual: bool = False

:param filepath: Absolute path to the executable.

:returns: The file version, or an empty string if the file version could not be retrieved.

:param executable: Absolute path to the executable.

:returns: The icon for this executable, if any.

executable: Union[str, os.PathLike[str], PyQt6.QtCore.QFileInfo]

:returns: The product version, or an empty string if the product version could not be retrieved.

Construct a new TaskDialog.

Args:
    parent: Parent widget of the dialog.
    title: Title of the dialog.
    main: Header of the dialog (big text at the top).
    content: Main message of the dialog (text below main).
    details: Details for the dialog, initially collapsed (bottom of the dialog).
    icon: Icon for the dialog.
    buttons: List of buttons for the dialog.
    remember: Remember the choice for this dialog.

Add a custom button to this TaskDialog.

Args:
    button: Button to add to the dialog.

Add a custom widget content to this TaskDialog. Widget content are put between
content and buttons (above buttons).

Args:
    widget: Widget to add.

Display this dialog and wait for user-interaction to return. This is a blocking
function.

Returns:
    The button clicked by the user. Without custom buttons, this return Ok,
otherwise it returns the button set in the TaskDialogButton.

Set the top-level message of this dialog.

Args:
    content: Top-level message to set.

Set the details for this TaskDialog.

The details are hidden by default and the user can display them by clicking
the "Details" button at the bottom of the TaskDialog.

Args:
    details: Details content to display. Can be a multi-line string.

Set the icon of the dialog.

Args:
    icon: Icon of the dialog.

Set the main message of the dialog. The main message is displayed at the top of
the dialog in large font.

Args:
    main: Main message of the dialog.

Set the title of the dialog.

Args:

Set the width of the dialog.

Args:
    width: Width of the dialog.

Create a TaskDialogButton without description.

Args:
    text: Label of the button.
    button: Value returned by TaskDialog.exec() if this button is clicked.

:param parent: Parent widget of the dialog.
:param title: Title of the dialog.
:param main: Header of the dialog (big text at the top).
:param content: Main message of the dialog (text below main).
:param details: Details for the dialog, initially collapsed (bottom of the dialog).
:param icon: Icon for the dialog.
:param buttons: List of buttons for the dialog.
:param remember: Remember the choice for this dialog.

parent: PyQt6.QtWidgets.QWidget | None = None, title: str = '', main: str = '', content: str = '', details: str = '', icon: PyQt6.QtWidgets.QMessageBox.Icon = PyQt6.QtWidgets.QMessageBox.Icon.NoIcon, buttons: list[TaskDialogButton] = [], remember: Union[str, tuple[str, str]] = ''

:param button: Button to add to the dialog.

:param widget: Widget to add.

function.

:returns: The button clicked by the user. Without custom buttons, this return Ok,

:param content: Top-level message to set.

:param details: Details content to display. Can be a multi-line string.

:param main: Main message of the dialog.

:param width: Width of the dialog.

:param text: Label of the button.
:param button: Value returned by TaskDialog.exec() if this button is clicked.

text: str, description: str, button: PyQt6.QtWidgets.QMessageBox.StandardButton