Skip to content

Commit

Permalink
Add Python binding for myPath
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jun 20, 2023
1 parent ef8b999 commit 31cd845
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/binding/python/Attributable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ bool setAttributeFromObject(

void init_Attributable(py::module &m)
{
py::class_<Attributable::MyPath>(m, "AttributablePath")
.def_readonly("directory", &Attributable::MyPath::directory)
.def_readonly("series_name", &Attributable::MyPath::seriesName)
.def_readonly(
"series_extension", &Attributable::MyPath::seriesExtension)
.def_readonly("group", &Attributable::MyPath::group)
.def_property_readonly("file_path", &Attributable::MyPath::filePath);

py::class_<Attributable>(m, "Attributable")
.def(py::init<Attributable const &>())

Expand Down Expand Up @@ -491,7 +499,8 @@ void init_Attributable(py::module &m)
.def_property(
"comment", &Attributable::comment, &Attributable::setComment)
// TODO remove in future versions (deprecated)
.def("set_comment", &Attributable::setComment);
.def("set_comment", &Attributable::setComment)
.def("my_path", &Attributable::myPath);

py::bind_vector<PyAttributeKeys>(m, "Attribute_Keys");
}

0 comments on commit 31cd845

Please sign in to comment.