From 0f3e83010710cf3493c0c9f2bab16e5f028c114c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 2 Feb 2006 15:50:23 +0000 Subject: * make the Config-File more usable --- SoftwareProperties/aptsources.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'SoftwareProperties') diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 3e8d522e..c0d2c2ba 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -517,3 +517,5 @@ if __name__ == "__main__": "http://de.archive.ubuntu.com/ubuntu/") print "is_mirror(): %s" % mirror + print sources.is_mirror("http://archive.ubuntu.com/ubuntu", + "http://de.archive.ubuntu.com/ubuntu/") -- cgit v1.2.3 From 52d4a8c09000ea446458ff401f2c0a9d620212cb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 4 Feb 2006 15:37:41 +0000 Subject: * view can be configured via the config file now --- DistUpgrade/DistUpgrade.cfg | 4 ++++ DistUpgrade/DistUpgradeViewGtk.py | 2 +- DistUpgrade/DistUpgradeViewNonInteractive.py | 3 ++- DistUpgrade/dist-upgrade.py | 13 +++++++++++-- SoftwareProperties/__init__.py | 1 - UpdateManager/UpdateManager.py | 2 +- gnome-software-properties | 2 +- 7 files changed, 20 insertions(+), 7 deletions(-) (limited to 'SoftwareProperties') 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() diff --git a/SoftwareProperties/__init__.py b/SoftwareProperties/__init__.py index 1e6834bd..e69de29b 100644 --- a/SoftwareProperties/__init__.py +++ b/SoftwareProperties/__init__.py @@ -1 +0,0 @@ -from SoftwareProperties import SoftwareProperties diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index de77f041..3724de94 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -637,7 +637,7 @@ class UpdateManager(SimpleGladeApp): # self.window_main.set_sensitive(True) self.window_main.set_sensitive(False) from SoftwareProperties import SoftwareProperties - prop = SoftwareProperties(self.datadir, None) + prop = SoftwareProperties.SoftwareProperties(self.datadir, None) prop.window_main.set_transient_for(self.window_main) prop.run() prop.window_main.hide() diff --git a/gnome-software-properties b/gnome-software-properties index d5cbd0ce..a8074f7e 100644 --- a/gnome-software-properties +++ b/gnome-software-properties @@ -37,7 +37,7 @@ from optparse import OptionParser #sys.path.append("@prefix@/share/update-manager/python") -import SoftwareProperties +from SoftwareProperties import SoftwareProperties if __name__ == "__main__": _ = gettext.gettext -- cgit v1.2.3