diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-06 10:38:42 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-06 10:38:42 +0100 |
| commit | de5a2ac303e5c7b0caa5419b87ea03ed6a4192ca (patch) | |
| tree | 7083393d87efddb4aecf8cc583e67865808d1ac3 /DistUpgrade/DistUpgradeViewNonInteractive.py | |
| parent | 7520aea4b9ea79e180aa9dca5eed719158b70d91 (diff) | |
| parent | 52d4a8c09000ea446458ff401f2c0a9d620212cb (diff) | |
| download | python-apt-de5a2ac303e5c7b0caa5419b87ea03ed6a4192ca.tar.gz | |
* merged from the laptop branch
Diffstat (limited to 'DistUpgrade/DistUpgradeViewNonInteractive.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeViewNonInteractive.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/DistUpgrade/DistUpgradeViewNonInteractive.py b/DistUpgrade/DistUpgradeViewNonInteractive.py index e8236565..7a8fa7eb 100644 --- a/DistUpgrade/DistUpgradeViewNonInteractive.py +++ b/DistUpgrade/DistUpgradeViewNonInteractive.py @@ -21,8 +21,19 @@ import apt import logging +import time +from DistUpgradeView import DistUpgradeView -class NonInteractiveDistUpgradeView(object): +class NonInteractiveInstallProgress(apt.progress.InstallProgress): + def error(self, pkg, errormsg): + logging.error("got a error from dpkg for pkg: '%s': '%s'" % (pkg, errormsg)) + def conffile(self, current, new): + logging.debug("got a conffile-prompt from dpkg for file: '%s'" % current) + def updateInterface(self): + apt.progress.InstallProgress.updateInterface(self) + time.sleep(0.001) + +class DistUpgradeViewNonInteractive(DistUpgradeView): " non-interactive version of the upgrade view " def __init__(self): pass @@ -34,7 +45,7 @@ class NonInteractiveDistUpgradeView(object): return apt.progress.FetchProgress() def getInstallProgress(self): " return a install progress object " - return apt.progress.InstallProgress() + return NonInteractiveInstallProgress() def updateStatus(self, msg): """ update the current status of the distUpgrade based on the current view @@ -50,18 +61,10 @@ class NonInteractiveDistUpgradeView(object): """ pass def confirmChanges(self, summary, changes, downloadSize): - """ display the list of changed packages (apt.Package) and - return if the user confirms them - """ - self.toInstall = [] - self.toUpgrade = [] - self.toRemove = [] - for pkg in changes: - if pkg.markedInstall: self.toInstall.append(pkg.name) - elif pkg.markedUpgrade: self.toUpgrade.append(pkg.name) - elif pkg.markedDelete: self.toRemove.append(pkg.name) - # no downgrades, re-installs - assert(len(self.toInstall)+len(self.toUpgrade)+len(self.toRemove) == len(changes)) + DistUpgradeView.confirmChanges(self, summary, changes, downloadSize) + logging.debug("toinstall: '%s'" % self.toInstall) + logging.debug("toupgrade: '%s'" % self.toUpgrade) + logging.debug("toremove: '%s'" % self.toRemove) return True def askYesNoQuestion(self, summary, msg): " ask a Yes/No question and return True on 'Yes' " @@ -71,5 +74,5 @@ class NonInteractiveDistUpgradeView(object): return False def error(self, summary, msg, extended_msg=None): " display a error " - logging.error("%s %s (%s)" % (summary, msg, extended_msg) + logging.error("%s %s (%s)" % (summary, msg, extended_msg)) |
