summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-12-07 11:22:30 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-12-07 11:22:30 +0000
commita7073554674b0e9aaf262e4d981fbbb20713ac4a (patch)
tree429fbfb7b44cdf908e1a103501032793ed86e44d /doc
parentcce2b71c2fd64c8587238178c27a049ec450ce07 (diff)
downloadpython-apt-a7073554674b0e9aaf262e4d981fbbb20713ac4a.tar.gz
* InstallProgress.{error,conffile}() functions added
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/inst.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/examples/inst.py b/doc/examples/inst.py
index 66b61c54..0e91c28f 100644
--- a/doc/examples/inst.py
+++ b/doc/examples/inst.py
@@ -19,13 +19,20 @@ class TextInstallProgress(InstallProgress):
sys.stdout.write("\r[%s] %s\n" %(self.percent, self.status))
sys.stdout.flush()
self.last = self.percent
+ def conffile(self,current,new):
+ print "conffile prompt: %s %s" % (current,new)
+ def error(self, errorstr):
+ print "got dpkg error: '%s'" % errorstr
cache = apt.Cache(apt.progress.OpTextProgress())
fprogress = apt.progress.TextFetchProgress()
iprogress = TextInstallProgress()
-pkg = cache["base-config"]
+pkg = cache["test-package"]
+pkg.markUpgrade()
+cache.commit(fprogress,iprogress)
+sys.exit(1)
# install or remove, the importend thing is to keep us busy :)
if pkg.isInstalled: