diff options
author | 2011-06-12 01:11:43 +0100 | |
---|---|---|
committer | 2011-06-12 01:12:11 +0100 | |
commit | 0c9893ceeca308897238e4c2190607d570f7feba (patch) | |
tree | 9c705b1f4bb1ece4790f3f547e993f4d72e8cd0f /python | |
parent | 8653241b4e943999757f30451f24a2ccc8d9862c (diff) | |
download | paludis-0c9893ceeca308897238e4c2190607d570f7feba.tar.gz paludis-0c9893ceeca308897238e4c2190607d570f7feba.tar.xz |
Kill AssociationMask
Diffstat (limited to 'python')
-rw-r--r-- | python/additional_tests.cc | 7 | ||||
-rw-r--r-- | python/mask.cc | 76 | ||||
-rwxr-xr-x | python/mask_TEST.py | 14 | ||||
-rwxr-xr-x | python/mask_TEST_setup.sh | 4 |
4 files changed, 0 insertions, 101 deletions
diff --git a/python/additional_tests.cc b/python/additional_tests.cc index a9671ff2e..8f81263cf 100644 --- a/python/additional_tests.cc +++ b/python/additional_tests.cc @@ -118,12 +118,6 @@ namespace mask test_mask(m); m.explanation(); } - - void test_association_mask(AssociationMask & m) - { - test_mask(m); - m.associated_package_spec(); - } } namespace metadata_key @@ -209,7 +203,6 @@ void expose_additional_tests() bp::def("test_unaccepted_mask", &mask::test_unaccepted_mask); bp::def("test_repository_mask", &mask::test_repository_mask); bp::def("test_unsupported_mask", &mask::test_unsupported_mask); - bp::def("test_association_mask", &mask::test_association_mask); /** * MetadataKey tests diff --git a/python/mask.cc b/python/mask.cc index ce48d4be1..71e12d99b 100644 --- a/python/mask.cc +++ b/python/mask.cc @@ -60,11 +60,6 @@ class MaskSptrToPythonVisitor { obj = bp::object(std::static_pointer_cast<const UnsupportedMask>(_m_ptr)); } - - void visit(const AssociationMask & m) - { - obj = bp::object(std::static_pointer_cast<const AssociationMask>(_m_ptr)); - } }; struct MaskSptrToPython @@ -268,42 +263,6 @@ struct UnsupportedMaskWrapper : } }; -struct AssociationMaskWrapper : - AssociationMask, - bp::wrapper<AssociationMask> -{ - virtual const PackageDepSpec associated_package_spec() const - { - Lock l(get_mutex()); - - if (bp::override f = get_override("associated_package_spec")) - return f(); - else - throw PythonMethodNotImplemented("AssociationMask", "associated_package_spec"); - } - - virtual char key() const - { - Lock l(get_mutex()); - - if (bp::override f = get_override("key")) - return f(); - else - throw PythonMethodNotImplemented("AssociationMask", "key"); - } - - virtual const std::string description() const - { - Lock l(get_mutex()); - - if (bp::override f = get_override("description")) - return f(); - else - throw PythonMethodNotImplemented("AssociationMask", "description"); - } -}; - - void expose_mask() { /** @@ -457,40 +416,5 @@ void expose_mask() "A description of the mask." ) ; - - /** - * AssociationMask - */ - bp::register_ptr_to_python<std::shared_ptr<const AssociationMask> >(); - bp::implicitly_convertible<std::shared_ptr<AssociationMaskWrapper>, std::shared_ptr<Mask> >(); - bp::class_<AssociationMaskWrapper, std::shared_ptr<AssociationMaskWrapper>, - bp::bases<Mask>, boost::noncopyable> - ( - "AssociationMask", - "An AssociationMask is a Mask that signifies that a PackageID is masked\n" - "because of its association with another PackageID that is itself masked.\n\n" - - "This is used by old-style virtuals. If the provider of a virtual is\n" - "masked then the virtual itself is masked by association.\n\n" - - "Can be subclassed in Python.", - bp::init<>() - ) - .def("associated_package_spec", bp::pure_virtual(&AssociationMask::associated_package_spec), - "associated_package_spec() -> PackageDepSpec\n" - "Fetch a spec for the associated package." - ) - - .def("key", bp::pure_virtual(&Mask::key), - "key() -> string\n" - "A single character key, which can be used by clients if they need\n" - "a very compact way of representing a mask." - ) - - .def("description", bp::pure_virtual(&Mask::description), - "description() -> string\n" - "A description of the mask." - ) - ; } diff --git a/python/mask_TEST.py b/python/mask_TEST.py index e9f722114..83660b5e2 100755 --- a/python/mask_TEST.py +++ b/python/mask_TEST.py @@ -133,20 +133,6 @@ class TestCase_02_Masks_subclassing(unittest.TestCase): test_unsupported_mask(TestUnsupportedMask()) - def test_05_association_mask(self): - class TestAssociationMask(AssociationMask): - def key(self): - return "T" - - def description(self): - return "test" - - def associated_package_spec(self): - e = EnvironmentFactory.instance.create("") - return parse_user_package_dep_spec("=masked/user-1.0", e, []) - - test_association_mask(TestAssociationMask()) - if __name__ == "__main__": unittest.main() diff --git a/python/mask_TEST_setup.sh b/python/mask_TEST_setup.sh index 681e98813..f0d49396d 100755 --- a/python/mask_TEST_setup.sh +++ b/python/mask_TEST_setup.sh @@ -23,10 +23,6 @@ USERLAND=test KERNEL=test END -cat <<END > profiles/testprofile/virtuals -virtual/association masked/repo -END - cat <<"END" > masked/repo/repo-1.0.ebuild || exit 1 DESCRIPTION="RepositoryMask" HOMEPAGE="http://paludis.pioto.org/" |