diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-04-08 11:55:14 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-04-08 11:55:14 +0000 |
| commit | 08ea34d6a28b4b17d0146535e85d61ab7bda341d (patch) | |
| tree | 468c9348b1ee62208fdc60be8ad23a769e02e2b7 /doc/examples | |
| parent | 8f914ef267ab1bbcbda1c6694edd2e4c9b6401ec (diff) | |
| download | python-apt-08ea34d6a28b4b17d0146535e85d61ab7bda341d.tar.gz | |
* simple InstallProgress interface added
Diffstat (limited to 'doc/examples')
| -rw-r--r-- | doc/examples/inst.py | 4 | ||||
| -rw-r--r-- | doc/examples/progress.py | 23 |
2 files changed, 24 insertions, 3 deletions
diff --git a/doc/examples/inst.py b/doc/examples/inst.py index 3854805b..3269900f 100644 --- a/doc/examples/inst.py +++ b/doc/examples/inst.py @@ -5,7 +5,7 @@ import apt_pkg import sys import copy -from progress import OpProgress, FetchProgress +from progress import OpProgress, FetchProgress, InstallProgress # init @@ -22,7 +22,7 @@ depcache.Init(progress) # do something fprogress = FetchProgress() -iprogress = "lala" +iprogress = InstallProgress() iter = cache["base-config"] print "\n%s"%iter diff --git a/doc/examples/progress.py b/doc/examples/progress.py index f6cf1495..0dec95d1 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -1,5 +1,6 @@ import apt_pkg import sys +import time class OpProgress: def __init__(self): @@ -20,6 +21,13 @@ class OpProgress: class FetchProgress: def __init__(self): pass + + def Start(self): + pass + + def Stop(self): + pass + def UpdateStatus(self, uri, descr, shortDescr, status): print "UpdateStatus: '%s' '%s' '%s' '%i'" % (uri,descr,shortDescr, status) def Pulse(self): @@ -27,4 +35,17 @@ class FetchProgress: def MediaChange(self, medium, drive): print "Please insert medium %s in drive %s" % (medium, drive) - sys.stdin.readline()
\ No newline at end of file + sys.stdin.readline() + + +class InstallProgress: + def __init__(self): + pass + def StartUpdate(self): + print "StartUpdate" + def FinishUpdate(self): + print "FinishUpdate" + def UpdateInterface(self): + # usefull to e.g. redraw a GUI + time.sleep(0.1) + |
