summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
authorKlaus Kämpf <kkaempf@suse.de>2011-08-30 16:05:23 +0200
committerKlaus Kämpf <kkaempf@suse.de>2011-08-30 16:05:23 +0200
commit9553aede296d749144a9b7e2980b1e6cac0b9344 (patch)
tree482cdefaed30bd2aa07ba491892f655604dbeed0 /swig
parentf37ab25474c8ae5dea487255c1e29489647041fa (diff)
downloadlibzypp-bindings-9553aede296d749144a9b7e2980b1e6cac0b9344.tar.gz
libzypp-bindings-9553aede296d749144a9b7e2980b1e6cac0b9344.tar.bz2
libzypp-bindings-9553aede296d749144a9b7e2980b1e6cac0b9344.zip
Add removal_finish and removal_problem, with docs
Diffstat (limited to 'swig')
-rw-r--r--swig/python/tests/commit_callbacks.py24
1 files changed, 24 insertions, 0 deletions
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