aboutsummaryrefslogtreecommitdiff
path: root/python/slot_requirement.cc
diff options
context:
space:
mode:
authorAvatar Marvin Schmidt <marv@exherbo.org> 2017-02-10 12:45:45 +0100
committerAvatar Marvin Schmidt <marv@exherbo.org> 2017-02-10 16:56:05 +0100
commitd15113c505809477fcde40b05f020acb53959e89 (patch)
tree932b0e4d92075d2160bc04135c41a06a3b5c9d8b /python/slot_requirement.cc
parent5b704a9d2b1886437f5031a3270e1e5d83f441b7 (diff)
downloadpaludis-d15113c505809477fcde40b05f020acb53959e89.tar.gz
paludis-d15113c505809477fcde40b05f020acb53959e89.tar.xz
python: Expose slot(s) accessors of some SlotRequirement classes
Based on the initial work of Michał Górny <mgorny@gentoo.org> Fixes: ticket:1348 Change-Id: Id8e3fa358766caabd219d1926cd8a057304da34d
Diffstat (limited to 'python/slot_requirement.cc')
-rw-r--r--python/slot_requirement.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/slot_requirement.cc b/python/slot_requirement.cc
index 3317b56e8..292512c42 100644
--- a/python/slot_requirement.cc
+++ b/python/slot_requirement.cc
@@ -138,6 +138,7 @@ void expose_slot_requirement()
*/
register_shared_ptrs_to_python<SlotExactFullRequirement>(rsp_const);
bp::implicitly_convertible<std::shared_ptr<SlotExactFullRequirement>, std::shared_ptr<SlotRequirement> >();
+ bp::to_python_converter<std::pair<SlotName, SlotName>, pair_to_tuple<SlotName, SlotName>>();
bp::class_<SlotExactFullRequirement, std::shared_ptr<SlotExactFullRequirement>, bp::bases<SlotRequirement>, boost::noncopyable>
(
"SlotExactFullRequirement",
@@ -145,6 +146,11 @@ void expose_slot_requirement()
"such as ``:3/3`` or ``:=3/3``.",
bp::no_init
)
+
+ .add_property("slots", &SlotExactFullRequirement::slots,
+ "[ro] (SlotName, SlotName)\n"
+ "The slot parts in question."
+ )
;
/**
@@ -171,6 +177,11 @@ void expose_slot_requirement()
"A SlotAnyPartialLockedRequirement is a SlotRequirement for ``:3=`` slot requirements.",
bp::no_init
)
+
+ .add_property("slot", &SlotAnyPartialLockedRequirement::slot,
+ "[ro] SlotName\n"
+ "The slot in question."
+ )
;
/**