aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-07-06 19:22:51 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-07-06 19:22:51 +0100
commitb27d1e71a9be412f057c0ee873709ea4ca8964b0 (patch)
treefffe25ff619bc80929c8261df683c42ae9bc8810
parent2c58ebc323b45ec1e8fa0902741fad331c1bbb7e (diff)
downloadpaludis-b27d1e71a9be412f057c0ee873709ea4ca8964b0.tar.gz
paludis-b27d1e71a9be412f057c0ee873709ea4ca8964b0.tar.xz
Wrap PackageID::uniquely_identifying_spec
-rw-r--r--python/package_id.cc7
-rwxr-xr-xpython/package_id_TEST.py3
2 files changed, 10 insertions, 0 deletions
diff --git a/python/package_id.cc b/python/package_id.cc
index 384f924..88ac8f9 100644
--- a/python/package_id.cc
+++ b/python/package_id.cc
@@ -26,6 +26,7 @@
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/action.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
using namespace paludis;
@@ -180,6 +181,12 @@ void expose_package_id()
"The choices_key, if not None, indicates the package's choices."
)
+ .def("uniquely_identifying_spec", &PackageID::uniquely_identifying_spec,
+ "A PackageDepSpec that uniquely identifies us.\n\n"
+ "When stringified, can be turned back into an equivalent unique "
+ "PackageDepSpec by using parse_user_package_dep_spec."
+ )
+
.def("__eq__", &py_eq<PackageID>)
.def("__ne__", &py_ne<PackageID>)
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index bd821e7..68b52b4 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -152,6 +152,9 @@ class TestCase_01_PackageID(unittest.TestCase):
def test_31_choices_key(self):
self.assert_(isinstance(self.pid.choices_key().parse_value(), Choices))
+ def test_32_uniquely_identifying_spec(self):
+ self.assert_(isinstance(self.pid.uniquely_identifying_spec(), PackageDepSpec))
+
if __name__ == "__main__":
unittest.main()