summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeView.py
diff options
context:
space:
mode:
authorMichael Vogt <egon@top>2005-12-07 12:50:49 +0100
committerMichael Vogt <egon@top>2005-12-07 12:50:49 +0100
commita03af80fb420ac3889c46707fd9abaa3b6735f03 (patch)
treecc9ce22dc22ebc3ed250c801f8a6dc92d0239db6 /DistUpgrade/DistUpgradeView.py
parent1746af9a6a0440c5fe85cb782ef8afce58a8338b (diff)
downloadpython-apt-a03af80fb420ac3889c46707fd9abaa3b6735f03.tar.gz
* cleaned up the source in DistUpgrade, put the functions in multiple sources
Diffstat (limited to 'DistUpgrade/DistUpgradeView.py')
-rw-r--r--DistUpgrade/DistUpgradeView.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py
new file mode 100644
index 00000000..98e80c08
--- /dev/null
+++ b/DistUpgrade/DistUpgradeView.py
@@ -0,0 +1,38 @@
+
+class DistUpgradeView(object):
+ " abstraction for the upgrade view "
+ def __init__(self):
+ pass
+ def getOpCacheProgress(self):
+ " return a OpProgress() subclass for the given graphic"
+ return apt.progress.OpProgress()
+ def getFetchProgress(self):
+ " return a fetch progress object "
+ return apt.progress.FetchProgress()
+ def getInstallProgress(self):
+ " return a install progress object "
+ return apt.progress.InstallProgress()
+ def updateStatus(self, msg):
+ """ update the current status of the distUpgrade based
+ on the current view
+ """
+ pass
+ def confirmChanges(self, 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))
+ def askYesNoQuestion(self, summary, msg):
+ " ask a Yes/No question and return True on 'Yes' "
+ pass
+ def error(self, summary, msg):
+ " display a error "
+ pass