2016-08-15 20:51:24 +01:00
*************
API Reference
*************
2019-10-22 21:02:15 +01:00
As this API is just a wrapper for libloot's C++ API, its documentation is linked
to for all non-Python-specific information.
2016-08-15 20:51:24 +01:00
Enumerations
============
2016-08-16 08:12:50 +01:00
The wrapped enumeration types below are classes in Python, but the distinction
2016-08-19 19:46:19 +01:00
makes no difference in practice, so they're grouped here for semantics. All
values are unsigned integer constants.
2016-08-16 08:12:50 +01:00
2019-10-22 21:02:15 +01:00
.. py:class :: loot.GameType
2016-08-16 08:12:50 +01:00
2019-10-22 21:02:15 +01:00
Wraps :cpp:type: `loot::GameType` to expose libloot's game codes.
2016-08-15 20:51:24 +01:00
2016-08-19 19:46:19 +01:00
.. py:attribute :: fo3
.. py:attribute :: fo4
.. py:attribute :: fonv
.. py:attribute :: tes4
.. py:attribute :: tes5
2016-11-06 15:09:06 +00:00
.. py:attribute :: tes5se
2016-08-16 08:12:50 +01:00
2019-10-22 21:02:15 +01:00
.. py:class :: loot.LogLevel
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
Wraps :cpp:type: `loot::LogLevel` to expose libloot's log level codes.
2016-08-19 19:46:19 +01:00
2017-11-04 13:52:19 +00:00
.. py:attribute :: trace
.. py:attribute :: debug
.. py:attribute :: info
.. py:attribute :: warning
.. py:attribute :: error
.. py:attribute :: fatal
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
.. py:class :: loot.MessageType
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
Wraps :cpp:type: `loot::MessageType` to expose libloot's message type
2017-11-04 13:52:19 +00:00
codes.
2016-08-19 19:46:19 +01:00
.. py:attribute :: error
.. py:attribute :: say
.. py:attribute :: warn
2019-10-22 21:02:15 +01:00
.. py:class :: loot.PluginCleanliness
2016-08-19 19:46:19 +01:00
2017-11-04 13:52:19 +00:00
Codes used to indicate the cleanliness of a plugin according to the
information contained within the loaded masterlist/userlist.
2016-08-19 19:46:19 +01:00
.. py:attribute :: clean
2017-11-04 13:52:19 +00:00
Indicates that the plugin is clean.
2016-08-19 19:46:19 +01:00
.. py:attribute :: dirty
2017-11-04 13:52:19 +00:00
Indicates that the plugin is dirty.
2016-08-19 19:46:19 +01:00
.. py:attribute :: do_not_clean
2017-11-04 13:52:19 +00:00
Indicates that the plugin contains dirty edits, but that they are part of
the plugin’ s intended functionality and should not be removed.
2016-08-19 19:46:19 +01:00
.. py:attribute :: unknown
2016-08-15 20:51:24 +01:00
2017-11-04 13:52:19 +00:00
Indicates that no data is available on whether the plugin is dirty or not.
2016-08-15 20:51:24 +01:00
Public-Field Data Structures
============================
2016-08-16 08:12:50 +01:00
Classes with public fields and no member functions.
2019-10-22 21:02:15 +01:00
.. py:class :: loot.MasterlistInfo
2016-08-16 08:12:50 +01:00
2016-08-19 19:46:19 +01:00
Wraps :cpp:class: `loot::MasterlistInfo` .
2016-08-15 20:51:24 +01:00
2016-08-19 19:46:19 +01:00
.. py:attribute :: revision_id
A Unicode string containing a Git commit's SHA-1 checksum.
.. py:attribute :: revision_date
A Unicode string containing the date of the commit given by :py:attr: `revision_id` , in ISO 8601 format (YYYY-MM-DD).
.. py:attribute :: is_modified
A boolean that is true if the masterlist has been modified from its state
at the commit given by :py:attr: `revision_id` .
2019-10-22 21:02:15 +01:00
.. py:class :: loot.SimpleMessage
2016-08-19 19:46:19 +01:00
2016-08-24 19:02:18 +01:00
Wraps :cpp:class: `loot::SimpleMessage` .
2016-08-19 19:46:19 +01:00
.. py:attribute :: type
2019-10-22 21:02:15 +01:00
A :py:class: `loot.MessageType` giving the message type.
2016-08-19 19:46:19 +01:00
2016-08-24 19:02:18 +01:00
.. py:attribute :: language
2017-11-04 13:52:19 +00:00
A Unicode string giving the message text language.
2016-08-24 19:02:18 +01:00
2016-08-19 19:46:19 +01:00
.. py:attribute :: text
A Unicode string containing the message text.
2017-11-04 13:52:19 +00:00
.. py:attribute :: condition
A Unicode string containing the message condition.
2019-10-22 21:02:15 +01:00
.. py:class :: loot.PluginTags
2016-08-19 19:46:19 +01:00
Wraps :cpp:class: `loot::PluginTags` .
.. py:attribute :: added
A set of Unicode strings giving Bash Tags suggested for addition.
.. py:attribute :: removed
A set of Unicode strings giving Bash Tags suggested for removal.
2016-10-08 16:22:28 +01:00
.. py:attribute :: userlist_modified
2016-08-19 19:46:19 +01:00
A boolean that is true if the suggestions contain metadata obtained from a loaded userlist.
2016-08-15 20:51:24 +01:00
Functions
=========
2019-10-22 21:02:15 +01:00
.. py:function :: loot.set_logging_callback(callback) -> NoneType
2017-11-04 13:52:19 +00:00
Set the callback function that is called when logging. Wraps
:cpp:func: `loot::SetLoggingCallback` .
2019-10-22 21:02:15 +01:00
.. py:function :: loot.is_compatible(int, int, int) -> bool
2016-08-15 20:51:24 +01:00
2016-08-19 19:46:19 +01:00
Checks for API compatibility. Wraps :cpp:func: `loot::IsCompatible` .
2019-10-22 21:02:15 +01:00
.. py:function :: loot.create_game_handle(game : loot.GameType, game_path : unicode, [game_local_path : unicode = u'']) -> loot.GameInterface
2016-08-19 19:46:19 +01:00
2017-11-04 17:23:07 +00:00
Initialise a new game handle. Wraps :cpp:func: `loot::CreateGameHandle` .
2016-08-15 20:51:24 +01:00
Classes
=======
2019-10-22 21:02:15 +01:00
.. py:class :: loot.GameInterface
2017-11-04 17:23:07 +00:00
Wraps :cpp:class: `loot::GameInterface` .
2019-10-22 21:02:15 +01:00
.. py:function :: loot.get_database() -> loot.DatabaseInterface
2017-11-04 17:23:07 +00:00
Get a database handle. Wraps :cpp:func: `loot::GetDatabase` .
2019-10-22 21:02:15 +01:00
.. py:function :: loot.load_current_load_order_state() -> NoneType
2017-11-04 17:23:07 +00:00
Load the current load order state, discarding any previously held state.
Wraps :cpp:func: `loot::LoadCurrentLoadOrderState` .
2019-10-22 21:02:15 +01:00
.. py:class :: loot.DatabaseInterface
2016-08-15 20:51:24 +01:00
2016-08-19 19:46:19 +01:00
Wraps :cpp:class: `loot::DatabaseInterface` .
2019-10-22 21:02:15 +01:00
.. py:method :: get_masterlist_revision(loot.DatabaseInterface, unicode, bool) -> loot.MasterlistInfo
2016-08-19 19:46:19 +01:00
Gets the give masterlist’ s source control revision. Wraps :cpp:func: `GetMasterlistRevision` .
2019-10-22 21:02:15 +01:00
.. py:method :: get_plugin_metadata(loot.DatabaseInterface, plugin : unicode, [includeUserMetadata : bool = True, [evaluateConditions : bool = False]]) -> loot.PluginMetadata
2016-08-19 19:46:19 +01:00
2017-11-04 13:52:19 +00:00
Get all a plugin’ s loaded metadata. Wraps :cpp:func: `GetPluginMetadata` .
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
.. py:method :: get_plugin_cleanliness(loot.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot.PluginCleanliness
2016-08-19 19:46:19 +01:00
2017-11-04 13:52:19 +00:00
Determines the database’ s knowledge of a plugin’ s cleanliness. Outputs whether the plugin should be cleaned or not, or if no data is available.
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
.. py:method :: get_plugin_tags(loot.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot.PluginTags
2016-08-19 19:46:19 +01:00
2017-11-04 13:52:19 +00:00
Outputs the Bash Tags suggested for addition and removal by the database for the given plugin.
2016-08-19 19:46:19 +01:00
2019-10-22 21:02:15 +01:00
.. py:method :: load_lists(loot.DatabaseInterface, masterlist_path : unicode, [userlist_path : unicode = u'']) -> NoneType
2016-08-19 19:46:19 +01:00
Loads the masterlist and userlist from the paths specified. Wraps :cpp:func: `LoadLists` .
2019-10-22 21:02:15 +01:00
.. py:method :: update_masterlist(loot.DatabaseInterface, unicode, unicode, unicode) -> bool
2016-08-19 19:46:19 +01:00
Updates the given masterlist using the given Git repository details. Wraps :cpp:func: `UpdateMasterlist` .
2019-10-22 21:02:15 +01:00
.. py:method :: write_minimal_list(loot.DatabaseInterface, unicode, bool) -> NoneType
2016-08-19 19:46:19 +01:00
Writes a minimal metadata file containing only Bash Tag suggestions and/or cleanliness info from the loaded metadata. Wraps :cpp:func: `WriteMinimalList` .
2019-10-22 21:02:15 +01:00
.. py:class :: loot.Version
2016-08-19 19:46:19 +01:00
Wraps :cpp:class: `loot::LootVersion` .
.. py:attribute :: major
An unsigned integer giving the major version number.
.. py:attribute :: minor
An unsigned integer giving the minor version number.
.. py:attribute :: patch
An unsigned integer giving the patch version number.
.. py:attribute :: revision
A Unicode string containing the SHA-1 of the Git revision that the wrapped C++ API was built from.
.. py:staticmethod :: string() -> unicode
Returns the API version as a string of the form ``major.minor.patch``
2016-09-18 17:43:04 +01:00
2019-10-22 21:02:15 +01:00
.. py:class :: loot.WrapperVersion
2016-09-18 17:43:04 +01:00
2019-10-22 21:02:15 +01:00
Provides information about the version of libloot-python that is being run.
2016-09-18 17:43:04 +01:00
.. py:attribute :: major
An unsigned integer giving the major version number.
.. py:attribute :: minor
An unsigned integer giving the minor version number.
.. py:attribute :: patch
An unsigned integer giving the patch version number.
.. py:attribute :: revision
A Unicode string containing the SHA-1 of the Git revision that the wrapped C++ API was built from.
.. py:staticmethod :: string() -> unicode
Returns the API version as a string of the form ``major.minor.patch``
2017-11-04 13:52:19 +00:00
2019-10-22 21:02:15 +01:00
.. py:class :: loot.PluginMetadata
2017-11-04 13:52:19 +00:00
Wraps :cpp:class: `loot::PluginMetadata` .
2019-10-22 21:02:15 +01:00
.. py:method :: get_simple_messages(loot.PluginMetadata, unicode) -> list<loot.SimpleMessage>
2017-11-04 13:52:19 +00:00
Get the plugin’ s messages as SimpleMessage objects for the given language.
Wraps :cpp:func: `GetPluginMessages` .