summaryrefslogtreecommitdiff
path: root/doc/examples/progress.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-04-11 14:19:44 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-04-11 14:19:44 +0000
commita8074615c2bac880bf4fd7d5b15e621b88a20052 (patch)
tree4e929c12c6997452335d5620b5b5208affb83698 /doc/examples/progress.py
parent1b514e848902f609cba9b2247702fc6d714d2456 (diff)
downloadpython-apt-a8074615c2bac880bf4fd7d5b15e621b88a20052.tar.gz
* cdrom interface added
Diffstat (limited to 'doc/examples/progress.py')
-rw-r--r--doc/examples/progress.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/examples/progress.py b/doc/examples/progress.py
index c37de70d..67d39c9c 100644
--- a/doc/examples/progress.py
+++ b/doc/examples/progress.py
@@ -1,6 +1,7 @@
import apt_pkg
import sys
import time
+import string
class OpProgress:
def __init__(self):
@@ -36,6 +37,7 @@ class FetchProgress:
def MediaChange(self, medium, drive):
print "Please insert medium %s in drive %s" % (medium, drive)
sys.stdin.readline()
+ #return False
class InstallProgress:
@@ -48,3 +50,21 @@ class InstallProgress:
def UpdateInterface(self):
# usefull to e.g. redraw a GUI
time.sleep(0.1)
+
+
+class CdromProgress:
+ def __init__(self):
+ pass
+ # update is called regularly so that the gui can be redrawn
+ def Update(self, text, step):
+ # check if we actually have some text to display
+ if text != "":
+ print "Update: %s %s" % (string.strip(text), step)
+ def AskCdromName(self):
+ print "Please enter cd-name: ",
+ cd_name = sys.stdin.readline()
+ return (True, string.strip(cd_name))
+ def ChangeCdrom(self):
+ print "Please insert cdrom and press <ENTER>"
+ answer = sys.stdin.readline()
+ return True