IPluginList

class mobase.IPluginList

Bases: object

Primary interface to the list of plugins.

Methods Summary

hasLightExtension(name)

Determine if a plugin has a .esl extension.

hasMasterExtension(name)

Determine if a plugin has a .esm extension.

isLightFlagged(name)

Determine if a plugin is flagged as light

isMasterFlagged(name)

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

loadOrder(name)

Retrieve the load order of a plugin.

masters(name)

Retrieve the list of masters required for a plugin.

onPluginMoved(callback)

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

onPluginStateChanged(callback)

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

onRefreshed(callback)

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

origin(name)

Retrieve the origin of a plugin.

pluginNames()

rtype:

Sequence[str]

priority(name)

Retrieve the priority of a plugin.

setLoadOrder(loadorder)

Set the load order.

setPriority(name, priority)

Change the priority of a plugin.

setState(name, state)

Set the state of a plugin.

state(name)

Retrieve the state of a plugin.

Methods Documentation

hasLightExtension(name)

Determine if a plugin has a .esl extension.

Return type:

bool

Parameters:

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.

hasMasterExtension(name)

Determine if a plugin has a .esm extension.

Return type:

bool

Parameters:

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

Returns:

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

file does not exist.

isLightFlagged(name)

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.

Return type:

bool

Parameters:

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

Returns:

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

file does not exist.

isMasterFlagged(name)

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.

Return type:

bool

Parameters:

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

Returns:

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

file does not exist.

loadOrder(name)

Retrieve the load order of a plugin.

Return type:

int

Parameters:

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

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.

masters(name)

Retrieve the list of masters required for a plugin.

Return type:

Sequence[str]

Parameters:

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

Returns:

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

onPluginMoved(callback)

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

Return type:

bool

Parameters:

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:

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

onPluginStateChanged(callback)

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

Return type:

bool

Parameters:

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:

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

onRefreshed(callback)

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

Return type:

bool

Parameters:

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

Returns:

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

origin(name)

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.

Return type:

str

Parameters:

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

Returns:

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

pluginNames()
Return type:

Sequence[str]

Returns:

The list of all plugin names.

priority(name)

Retrieve the priority of a plugin.

The higher the priority, the more important.

Return type:

int

Parameters:

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

Returns:

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

setLoadOrder(loadorder)

Set the load order.

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

Return type:

None

Parameters:

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

setPriority(name, priority)

Change the priority of a plugin.

Return type:

bool

Parameters:
  • name – Filename of the plugin (without path but with file extension).

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

setState(name, state)

Set the state of a plugin.

Return type:

None

Parameters:
  • name – Filename of the plugin (without path but with file extension).

  • state – New state of the plugin (INACTIVE or ACTIVE).

state(name)

Retrieve the state of a plugin.

Return type:

PluginState

Parameters:

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

Returns:

The state of the plugin.