mirror of
https://github.com/loot/libloot-python.git
synced 2026-07-27 14:14:13 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a564f230be | ||
|
|
27c8f58494 | ||
|
|
179125f006 | ||
|
|
671ca81beb | ||
|
|
7faa360790 | ||
|
|
0c9d014174 | ||
|
|
a8e2b11280 |
+3
-3
@@ -30,7 +30,7 @@ configure_file("${CMAKE_SOURCE_DIR}/src/wrapper_version.cpp.in" "${CMAKE_BINARY_
|
|||||||
# pybind11
|
# pybind11
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
set(PYBIND11_VERSION "2.2.1")
|
set(PYBIND11_VERSION "2.2.2")
|
||||||
set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz")
|
set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz")
|
||||||
set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}.tar.gz")
|
set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}.tar.gz")
|
||||||
set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}")
|
set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}")
|
||||||
@@ -50,9 +50,9 @@ add_subdirectory(${PYBIND11_EXTRACTED_PATH})
|
|||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
set(LOOT_API_URL "https://github.com/loot/loot-api/releases/download/0.12.0/loot_api-0.12.0-0-g42cacca_dev-win32.7z")
|
set(LOOT_API_URL "https://github.com/loot/loot-api/releases/download/0.13.1/loot_api-0.13.1-0-g1804e45_dev-win32.7z")
|
||||||
else()
|
else()
|
||||||
set(LOOT_API_URL "https://github.com/loot/loot-api/releases/download/0.12.0/loot-api.tar.xz")
|
set(LOOT_API_URL "https://github.com/loot/loot-api/releases/download/0.13.1/loot-api.tar.xz")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(loot-api-c++
|
ExternalProject_Add(loot-api-c++
|
||||||
|
|||||||
+4
-3
@@ -136,12 +136,13 @@ Functions
|
|||||||
|
|
||||||
Checks for API compatibility. Wraps :cpp:func:`loot::IsCompatible`.
|
Checks for API compatibility. Wraps :cpp:func:`loot::IsCompatible`.
|
||||||
|
|
||||||
.. py:function:: loot_api.InitialiseLocale(unicode) -> NoneType
|
.. py:function:: loot_api.InitialiseLocale(unicode = u'') -> NoneType
|
||||||
|
|
||||||
Initialise the current global locale using the given ID. Wraps
|
Initialise the current global locale using the given ID. A blank value means
|
||||||
|
that the system default locale will be initialised. Wraps
|
||||||
:cpp:func:`loot::InitialiseLocale`.
|
:cpp:func:`loot::InitialiseLocale`.
|
||||||
|
|
||||||
.. py:function:: loot_api.create_game_handle(game : loot_api.GameType, [game_path : unicode = u'', [game_local_path : unicode = u'']]) -> loot_api.GameInterface
|
.. py:function:: loot_api.create_game_handle(game : loot_api.GameType, game_path : unicode, [game_local_path : unicode = u'']) -> loot_api.GameInterface
|
||||||
|
|
||||||
Initialise a new game handle. Wraps :cpp:func:`loot::CreateGameHandle`.
|
Initialise a new game handle. Wraps :cpp:func:`loot::CreateGameHandle`.
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -28,7 +28,7 @@ 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_api
|
||||||
>>> loot_api.is_compatible(0,10,0)
|
>>> loot_api.is_compatible(0,12,0)
|
||||||
True
|
True
|
||||||
>>> loot_api.is_compatible(0,9,0)
|
>>> loot_api.is_compatible(0,9,0)
|
||||||
False
|
False
|
||||||
@@ -39,8 +39,9 @@ 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_api
|
||||||
>>> db = loot_api.create_database(loot_api.GameType.tes4, '', '')
|
>>> loot_api.initialise_locale()
|
||||||
>>> db.load_lists('masterlist.yaml', '')
|
>>> db = loot_api.create_game_handle(loot_api.GameType.tes4, 'C:\\path\\to\\oblivion\\directory')
|
||||||
|
>>> 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
|
||||||
set([u'Scripts', u'Relations', u'C.Owner', u'Actors.AIPackages', u'Actors.Stats', u'Actors.ACBS', u'C.Music', u'Factions', u'Invent', u'Relev', u'Names', u'C.Light', u'Delev', u'C.Name', u'C.Climate', u'NPC.Class', u'Stats', u'Actors.DeathItem', u'Creatures.Blood', u'Actors.CombatStyle', u'Actors.AIData'])
|
set([u'Scripts', u'Relations', u'C.Owner', u'Actors.AIPackages', u'Actors.Stats', u'Actors.ACBS', u'C.Music', u'Factions', u'Invent', u'Relev', u'Names', u'C.Light', u'Delev', u'C.Name', u'C.Climate', u'NPC.Class', u'Stats', u'Actors.DeathItem', u'Creatures.Blood', u'Actors.CombatStyle', u'Actors.AIData'])
|
||||||
|
|||||||
+7
-5
@@ -41,9 +41,11 @@ void bindEnums(pybind11::module& module) {
|
|||||||
.value("tes4", GameType::tes4)
|
.value("tes4", GameType::tes4)
|
||||||
.value("tes5", GameType::tes5)
|
.value("tes5", GameType::tes5)
|
||||||
.value("tes5se", GameType::tes5se)
|
.value("tes5se", GameType::tes5se)
|
||||||
|
.value("tes5vr", GameType::tes5vr)
|
||||||
.value("fo3", GameType::fo3)
|
.value("fo3", GameType::fo3)
|
||||||
.value("fonv", GameType::fonv)
|
.value("fonv", GameType::fonv)
|
||||||
.value("fo4", GameType::fo4);
|
.value("fo4", GameType::fo4)
|
||||||
|
.value("fo4vr", GameType::fo4vr);
|
||||||
|
|
||||||
enum_<LogLevel>(module, "LogLevel")
|
enum_<LogLevel>(module, "LogLevel")
|
||||||
.value("trace", LogLevel::trace)
|
.value("trace", LogLevel::trace)
|
||||||
@@ -135,11 +137,11 @@ void bindFunctions(pybind11::module& module) {
|
|||||||
|
|
||||||
module.def("is_compatible", &IsCompatible);
|
module.def("is_compatible", &IsCompatible);
|
||||||
|
|
||||||
module.def("initialise_locale", &InitialiseLocale);
|
module.def("initialise_locale", &InitialiseLocale, arg("id") = "");
|
||||||
|
|
||||||
module.def("create_game_handle", &CreateGameHandle,
|
module.def("create_game_handle", &CreateGameHandle,
|
||||||
arg("game"),
|
arg("game"),
|
||||||
arg("game_path") = "",
|
arg("game_path"),
|
||||||
arg("game_local_path") = "");
|
arg("game_local_path") = "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -18,7 +18,7 @@ def logging_callback(level, message):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
set_logging_callback(logging_callback)
|
set_logging_callback(logging_callback)
|
||||||
initialise_locale("")
|
initialise_locale()
|
||||||
|
|
||||||
class GameFixture(unittest.TestCase):
|
class GameFixture(unittest.TestCase):
|
||||||
game_path = os.path.join(u'.', u'Oblivion')
|
game_path = os.path.join(u'.', u'Oblivion')
|
||||||
@@ -40,22 +40,22 @@ class GameFixture(unittest.TestCase):
|
|||||||
class TestLootApi(GameFixture):
|
class TestLootApi(GameFixture):
|
||||||
def test_is_compatible(self):
|
def test_is_compatible(self):
|
||||||
self.assertFalse(is_compatible(0, 9, 0))
|
self.assertFalse(is_compatible(0, 9, 0))
|
||||||
self.assertTrue(is_compatible(0, 12, 0))
|
self.assertTrue(is_compatible(0, 13, 0))
|
||||||
|
|
||||||
def test_version(self):
|
def test_version(self):
|
||||||
self.assertEqual(Version.major, 0)
|
self.assertEqual(Version.major, 0)
|
||||||
self.assertEqual(Version.minor, 12)
|
self.assertEqual(Version.minor, 13)
|
||||||
self.assertEqual(Version.patch, 0)
|
self.assertEqual(Version.patch, 1)
|
||||||
self.assertNotEqual(Version.revision, u'')
|
self.assertNotEqual(Version.revision, u'')
|
||||||
self.assertEqual(Version.string(), "0.12.0")
|
self.assertEqual(Version.string(), "0.13.1")
|
||||||
|
|
||||||
def test_wrapper_version(self):
|
def test_wrapper_version(self):
|
||||||
self.assertEqual(WrapperVersion.major, 3)
|
self.assertEqual(WrapperVersion.major, 3)
|
||||||
self.assertEqual(WrapperVersion.minor, 0)
|
self.assertEqual(WrapperVersion.minor, 1)
|
||||||
self.assertEqual(WrapperVersion.patch, 0)
|
self.assertEqual(WrapperVersion.patch, 0)
|
||||||
self.assertNotEqual(WrapperVersion.revision, u'')
|
self.assertNotEqual(WrapperVersion.revision, u'')
|
||||||
self.assertNotEqual(WrapperVersion.revision, Version.revision)
|
self.assertNotEqual(WrapperVersion.revision, Version.revision)
|
||||||
self.assertEqual(WrapperVersion.string(), "3.0.0")
|
self.assertEqual(WrapperVersion.string(), "3.1.0")
|
||||||
|
|
||||||
def test_create_db(self):
|
def test_create_db(self):
|
||||||
game = create_game_handle(GameType.tes4, self.game_path, self.local_path)
|
game = create_game_handle(GameType.tes4, self.game_path, self.local_path)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
namespace loot {
|
namespace loot {
|
||||||
const unsigned int WrapperVersion::major = 3;
|
const unsigned int WrapperVersion::major = 3;
|
||||||
const unsigned int WrapperVersion::minor = 0;
|
const unsigned int WrapperVersion::minor = 1;
|
||||||
const unsigned int WrapperVersion::patch = 0;
|
const unsigned int WrapperVersion::patch = 0;
|
||||||
const std::string WrapperVersion::revision = "@GIT_COMMIT_STRING@";
|
const std::string WrapperVersion::revision = "@GIT_COMMIT_STRING@";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user