mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
The C++ wrapper defaults it to true, so the behaviour hasn't changed for existing callers that don't pass a value for the evaluateConditions parameter, i.e. that call GetGeneralMessages(). Since the new parameter comes before evaluateConditions, existing GetGeneralMessages(true) and GetGeneralMessages(false) calls need to be replaced with GetGeneralMessages(true, true) and GetGeneralMessages(true, false) to retain their existing behaviour. The parameter order was chosen to match that of GetPluginMetadata(), at the cost of this backwards incompatibility.
libloot-python
An experimental Python wrapper around the libloot Rust implementation, built using PyO3.
Build
To build, first set up a Python virtual environment and install maturin:
# pipx
pipx install maturin
# uv
uv tool install maturin
or using pip on Windows:
python -m venv .venv
.\.venv\Scripts\activate
pip install maturin
or using pip on Linux:
python -m venv .venv
. .venv/bin/activate
pip install maturin
Then build the library in the virtual environment:
maturin develop
The library can then be imported in Python:
python
> import loot
Usage notes
- The Python exceptions that errors are mapped to are not the same as in the Rust or C++ interfaces:
- The API provides the custom
CyclicInteractionError,UndefinedGroupError,PluginNotLoadedErrorexception types. - All other errors are raised as
ValueErrorexceptions.
- The API provides the custom
- The
LogLevelenum andset_logging_callback()andset_log_level()functions are not exposed because the logging is integrated with Python'sloggingmodule instead.