summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 20:36:14 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 20:36:14 +0200
commitf0dd9afe6d2ad9f3efa0d5c1abfedca75d125f1a (patch)
treeb80aaa5955e1325b54f85857caa9427d68dcc906
parent5bd42f18d1fe7cfca35dabdf22a2a14f11a3b353 (diff)
downloadpython-apt-f0dd9afe6d2ad9f3efa0d5c1abfedca75d125f1a.tar.gz
* DistUpgrade/DistUpgradeControler.py:
- added cdrom progress (for testing)
-rw-r--r--DistUpgrade/DistUpgradeControler.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index fce38b13..a6a78473 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -38,6 +38,23 @@ from gettext import gettext as _
import gettext
from DistUpgradeCache import MyCache
+class MyCdromProgress(apt.progress.CdromProgress):
+ """ Report the cdrom add progress
+ Subclass this class to implement cdrom add progress reporting
+ """
+ def __init__(self):
+ pass
+ def update(self, text, step):
+ """ update is called regularly so that the gui can be redrawn """
+ print "update()",text, step
+ pass
+ def askCdromName(self):
+ print "askCdromName"
+ return "lala"
+ def changeCdrom(self):
+ print "changeCdrom"
+
+
class AptCdrom(object):
def __init__(self, view, path):
self.view = view
@@ -61,10 +78,11 @@ class AptCdrom(object):
apt_pkg.Config.Find("Dir::State::cdroms"))
shutil.copy(cdromstate, cdromstate+backup_ext)
# do the actual work
- apt_pkg.Config.Set("Acquire::cdrom::mount",self.cdrompath);
+ apt_pkg.Config.Set("Acquire::cdrom::mount",self.cdrompath)
+ apt_pkg.Config.Set("APT::CDROM::NoMount","true")
cdrom = apt_pkg.GetCdrom()
# FIXME: add cdrom progress here for the view
- progress = apt.progress.CdromProgress()
+ progress = MyCdromProgress()
try:
res = cdrom.Add(progress)
except SystemError, e: