From 9553aede296d749144a9b7e2980b1e6cac0b9344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Tue, 30 Aug 2011 16:05:23 +0200 Subject: Add removal_finish and removal_problem, with docs --- swig/python/tests/commit_callbacks.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/swig/python/tests/commit_callbacks.py b/swig/python/tests/commit_callbacks.py index b7cc7d4..49e1232 100644 --- a/swig/python/tests/commit_callbacks.py +++ b/swig/python/tests/commit_callbacks.py @@ -71,10 +71,34 @@ class CommitReceiver: # # removal_progress() is called during a resolvable (typically package) uninstall # and be passed the resolvable to-be-removed and a percentage value + # Must return True (continue) or False (abort removal) # def removal_progress(self, resolvable, percentage): assert percentage == 42 print "Remove of ", resolvable, " at ", percentage, "%" + return True + + # + # removal_finish() is called after a resolvable (typically package) was uninstalled + # and be passed the resolvable to-be-removed and a status (string) with detail (string) + # status is either + # - "no_error": typical 'good' status + # - "not_found": resolvable not found (i.e. not installed) + # - "io": (disk) I/O error + # - "invalid": any other error + # + def removal_finish(self, resolvable, status, detail): + print "Remove of ", resolvable.name(), " finished with problem ", status, ": ", detail + + # + # report a problem during resolvable removal + # error is the same as 'status' of removal_finish() + # + # Must return "abort", "retry" or "ignore" + # + def removal_problem(self, resolvable, error, description): + print "Remove of ", resolvable.name(), " has problem ", error, ": ", description + return "ignore" # # Testcase for Callbacks -- cgit v1.2.3