Skip to content

Commit

Permalink
python: Expose tokens for Meta object
Browse files Browse the repository at this point in the history
  • Loading branch information
metiu07 committed Mar 15, 2021
1 parent 974ba1e commit 3d0a0f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/python/yaramod_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ void addBasicClasses(py::module& module)

py::class_<Meta>(module, "Meta")
.def_property("key", &Meta::getKey, &Meta::setKey)
.def_property("value", &Meta::getValue, &Meta::setValue);
.def_property("value", &Meta::getValue, &Meta::setValue)
.def_property_readonly("token_key", [](Meta& self) {
return *self.getKeyTokenIt();
})
.def_property_readonly("token_value", [](Meta& self) {
return *self.getValueTokenIt();
});

py::class_<Variable>(module, "Variable")
.def_property("key", &Variable::getKey, &Variable::setKey)
Expand Down

0 comments on commit 3d0a0f7

Please sign in to comment.