summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgrade.cfg4
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py2
-rw-r--r--DistUpgrade/DistUpgradeViewNonInteractive.py3
-rwxr-xr-xDistUpgrade/dist-upgrade.py13
4 files changed, 18 insertions, 4 deletions
diff --git a/DistUpgrade/DistUpgrade.cfg b/DistUpgrade/DistUpgrade.cfg
index f4491202..e081313a 100644
--- a/DistUpgrade/DistUpgrade.cfg
+++ b/DistUpgrade/DistUpgrade.cfg
@@ -1,3 +1,7 @@
+[View]
+View=DistUpgradeViewGtk
+#View=DistUpgradeViewNonInteractive
+
# Distro contains global information about the upgrade
[Distro]
# the meta-pkgs we support
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index c8fd5ba4..b4ad4a0a 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -173,7 +173,7 @@ class GtkInstallProgressAdapter(InstallProgress):
time.sleep(0.01)
-class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp):
+class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
" gtk frontend of the distUpgrade tool "
diff --git a/DistUpgrade/DistUpgradeViewNonInteractive.py b/DistUpgrade/DistUpgradeViewNonInteractive.py
index f6845a49..7a8fa7eb 100644
--- a/DistUpgrade/DistUpgradeViewNonInteractive.py
+++ b/DistUpgrade/DistUpgradeViewNonInteractive.py
@@ -30,9 +30,10 @@ class NonInteractiveInstallProgress(apt.progress.InstallProgress):
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 NonInteractiveDistUpgradeView(DistUpgradeView):
+class DistUpgradeViewNonInteractive(DistUpgradeView):
" non-interactive version of the upgrade view "
def __init__(self):
pass
diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py
index 14f9f4a1..437be42d 100755
--- a/DistUpgrade/dist-upgrade.py
+++ b/DistUpgrade/dist-upgrade.py
@@ -1,10 +1,10 @@
#!/usr/bin/python2.4
-from DistUpgradeViewGtk import GtkDistUpgradeView
from DistUpgradeControler import DistUpgradeControler
from DistUpgradeConfigParser import DistUpgradeConfig
import logging
import os
+import sys
if __name__ == "__main__":
@@ -13,7 +13,16 @@ if __name__ == "__main__":
format='%(asctime)s %(levelname)s %(message)s',
filemode='w')
- view = GtkDistUpgradeView()
+ config = DistUpgradeConfig()
+ requested_view= config.get("View","View")
+ try:
+ view_modul = __import__(requested_view)
+ view_class = getattr(view_modul, requested_view)
+ view = view_class()
+ except (ImportError, AttributeError):
+ logging.error("can't import view '%s'" % requested_view)
+ print "can't find %s" % requested_view
+ sys.exit(1)
app = DistUpgradeControler(view)
app.run()