mirror of
https://github.com/loot/libloot-python.git
synced 2026-07-27 14:14:13 -07:00
Rename package and repository to libloot-python and module to loot
This commit is contained in:
+22
-18
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
cmake_minimum_required (VERSION 3.1)
|
cmake_minimum_required (VERSION 3.1)
|
||||||
project (loot_api_python)
|
project (libloot-python)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
set(EXTERNAL_PROJECTS_PATH "${CMAKE_BINARY_DIR}/external/src")
|
set(EXTERNAL_PROJECTS_PATH "${CMAKE_BINARY_DIR}/external/src")
|
||||||
@@ -29,7 +29,7 @@ ELSE()
|
|||||||
SET (GIT_COMMIT_STRING "unknown")
|
SET (GIT_COMMIT_STRING "unknown")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
message(STATUS "LOOT API Python version: ${LIBLOOT_PY_VERSION_MAJOR}.${LIBLOOT_PY_VERSION_MINOR}.${LIBLOOT_PY_VERSION_PATCH}")
|
message(STATUS "libloot-python version: ${LIBLOOT_PY_VERSION_MAJOR}.${LIBLOOT_PY_VERSION_MINOR}.${LIBLOOT_PY_VERSION_PATCH}")
|
||||||
message(STATUS "Git revision: ${GIT_COMMIT_STRING}")
|
message(STATUS "Git revision: ${GIT_COMMIT_STRING}")
|
||||||
|
|
||||||
# Write to file.
|
# Write to file.
|
||||||
@@ -56,7 +56,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${PYBIND11_DOWNLOAD_PATH}
|
|||||||
add_subdirectory(${PYBIND11_EXTRACTED_PATH})
|
add_subdirectory(${PYBIND11_EXTRACTED_PATH})
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# LOOT API
|
# libloot
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
@@ -88,16 +88,20 @@ set(LIBLOOT_SHARED_LIBRARY "${CMAKE_SHARED_LIBRARY_PREFIX}loot${CMAKE_SHARED_LIB
|
|||||||
# Python Module
|
# Python Module
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
pybind11_add_module(loot_api "${CMAKE_SOURCE_DIR}/src/main.cpp"
|
pybind11_add_module(libloot-python "${CMAKE_SOURCE_DIR}/src/main.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/src/convenience.cpp"
|
"${CMAKE_SOURCE_DIR}/src/convenience.cpp"
|
||||||
"${CMAKE_BINARY_DIR}/generated/wrapper_version.cpp")
|
"${CMAKE_BINARY_DIR}/generated/wrapper_version.cpp")
|
||||||
|
|
||||||
add_dependencies(loot_api libloot)
|
# Set the target output name to loot to follow common Python library naming
|
||||||
|
# conventions (no lib, no -python).
|
||||||
|
set_target_properties(libloot-python PROPERTIES OUTPUT_NAME loot)
|
||||||
|
|
||||||
|
add_dependencies(libloot-python libloot)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
target_link_libraries(loot_api PRIVATE ${LIBLOOT_STATIC_LIBRARY})
|
target_link_libraries(libloot-python PRIVATE ${LIBLOOT_STATIC_LIBRARY})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(loot_api PRIVATE ${LIBLOOT_SHARED_LIBRARY})
|
target_link_libraries(libloot-python PRIVATE ${LIBLOOT_SHARED_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@@ -106,29 +110,29 @@ endif()
|
|||||||
|
|
||||||
find_package(PythonInterp REQUIRED)
|
find_package(PythonInterp REQUIRED)
|
||||||
|
|
||||||
# Copy the API binary to the build directory.
|
# Copy the libloot binary to the build directory.
|
||||||
add_custom_command(TARGET loot_api POST_BUILD
|
add_custom_command(TARGET libloot-python POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
"${LIBLOOT_EXTRACTED_PATH}/${LIBLOOT_SHARED_LIBRARY}"
|
"${LIBLOOT_EXTRACTED_PATH}/${LIBLOOT_SHARED_LIBRARY}"
|
||||||
"$<TARGET_FILE_DIR:loot_api>/${LIBLOOT_SHARED_LIBRARY}")
|
"$<TARGET_FILE_DIR:libloot-python>/${LIBLOOT_SHARED_LIBRARY}")
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
add_test(NAME python
|
add_test(NAME python
|
||||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:loot_api>
|
WORKING_DIRECTORY $<TARGET_FILE_DIR:libloot-python>
|
||||||
COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_SOURCE_DIR}/test/test.py)
|
COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_SOURCE_DIR}/test/test.py)
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Install
|
# Install
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
install(TARGETS loot_api
|
install(TARGETS libloot-python
|
||||||
DESTINATION "loot_api"
|
DESTINATION "loot"
|
||||||
CONFIGURATIONS Release RelWithDebInfo)
|
CONFIGURATIONS Release RelWithDebInfo)
|
||||||
|
|
||||||
install(FILES "${LIBLOOT_EXTRACTED_PATH}/${LIBLOOT_SHARED_LIBRARY}"
|
install(FILES "${LIBLOOT_EXTRACTED_PATH}/${LIBLOOT_SHARED_LIBRARY}"
|
||||||
"${CMAKE_SOURCE_DIR}/python/loot_api/__init__.py"
|
"${CMAKE_SOURCE_DIR}/python/loot/__init__.py"
|
||||||
DESTINATION "loot_api"
|
DESTINATION "loot"
|
||||||
CONFIGURATIONS Release RelWithDebInfo)
|
CONFIGURATIONS Release RelWithDebInfo)
|
||||||
|
|
||||||
install(FILES "${CMAKE_SOURCE_DIR}/docs/README.md"
|
install(FILES "${CMAKE_SOURCE_DIR}/docs/README.md"
|
||||||
@@ -138,11 +142,11 @@ install(FILES "${CMAKE_SOURCE_DIR}/docs/README.md"
|
|||||||
CONFIGURATIONS Release RelWithDebInfo)
|
CONFIGURATIONS Release RelWithDebInfo)
|
||||||
|
|
||||||
IF (MSVC)
|
IF (MSVC)
|
||||||
install(FILES $<TARGET_PDB_FILE:loot_api>
|
install(FILES $<TARGET_PDB_FILE:libloot-python>
|
||||||
DESTINATION "loot_api"
|
DESTINATION "loot"
|
||||||
OPTIONAL
|
OPTIONAL
|
||||||
CONFIGURATIONS RelWithDebInfo
|
CONFIGURATIONS RelWithDebInfo
|
||||||
RENAME loot_api_python.pdb)
|
RENAME libloot-python.pdb)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
LOOT API Python Module
|
libloot-python
|
||||||
=======================
|
==============
|
||||||
|
|
||||||
[](https://ci.appveyor.com/project/LOOT/loot-api-python/branch/master)
|
[](https://ci.appveyor.com/project/LOOT/libloot-python/branch/master)
|
||||||
[](http://loot-api-python.readthedocs.io/)
|
[](http://loot-api-python.readthedocs.io/)
|
||||||
|
|
||||||
A Python module that wraps libloot, generated by [pybind11](https://github.com/pybind/pybind11). Not everything in the API is exposed: coverage can be extended on request (or by pull request).
|
A Python module that wraps libloot, generated by [pybind11](https://github.com/pybind/pybind11). Not everything in the API is exposed: coverage can be extended on request (or by pull request).
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
Snapshot builds are available on [Bintray](https://bintray.com/loot/snapshots/loot-api-python). The snapshot build archives are named like so:
|
Snapshot builds are available on [Bintray](https://bintray.com/loot/snapshots/libloot-python). The snapshot build archives are named like so:
|
||||||
|
|
||||||
```
|
```
|
||||||
loot_api_python-<short revision ID>-python<python version>-win<architecture>.zip
|
libloot-python-<short revision ID>-python<python version>-win<architecture>.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
For example `loot_api_python-94de368-python2.7-win32.zip` was built using the revision with shortened commit ID `94de368`.
|
For example `libloot-python-94de368-python2.7-win32.zip` was built using the revision with shortened commit ID `94de368`.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -35,7 +35,7 @@ before_build:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
verbosity: minimal
|
verbosity: minimal
|
||||||
project: 'c:\projects\loot-api-python\build\loot_api_python.sln'
|
project: 'c:\projects\libloot-python\build\libloot-python.sln'
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%\build
|
- cd %APPVEYOR_BUILD_FOLDER%\build
|
||||||
@@ -49,8 +49,8 @@ after_test:
|
|||||||
- ps: $env:ARCHITECTURE = $env:PLATFORM.substring($env:PLATFORM.length - 2)
|
- ps: $env:ARCHITECTURE = $env:PLATFORM.substring($env:PLATFORM.length - 2)
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: build\package\loot_api_python-$(PACKAGE_VERSION)-python$(PYTHON_VERSION)-win$(ARCHITECTURE).zip
|
- path: build\package\libloot-python-$(PACKAGE_VERSION)-python$(PYTHON_VERSION)-win$(ARCHITECTURE).zip
|
||||||
name: loot_api_python
|
name: libloot-python
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
- provider: BinTray
|
- provider: BinTray
|
||||||
@@ -59,22 +59,22 @@ deploy:
|
|||||||
secure: PgsEA6TjHVf718zMnK7J/fT1hUAVNKBeWhpYgYaeCyeZk37VT4Ics6j7+B7ElLEr
|
secure: PgsEA6TjHVf718zMnK7J/fT1hUAVNKBeWhpYgYaeCyeZk37VT4Ics6j7+B7ElLEr
|
||||||
subject: loot
|
subject: loot
|
||||||
repo: snapshots
|
repo: snapshots
|
||||||
package: loot-api-python
|
package: libloot-python
|
||||||
version: $(PACKAGE_VERSION)
|
version: $(PACKAGE_VERSION)
|
||||||
publish: true
|
publish: true
|
||||||
artifact: loot_api_python
|
artifact: libloot-python
|
||||||
|
|
||||||
- provider: GitHub
|
- provider: GitHub
|
||||||
tag: $(APPVEYOR_REPO_TAG_NAME)
|
tag: $(APPVEYOR_REPO_TAG_NAME)
|
||||||
release: LOOT API Python Module v$(APPVEYOR_REPO_TAG_NAME)
|
release: libloot-python v$(APPVEYOR_REPO_TAG_NAME)
|
||||||
description: |
|
description: |
|
||||||
Requires Windows 7 or later and the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
|
Requires Windows 7 or later and the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
|
||||||
auth_token:
|
auth_token:
|
||||||
secure: yDqT5l/e5MntbW99V6+MHlfFgNv+UIogFfeyUVqtFk5lFRB/dAraLLwKCLl6y+DH
|
secure: yDqT5l/e5MntbW99V6+MHlfFgNv+UIogFfeyUVqtFk5lFRB/dAraLLwKCLl6y+DH
|
||||||
artifact: loot_api_python
|
artifact: libloot-python
|
||||||
draft: false
|
draft: false
|
||||||
on:
|
on:
|
||||||
appveyor_repo_tag: true
|
appveyor_repo_tag: true
|
||||||
|
|
||||||
on_success:
|
on_success:
|
||||||
- ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -g loot/loot-api-python -b loot/snapshots/loot-api-python -u wrinklyninja -k $env:bintray_auth_token -t $env:github_auth_token -n 30
|
- ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -g loot/libloot-python -b loot/snapshots/libloot-python -u wrinklyninja -k $env:bintray_auth_token -t $env:github_auth_token -n 30
|
||||||
|
|||||||
+4
-4
@@ -1,13 +1,13 @@
|
|||||||
LOOT API Python Wrapper
|
libloot-python
|
||||||
=======================
|
==============
|
||||||
|
|
||||||
This archive contains a build of the LOOT API Python wrapper module and its corresponding 32-bit Windows build of the LOOT API.
|
This archive contains a build of the libloot-python wrapper module and its corresponding 32-bit Windows build of libloot.
|
||||||
|
|
||||||
The DLL requires the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe)
|
The DLL requires the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe)
|
||||||
to be installed.
|
to be installed.
|
||||||
|
|
||||||
See the [online documentation](http://loot-api-python.readthedocs.org/) for more information.
|
See the [online documentation](http://loot-api-python.readthedocs.org/) for more information.
|
||||||
The library source code is available [on GitHub](https://github.com/loot/loot-api-python).
|
The library source code is available [on GitHub](https://github.com/loot/libloot-python).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# LOOT API Python Module documentation build configuration file, created by
|
# libloot-python documentation build configuration file, created by
|
||||||
# sphinx-quickstart on Mon Aug 15 07:11:32 2016.
|
# sphinx-quickstart on Mon Aug 15 07:11:32 2016.
|
||||||
#
|
#
|
||||||
# This file is execfile()d with the current directory set to its
|
# This file is execfile()d with the current directory set to its
|
||||||
@@ -54,7 +54,7 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'LOOT API Python Module'
|
project = u'libloot-python'
|
||||||
copyright = u'2019, WrinklyNinja'
|
copyright = u'2019, WrinklyNinja'
|
||||||
author = u'WrinklyNinja'
|
author = u'WrinklyNinja'
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ html_theme = 'sphinx_rtd_theme'
|
|||||||
# The name for this set of Sphinx documents.
|
# The name for this set of Sphinx documents.
|
||||||
# "<project> v<release> documentation" by default.
|
# "<project> v<release> documentation" by default.
|
||||||
#
|
#
|
||||||
# html_title = u'LOOT API Python Module v;atest'
|
# html_title = u'libloot-python v;atest'
|
||||||
|
|
||||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||||
#
|
#
|
||||||
@@ -265,7 +265,7 @@ latex_elements = {
|
|||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(master_doc, 'LOOTAPIPythonModule.tex', u'LOOT API Python Module Documentation',
|
(master_doc, 'libloot-python.tex', u'libloot-python Documentation',
|
||||||
u'WrinklyNinja', 'manual'),
|
u'WrinklyNinja', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ latex_documents = [
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(master_doc, 'lootapipythonmodule', u'LOOT API Python Module Documentation',
|
(master_doc, 'libloot-python', u'libloot-python Documentation',
|
||||||
[author], 1)
|
[author], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -322,8 +322,8 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
(master_doc, 'LOOTAPIPythonModule', u'LOOT API Python Module Documentation',
|
(master_doc, 'libloot-python', u'libloot-python Documentation',
|
||||||
author, 'LOOTAPIPythonModule', 'One line description of project.',
|
author, 'libloot-python', 'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
.. LOOT API Python Module documentation master file, created by
|
.. libloot-python documentation master file, created by
|
||||||
sphinx-quickstart on Mon Aug 15 07:11:32 2016.
|
sphinx-quickstart on Mon Aug 15 07:11:32 2016.
|
||||||
You can adapt this file completely to your liking, but it should at least
|
You can adapt this file completely to your liking, but it should at least
|
||||||
contain the root `toctree` directive.
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
LOOT API Python Module
|
libloot-python
|
||||||
======================
|
==============
|
||||||
|
|
||||||
Contents:
|
Contents:
|
||||||
|
|
||||||
|
|||||||
+32
-33
@@ -2,8 +2,8 @@
|
|||||||
API Reference
|
API Reference
|
||||||
*************
|
*************
|
||||||
|
|
||||||
As this API is just a wrapper for LOOT's C++ API, its documentation is linked to
|
As this API is just a wrapper for libloot's C++ API, its documentation is linked
|
||||||
for all non-Python-specific information.
|
to for all non-Python-specific information.
|
||||||
|
|
||||||
Enumerations
|
Enumerations
|
||||||
============
|
============
|
||||||
@@ -12,9 +12,9 @@ The wrapped enumeration types below are classes in Python, but the distinction
|
|||||||
makes no difference in practice, so they're grouped here for semantics. All
|
makes no difference in practice, so they're grouped here for semantics. All
|
||||||
values are unsigned integer constants.
|
values are unsigned integer constants.
|
||||||
|
|
||||||
.. py:class:: loot_api.GameType
|
.. py:class:: loot.GameType
|
||||||
|
|
||||||
Wraps :cpp:type:`loot::GameType` to expose the LOOT API's game codes.
|
Wraps :cpp:type:`loot::GameType` to expose libloot's game codes.
|
||||||
|
|
||||||
.. py:attribute:: fo3
|
.. py:attribute:: fo3
|
||||||
.. py:attribute:: fo4
|
.. py:attribute:: fo4
|
||||||
@@ -23,9 +23,9 @@ values are unsigned integer constants.
|
|||||||
.. py:attribute:: tes5
|
.. py:attribute:: tes5
|
||||||
.. py:attribute:: tes5se
|
.. py:attribute:: tes5se
|
||||||
|
|
||||||
.. py:class:: loot_api.LogLevel
|
.. py:class:: loot.LogLevel
|
||||||
|
|
||||||
Wraps :cpp:type:`loot::LogLevel` to expose the LOOT API's log level codes.
|
Wraps :cpp:type:`loot::LogLevel` to expose libloot's log level codes.
|
||||||
|
|
||||||
.. py:attribute:: trace
|
.. py:attribute:: trace
|
||||||
.. py:attribute:: debug
|
.. py:attribute:: debug
|
||||||
@@ -34,16 +34,16 @@ values are unsigned integer constants.
|
|||||||
.. py:attribute:: error
|
.. py:attribute:: error
|
||||||
.. py:attribute:: fatal
|
.. py:attribute:: fatal
|
||||||
|
|
||||||
.. py:class:: loot_api.MessageType
|
.. py:class:: loot.MessageType
|
||||||
|
|
||||||
Wraps :cpp:type:`loot::MessageType` to expose the LOOT API's message type
|
Wraps :cpp:type:`loot::MessageType` to expose libloot's message type
|
||||||
codes.
|
codes.
|
||||||
|
|
||||||
.. py:attribute:: error
|
.. py:attribute:: error
|
||||||
.. py:attribute:: say
|
.. py:attribute:: say
|
||||||
.. py:attribute:: warn
|
.. py:attribute:: warn
|
||||||
|
|
||||||
.. py:class:: loot_api.PluginCleanliness
|
.. py:class:: loot.PluginCleanliness
|
||||||
|
|
||||||
Codes used to indicate the cleanliness of a plugin according to the
|
Codes used to indicate the cleanliness of a plugin according to the
|
||||||
information contained within the loaded masterlist/userlist.
|
information contained within the loaded masterlist/userlist.
|
||||||
@@ -70,7 +70,7 @@ Public-Field Data Structures
|
|||||||
|
|
||||||
Classes with public fields and no member functions.
|
Classes with public fields and no member functions.
|
||||||
|
|
||||||
.. py:class:: loot_api.MasterlistInfo
|
.. py:class:: loot.MasterlistInfo
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::MasterlistInfo`.
|
Wraps :cpp:class:`loot::MasterlistInfo`.
|
||||||
|
|
||||||
@@ -87,13 +87,13 @@ Classes with public fields and no member functions.
|
|||||||
A boolean that is true if the masterlist has been modified from its state
|
A boolean that is true if the masterlist has been modified from its state
|
||||||
at the commit given by :py:attr:`revision_id`.
|
at the commit given by :py:attr:`revision_id`.
|
||||||
|
|
||||||
.. py:class:: loot_api.SimpleMessage
|
.. py:class:: loot.SimpleMessage
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::SimpleMessage`.
|
Wraps :cpp:class:`loot::SimpleMessage`.
|
||||||
|
|
||||||
.. py:attribute:: type
|
.. py:attribute:: type
|
||||||
|
|
||||||
A :py:class:`loot_api.MessageType` giving the message type.
|
A :py:class:`loot.MessageType` giving the message type.
|
||||||
|
|
||||||
.. py:attribute:: language
|
.. py:attribute:: language
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ Classes with public fields and no member functions.
|
|||||||
|
|
||||||
A Unicode string containing the message condition.
|
A Unicode string containing the message condition.
|
||||||
|
|
||||||
.. py:class:: loot_api.PluginTags
|
.. py:class:: loot.PluginTags
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::PluginTags`.
|
Wraps :cpp:class:`loot::PluginTags`.
|
||||||
|
|
||||||
@@ -127,68 +127,68 @@ Classes with public fields and no member functions.
|
|||||||
Functions
|
Functions
|
||||||
=========
|
=========
|
||||||
|
|
||||||
.. py:function:: loot_api.set_logging_callback(callback) -> NoneType
|
.. py:function:: loot.set_logging_callback(callback) -> NoneType
|
||||||
|
|
||||||
Set the callback function that is called when logging. Wraps
|
Set the callback function that is called when logging. Wraps
|
||||||
:cpp:func:`loot::SetLoggingCallback`.
|
:cpp:func:`loot::SetLoggingCallback`.
|
||||||
|
|
||||||
.. py:function:: loot_api.is_compatible(int, int, int) -> bool
|
.. py:function:: loot.is_compatible(int, int, int) -> bool
|
||||||
|
|
||||||
Checks for API compatibility. Wraps :cpp:func:`loot::IsCompatible`.
|
Checks for API compatibility. Wraps :cpp:func:`loot::IsCompatible`.
|
||||||
|
|
||||||
.. py:function:: loot_api.create_game_handle(game : loot_api.GameType, game_path : unicode, [game_local_path : unicode = u'']) -> loot_api.GameInterface
|
.. py:function:: loot.create_game_handle(game : loot.GameType, game_path : unicode, [game_local_path : unicode = u'']) -> loot.GameInterface
|
||||||
|
|
||||||
Initialise a new game handle. Wraps :cpp:func:`loot::CreateGameHandle`.
|
Initialise a new game handle. Wraps :cpp:func:`loot::CreateGameHandle`.
|
||||||
|
|
||||||
Classes
|
Classes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
.. py:class:: loot_api.GameInterface
|
.. py:class:: loot.GameInterface
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::GameInterface`.
|
Wraps :cpp:class:`loot::GameInterface`.
|
||||||
|
|
||||||
.. py:function:: loot_api.get_database() -> loot_api.DatabaseInterface
|
.. py:function:: loot.get_database() -> loot.DatabaseInterface
|
||||||
|
|
||||||
Get a database handle. Wraps :cpp:func:`loot::GetDatabase`.
|
Get a database handle. Wraps :cpp:func:`loot::GetDatabase`.
|
||||||
|
|
||||||
.. py:function:: loot_api.load_current_load_order_state() -> NoneType
|
.. py:function:: loot.load_current_load_order_state() -> NoneType
|
||||||
|
|
||||||
Load the current load order state, discarding any previously held state.
|
Load the current load order state, discarding any previously held state.
|
||||||
Wraps :cpp:func:`loot::LoadCurrentLoadOrderState`.
|
Wraps :cpp:func:`loot::LoadCurrentLoadOrderState`.
|
||||||
|
|
||||||
.. py:class:: loot_api.DatabaseInterface
|
.. py:class:: loot.DatabaseInterface
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::DatabaseInterface`.
|
Wraps :cpp:class:`loot::DatabaseInterface`.
|
||||||
|
|
||||||
.. py:method:: get_masterlist_revision(loot_api.DatabaseInterface, unicode, bool) -> loot_api.MasterlistInfo
|
.. py:method:: get_masterlist_revision(loot.DatabaseInterface, unicode, bool) -> loot.MasterlistInfo
|
||||||
|
|
||||||
Gets the give masterlist’s source control revision. Wraps :cpp:func:`GetMasterlistRevision`.
|
Gets the give masterlist’s source control revision. Wraps :cpp:func:`GetMasterlistRevision`.
|
||||||
|
|
||||||
.. py:method:: get_plugin_metadata(loot_api.DatabaseInterface, plugin : unicode, [includeUserMetadata : bool = True, [evaluateConditions : bool = False]]) -> loot_api.PluginMetadata
|
.. py:method:: get_plugin_metadata(loot.DatabaseInterface, plugin : unicode, [includeUserMetadata : bool = True, [evaluateConditions : bool = False]]) -> loot.PluginMetadata
|
||||||
|
|
||||||
Get all a plugin’s loaded metadata. Wraps :cpp:func:`GetPluginMetadata`.
|
Get all a plugin’s loaded metadata. Wraps :cpp:func:`GetPluginMetadata`.
|
||||||
|
|
||||||
.. py:method:: get_plugin_cleanliness(loot_api.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot_api.PluginCleanliness
|
.. py:method:: get_plugin_cleanliness(loot.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot.PluginCleanliness
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
.. py:method:: get_plugin_tags(loot_api.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot_api.PluginTags
|
.. py:method:: get_plugin_tags(loot.DatabaseInterface, plugin : unicode, [evaluateConditions : bool = False]) -> loot.PluginTags
|
||||||
|
|
||||||
Outputs the Bash Tags suggested for addition and removal by the database for the given plugin.
|
Outputs the Bash Tags suggested for addition and removal by the database for the given plugin.
|
||||||
|
|
||||||
.. py:method:: load_lists(loot_api.DatabaseInterface, masterlist_path : unicode, [userlist_path : unicode = u'']) -> NoneType
|
.. py:method:: load_lists(loot.DatabaseInterface, masterlist_path : unicode, [userlist_path : unicode = u'']) -> NoneType
|
||||||
|
|
||||||
Loads the masterlist and userlist from the paths specified. Wraps :cpp:func:`LoadLists`.
|
Loads the masterlist and userlist from the paths specified. Wraps :cpp:func:`LoadLists`.
|
||||||
|
|
||||||
.. py:method:: update_masterlist(loot_api.DatabaseInterface, unicode, unicode, unicode) -> bool
|
.. py:method:: update_masterlist(loot.DatabaseInterface, unicode, unicode, unicode) -> bool
|
||||||
|
|
||||||
Updates the given masterlist using the given Git repository details. Wraps :cpp:func:`UpdateMasterlist`.
|
Updates the given masterlist using the given Git repository details. Wraps :cpp:func:`UpdateMasterlist`.
|
||||||
|
|
||||||
.. py:method:: write_minimal_list(loot_api.DatabaseInterface, unicode, bool) -> NoneType
|
.. py:method:: write_minimal_list(loot.DatabaseInterface, unicode, bool) -> NoneType
|
||||||
|
|
||||||
Writes a minimal metadata file containing only Bash Tag suggestions and/or cleanliness info from the loaded metadata. Wraps :cpp:func:`WriteMinimalList`.
|
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_api.Version
|
.. py:class:: loot.Version
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::LootVersion`.
|
Wraps :cpp:class:`loot::LootVersion`.
|
||||||
|
|
||||||
@@ -212,10 +212,9 @@ Classes
|
|||||||
|
|
||||||
Returns the API version as a string of the form ``major.minor.patch``
|
Returns the API version as a string of the form ``major.minor.patch``
|
||||||
|
|
||||||
.. py:class:: loot_api.WrapperVersion
|
.. py:class:: loot.WrapperVersion
|
||||||
|
|
||||||
Provides information about the version of the LOOT API Python wrapper that is
|
Provides information about the version of libloot-python that is being run.
|
||||||
being run.
|
|
||||||
|
|
||||||
.. py:attribute:: major
|
.. py:attribute:: major
|
||||||
|
|
||||||
@@ -237,11 +236,11 @@ Classes
|
|||||||
|
|
||||||
Returns the API version as a string of the form ``major.minor.patch``
|
Returns the API version as a string of the form ``major.minor.patch``
|
||||||
|
|
||||||
.. py:class:: loot_api.PluginMetadata
|
.. py:class:: loot.PluginMetadata
|
||||||
|
|
||||||
Wraps :cpp:class:`loot::PluginMetadata`.
|
Wraps :cpp:class:`loot::PluginMetadata`.
|
||||||
|
|
||||||
.. py:method:: get_simple_messages(loot_api.PluginMetadata, unicode) -> list<loot_api.SimpleMessage>
|
.. py:method:: get_simple_messages(loot.PluginMetadata, unicode) -> list<loot.SimpleMessage>
|
||||||
|
|
||||||
Get the plugin’s messages as SimpleMessage objects for the given language.
|
Get the plugin’s messages as SimpleMessage objects for the given language.
|
||||||
Wraps :cpp:func:`GetPluginMessages`.
|
Wraps :cpp:func:`GetPluginMessages`.
|
||||||
|
|||||||
+7
-7
@@ -7,8 +7,8 @@ Installing the wrapper
|
|||||||
|
|
||||||
Build archives contain two binaries:
|
Build archives contain two binaries:
|
||||||
|
|
||||||
* ``loot_api.pyd`` is the Python wrapper
|
* ``loot.*.pyd`` is the Python wrapper
|
||||||
* ``loot_api.dll`` is the C++ API DLL that the Python wrapper was built against.
|
* ``loot.dll`` is the C++ library DLL that the Python wrapper was built against.
|
||||||
|
|
||||||
The C++ DLL requires the `Visual C++ 2017 Redistributable (x86)`_
|
The C++ DLL requires the `Visual C++ 2017 Redistributable (x86)`_
|
||||||
to be installed.
|
to be installed.
|
||||||
@@ -27,10 +27,10 @@ Checking Compatibility
|
|||||||
To check if the module loaded is compatible with the version of the API that you
|
To check if the module loaded is compatible with the version of the API that you
|
||||||
developed against::
|
developed against::
|
||||||
|
|
||||||
>>> import loot_api
|
>>> import loot
|
||||||
>>> loot_api.is_compatible(0,14,0)
|
>>> loot.is_compatible(0,14,0)
|
||||||
True
|
True
|
||||||
>>> loot_api.is_compatible(0,9,0)
|
>>> loot.is_compatible(0,9,0)
|
||||||
False
|
False
|
||||||
|
|
||||||
Getting a Plugin's Bash Tag Suggestions
|
Getting a Plugin's Bash Tag Suggestions
|
||||||
@@ -38,8 +38,8 @@ Getting a Plugin's Bash Tag Suggestions
|
|||||||
|
|
||||||
To get a plugin's Bash Tag suggestions from a ``masterlist.yaml`` metadata file::
|
To get a plugin's Bash Tag suggestions from a ``masterlist.yaml`` metadata file::
|
||||||
|
|
||||||
>>> import loot_api
|
>>> import loot
|
||||||
>>> db = loot_api.create_game_handle(loot_api.GameType.tes4, 'C:\\path\\to\\oblivion\\directory')
|
>>> db = loot.create_game_handle(loot.GameType.tes4, 'C:\\path\\to\\oblivion\\directory')
|
||||||
>>> db.load_lists('masterlist.yaml')
|
>>> db.load_lists('masterlist.yaml')
|
||||||
>>> tags = db.get_plugin_tags(u'Unofficial Oblivion Patch.esp')
|
>>> tags = db.get_plugin_tags(u'Unofficial Oblivion Patch.esp')
|
||||||
>>> tags.added
|
>>> tags.added
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
from .loot import *
|
||||||
@@ -1 +0,0 @@
|
|||||||
from .loot_api import *
|
|
||||||
+4
-4
@@ -67,15 +67,15 @@ if not is_msvc_redist_installed(*MSVC_MIN_VERSION):
|
|||||||
|
|
||||||
# The version string is substituted in by CMake.
|
# The version string is substituted in by CMake.
|
||||||
setup(
|
setup(
|
||||||
name="loot-api",
|
name="libloot-python",
|
||||||
version="@LIBLOOT_PY_VERSION_MAJOR@.@LIBLOOT_PY_VERSION_MINOR@.@LIBLOOT_PY_VERSION_PATCH@",
|
version="@LIBLOOT_PY_VERSION_MAJOR@.@LIBLOOT_PY_VERSION_MINOR@.@LIBLOOT_PY_VERSION_PATCH@",
|
||||||
description="A Python module that wraps the LOOT API.",
|
description="A Python module that wraps libloot.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
url="https://github.com/loot/loot-api-python",
|
url="https://github.com/loot/libloot-python",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
package_data={"loot_api": ["loot_api*.pyd", "loot.dll"]},
|
package_data={"loot": ["loot*.pyd", "loot.dll"]},
|
||||||
distclass=BinaryDistribution,
|
distclass=BinaryDistribution,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
||||||
|
|||||||
+2
-2
@@ -22,8 +22,8 @@ along with LOOT. If not, see
|
|||||||
<https://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LOOT_API_PYTHON_CONVENIENCE
|
#ifndef LIBLOOT_PYTHON_CONVENIENCE
|
||||||
#define LOOT_API_PYTHON_CONVENIENCE
|
#define LIBLOOT_PYTHON_CONVENIENCE
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -175,8 +175,8 @@ void bindFunctions(pybind11::module& module) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PYBIND11_MODULE(loot_api, module) {
|
PYBIND11_MODULE(loot, module) {
|
||||||
module.doc() = "A Python module that wraps the LOOT API, generated by pybind11.";
|
module.doc() = "A Python module that wraps libloot, generated by pybind11.";
|
||||||
|
|
||||||
loot::bindEnums(module);
|
loot::bindEnums(module);
|
||||||
loot::bindClasses(module);
|
loot::bindClasses(module);
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
along with LOOT. If not, see
|
along with LOOT. If not, see
|
||||||
<https://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef LOOT_PLUGIN_CLEANLINESS
|
#ifndef LIBLOOT_PYTHON_PLUGIN_CLEANLINESS
|
||||||
#define LOOT_PLUGIN_CLEANLINESS
|
#define LIBLOOT_PYTHON_PLUGIN_CLEANLINESS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The namespace used by the LOOT API.
|
* The namespace used by libloot.
|
||||||
*/
|
*/
|
||||||
namespace loot {
|
namespace loot {
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-2
@@ -21,8 +21,8 @@
|
|||||||
along with LOOT. If not, see
|
along with LOOT. If not, see
|
||||||
<https://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef LOOT_PLUGIN_TAGS
|
#ifndef LIBLOOT_PYTHON_PLUGIN_TAGS
|
||||||
#define LOOT_PLUGIN_TAGS
|
#define LIBLOOT_PYTHON_PLUGIN_TAGS
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ along with LOOT. If not, see
|
|||||||
<https://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LOOT_API_PYTHON_WRAPPER_VERSION
|
#ifndef LIBLOOT_PYTHON_WRAPPER_VERSION
|
||||||
#define LOOT_API_PYTHON_WRAPPER_VERSION
|
#define LIBLOOT_PYTHON_WRAPPER_VERSION
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -9,15 +9,15 @@ import unittest
|
|||||||
|
|
||||||
sys.path.append(os.getcwd())
|
sys.path.append(os.getcwd())
|
||||||
|
|
||||||
from loot_api import Version
|
from loot import Version
|
||||||
from loot_api import WrapperVersion
|
from loot import WrapperVersion
|
||||||
from loot_api import GameType
|
from loot import GameType
|
||||||
from loot_api import SimpleMessage
|
from loot import SimpleMessage
|
||||||
from loot_api import MessageType
|
from loot import MessageType
|
||||||
from loot_api import PluginCleanliness
|
from loot import PluginCleanliness
|
||||||
from loot_api import create_game_handle
|
from loot import create_game_handle
|
||||||
from loot_api import is_compatible
|
from loot import is_compatible
|
||||||
from loot_api import set_logging_callback
|
from loot import set_logging_callback
|
||||||
|
|
||||||
def logging_callback(level, message):
|
def logging_callback(level, message):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user