aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-04 07:06:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-04 07:06:44 +0000
commit01c3a6940286ef2ad1e7a3cd9912e2c0ad057603 (patch)
tree4de222af70d652d33a3a7c5d14ea47212acdd39c /python
parent48bdff1a499e40190adef7c32ee6469540a50b6e (diff)
downloadpaludis-01c3a6940286ef2ad1e7a3cd9912e2c0ad057603.tar.gz
paludis-01c3a6940286ef2ad1e7a3cd9912e2c0ad057603.tar.xz
Include status updates whilst carrying out QA checks
Diffstat (limited to 'python')
-rw-r--r--python/qa.cc15
-rwxr-xr-xpython/qa_TEST.py3
-rwxr-xr-xpython/repository_TEST.py3
3 files changed, 21 insertions, 0 deletions
diff --git a/python/qa.cc b/python/qa.cc
index 5db3b20db..50303e722 100644
--- a/python/qa.cc
+++ b/python/qa.cc
@@ -41,6 +41,16 @@ struct QAReporterWrapper :
else
throw PythonMethodNotImplemented("QAReporter", "message");
}
+
+ void status(const std::string & msg)
+ {
+ Lock l(get_mutex());
+
+ if (bp::override f = get_override("status"))
+ f(msg);
+ else
+ throw PythonMethodNotImplemented("QAReporter", "status");
+ }
};
void expose_qa()
@@ -90,5 +100,10 @@ void expose_qa()
"message(QAMessage)\n"
"NEED_DOC"
)
+ .def("status", bp::pure_virtual(&QAReporter::status),
+ "status(str)\n"
+ "NEED_DOC"
+ )
;
}
+
diff --git a/python/qa_TEST.py b/python/qa_TEST.py
index a0facd6f1..07a86f337 100755
--- a/python/qa_TEST.py
+++ b/python/qa_TEST.py
@@ -57,6 +57,9 @@ class TestCase_03_QAReporter(unittest.TestCase):
def message(self, msg):
return 1
+ def status(self, str):
+ return 1
+
def test_01_create(self):
QAReporter()
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index aad3ab5ab..e6144a675 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -207,6 +207,9 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
def message(self, msg):
self.messages += 1
+ def status(self, msg):
+ return
+
qi = repo.qa_interface
self.assert_(isinstance(qi, RepositoryQAInterface))