aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-10 17:20:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-10 17:48:13 +0000
commit75e5230b9aa3ca5dc59cbc36be43d805f60150b3 (patch)
tree01401260490306f856579c46ae5aa0ae664ea887 /python
parent303e393a5b5b359160b9611a27db872ab09ea866 (diff)
downloadpaludis-75e5230b9aa3ca5dc59cbc36be43d805f60150b3.tar.gz
paludis-75e5230b9aa3ca5dc59cbc36be43d805f60150b3.tar.xz
Add overridden masks.
Fixes: ticket:369 Fixes: ticket:693
Diffstat (limited to 'python')
-rw-r--r--python/additional_tests.cc2
-rw-r--r--python/environment.cc9
-rwxr-xr-xpython/environment_TEST.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index 30b7e470d..b11691348 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -57,7 +57,7 @@ namespace environment
e.mask_for_breakage(*pid);
- e.mask_for_user(*pid);
+ e.mask_for_user(*pid, false);
bool PALUDIS_ATTRIBUTE((unused)) b4(e.unmasked_by_user(*pid));
diff --git a/python/environment.cc b/python/environment.cc
index ba1732dcc..fe15bd8f0 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -93,13 +93,13 @@ class EnvironmentImplementationWrapper :
throw PythonMethodNotImplemented("EnvironmentImplementation", "mask_for_breakage");
}
- virtual const std::tr1::shared_ptr<const Mask> mask_for_user(const PackageID & p) const
+ virtual const std::tr1::shared_ptr<const Mask> mask_for_user(const PackageID & p, const bool b) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
if (bp::override f = get_override("mask_for_user"))
- return f(boost::cref(p));
+ return f(boost::cref(p), b);
else
throw PythonMethodNotImplemented("EnvironmentImplementation", "mask_for_user");
}
@@ -571,9 +571,10 @@ void expose_environment()
)
.def("mask_for_user", bp::pure_virtual(&EnvImp::mask_for_user),
- "mask_for_user(PackageID) -> Mask\n"
+ "mask_for_user(PackageID, bool) -> Mask\n"
"Do we have a 'user' mask for a particular package?\n\n"
- "Returns None if no."
+ "Returns None if no. The second parameter should be true if the mask will be overridden "
+ "and false otherwise."
)
.def("unmasked_by_user", bp::pure_virtual(&EnvImp::unmasked_by_user),
diff --git a/python/environment_TEST.py b/python/environment_TEST.py
index 419a446fe..8155302c2 100755
--- a/python/environment_TEST.py
+++ b/python/environment_TEST.py
@@ -103,7 +103,7 @@ class TestCase_04_Environment_subclassingd(unittest.TestCase):
def mask_for_breakage(self, pid):
return UserMask()
- def mask_for_user(self, pid):
+ def mask_for_user(self, pid, b):
return UserMask()
def unmasked_by_user(self, pid):