diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-28 10:59:54 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-28 10:59:54 +0000 |
| commit | 55b2eeb0b63b544b3519b019f6d3969d88296618 (patch) | |
| tree | ef9a4ff5f89381b11d7fdd90de469758e7fa0ca4 /doc | |
| parent | 9861af130e14ec76fd6b5e945ac5d57d8128503c (diff) | |
| download | python-apt-55b2eeb0b63b544b3519b019f6d3969d88296618.tar.gz | |
* interface fixes for kamion, pychecker fixes
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/examples/progress.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/progress.py b/doc/examples/progress.py index d820fcb2..2723c382 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -44,12 +44,16 @@ class TextFetchProgress(apt.FetchProgress): class TextInstallProgress(apt.InstallProgress): def __init__(self): + apt.InstallProgress.__init__(self) pass def startUpdate(self): print "StartUpdate" def finishUpdate(self): print "FinishUpdate" + def statusChange(self, pkg, percent, status): + print "[%s] %s: %s" % (percent, pkg, status) def updateInterface(self): + apt.InstallProgress.updateInterface(self) # usefull to e.g. redraw a GUI time.sleep(0.1) @@ -70,3 +74,16 @@ class TextCdromProgress(apt.CdromProgress): print "Please insert cdrom and press <ENTER>" answer = sys.stdin.readline() return True + + +if __name__ == "__main__": + c = apt.Cache() + pkg = c["3dchess"] + if pkg.isInstalled: + pkg.markDelete() + else: + pkg.markInstall() + + res = c.commit(TextFetchProgress(), TextInstallProgress()) + + print res |
