diff --git a/src/main.cpp b/src/main.cpp index ff1d5d1..3623d78 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,9 +41,12 @@ PYBIND11_PLUGIN(loot_api) { using loot::PluginMessage; using loot::PluginTags; + using pybind11::arg; using pybind11::enum_; using pybind11::class_; + const std::string emptyString; + pybind11::module module("loot_api", "A Python module that wraps the LOOT API, generated by pybind11."); enum_(module, "GameType", "Wraps :cpp:type:`GameType `.") @@ -99,7 +102,7 @@ PYBIND11_PLUGIN(loot_api) { .def("string", LootVersion::string); class_>(module, "DatabaseInterface", "Wraps :cpp:class:`DatabaseInterface `.") - .def("load_lists", &DatabaseInterface::LoadLists, "Loads the masterlist and userlist from the paths specified. Wraps :cpp:func:`LoadLists`.") + .def("load_lists", &DatabaseInterface::LoadLists, arg("masterlist_path"), arg("userlist_path") = emptyString, "Loads the masterlist and userlist from the paths specified. Wraps :cpp:func:`LoadLists`.") .def("eval_lists", &DatabaseInterface::EvalLists, "Evaluates all conditions and regular expression metadata entries in the loaded metadata lists. Wraps :cpp:func:`EvalLists`.") .def("sort_plugins", &DatabaseInterface::SortPlugins, "Calculates a new load order for all a game's installed plugins and outputs the sorted order. Wraps :cpp:func:`SortPlugins`.") .def("update_masterlist", &DatabaseInterface::UpdateMasterlist, "Updates the given masterlist using the given Git repository details. Wraps :cpp:func:`UpdateMasterlist`.") @@ -111,7 +114,7 @@ PYBIND11_PLUGIN(loot_api) { module.def("is_compatible", &IsCompatible, "Checks for API compatibility. Wraps :cpp:func:`IsCompatible `."); - module.def("create_database", &CreateDatabase, "Initialise a new database handle. Wraps :cpp:func:`CreateDatabase `."); + module.def("create_database", &CreateDatabase, arg("game"), arg("game_path") = emptyString, arg("game_local_path") = emptyString, "Initialise a new database handle. Wraps :cpp:func:`CreateDatabase `."); return module.ptr(); }