Files

247 lines
7.2 KiB
ReStructuredText
Raw Permalink Normal View History

2016-08-15 20:51:24 +01:00
*************
API Reference
*************
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
.. py:class:: loot.GameType
2016-08-16 08:12:50 +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
.. py:class:: loot.LogLevel
2016-08-19 19:46:19 +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
.. py:class:: loot.MessageType
2016-08-19 19:46:19 +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
.. 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 plugins 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.
.. 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`.
.. 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
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.
.. 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
=========
.. 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`.
.. 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`.
.. 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
Initialise a new game handle. Wraps :cpp:func:`loot::CreateGameHandle`.
2016-08-15 20:51:24 +01:00
Classes
=======
.. py:class:: loot.GameInterface
Wraps :cpp:class:`loot::GameInterface`.
.. py:function:: loot.get_database() -> loot.DatabaseInterface
Get a database handle. Wraps :cpp:func:`loot::GetDatabase`.
.. py:function:: loot.load_current_load_order_state() -> NoneType
Load the current load order state, discarding any previously held state.
Wraps :cpp:func:`loot::LoadCurrentLoadOrderState`.
.. 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`.
.. py:method:: get_masterlist_revision(loot.DatabaseInterface, unicode, bool) -> loot.MasterlistInfo
2016-08-19 19:46:19 +01:00
Gets the give masterlists source control revision. Wraps :cpp:func:`GetMasterlistRevision`.
.. 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 plugins loaded metadata. Wraps :cpp:func:`GetPluginMetadata`.
2016-08-19 19:46:19 +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 databases knowledge of a plugins cleanliness. Outputs whether the plugin should be cleaned or not, or if no data is available.
2016-08-19 19:46:19 +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
.. 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`.
.. 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`.
.. 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`.
.. 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``
.. py:class:: loot.WrapperVersion
Provides information about the version of libloot-python that is being run.
.. 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
.. py:class:: loot.PluginMetadata
2017-11-04 13:52:19 +00:00
Wraps :cpp:class:`loot::PluginMetadata`.
.. py:method:: get_simple_messages(loot.PluginMetadata, unicode) -> list<loot.SimpleMessage>
2017-11-04 13:52:19 +00:00
Get the plugins messages as SimpleMessage objects for the given language.
Wraps :cpp:func:`GetPluginMessages`.