diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/package_id.cc | 7 | ||||
-rwxr-xr-x | python/package_id_TEST.py | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/python/package_id.cc b/python/package_id.cc index 384f9242b..88ac8f93b 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 bd821e7a1..68b52b45e 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() |