fix(python-bindings): brought bindings in line with new namespace
This commit is contained in:
@@ -14,7 +14,7 @@ template <typename T>
|
||||
void def_config_get(py::module &m) {
|
||||
m.def("get",
|
||||
[](const std::string &key, T defaultValue) {
|
||||
return Config::getInstance().get<T>(key, defaultValue);
|
||||
return serif::config::Config::getInstance().get<T>(key, defaultValue);
|
||||
},
|
||||
py::arg("key"), py::arg("defaultValue"),
|
||||
"Get configuration value (type inferred from default)");
|
||||
@@ -28,28 +28,28 @@ void register_config_bindings(pybind11::module &config_submodule) {
|
||||
|
||||
config_submodule.def("loadConfig",
|
||||
[](const std::string& configFilePath) {
|
||||
return Config::getInstance().loadConfig(configFilePath);
|
||||
return serif::config::Config::getInstance().loadConfig(configFilePath);
|
||||
},
|
||||
py::arg("configFilePath"),
|
||||
"Load configuration from a YAML file.");
|
||||
|
||||
config_submodule.def("has",
|
||||
[](const std::string &key) {
|
||||
return Config::getInstance().has(key);
|
||||
return serif::config::Config::getInstance().has(key);
|
||||
},
|
||||
py::arg("key"),
|
||||
"Check if a key exists in the configuration.");
|
||||
|
||||
config_submodule.def("keys",
|
||||
[]() {
|
||||
return py::cast(Config::getInstance().keys());
|
||||
return py::cast(serif::config::Config::getInstance().keys());
|
||||
},
|
||||
"Get a list of all configuration keys.");
|
||||
|
||||
config_submodule.def("__repr__",
|
||||
[]() {
|
||||
std::ostringstream oss;
|
||||
oss << Config::getInstance(); // Use the existing operator<<
|
||||
oss << serif::config::Config::getInstance(); // Use the existing operator<<
|
||||
return std::string("<fourdsse_bindings.config module accessing C++ Singleton>\n") + oss.str();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user