Skip to content

Commit

Permalink
added missing python defs
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-trojan committed Apr 30, 2019
1 parent df5dcb0 commit 0cbb642
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/python-binding/python_definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ PYBIND11_PLUGIN(hal_py)
py::class_<hal::path>(m, "hal_path")
.def(py::init<>())
.def(py::init<const hal::path&>())
.def(py::init<const std::string&>());
.def(py::init<const std::string&>())
.def("__str__", [](hal::path& p) -> std::string { return std::string(p.c_str()); });

py::implicitly_convertible<std::string, hal::path>();

Expand Down Expand Up @@ -1104,6 +1105,18 @@ Gets the module's name.
Sets the module's name.
:param str name: The new name.
)")
.def("get_parent_module", &module::get_parent_module, R"(
Retrieves the parent module.
:returns: The module.
:rtype: hal_py.module
)")
.def("get_submodules", &module::get_submodules, py::arg("name_filter") = DONT_CARE, py::arg("recursive") = false, R"(
Retrieves all submodules of this module.
:returns: The module.
:rtype: set(hal_py.module)
)")
.def_property_readonly("gates", &module::get_gates, R"(
Returns all associated gates.
Expand Down

0 comments on commit 0cbb642

Please sign in to comment.