diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-04 15:37:41 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-04 15:37:41 +0000 |
| commit | 52d4a8c09000ea446458ff401f2c0a9d620212cb (patch) | |
| tree | 7083393d87efddb4aecf8cc583e67865808d1ac3 /DistUpgrade/dist-upgrade.py | |
| parent | 694ea8be861e66124617709eba63408da07e10c5 (diff) | |
| download | python-apt-52d4a8c09000ea446458ff401f2c0a9d620212cb.tar.gz | |
* view can be configured via the config file now
Diffstat (limited to 'DistUpgrade/dist-upgrade.py')
| -rwxr-xr-x | DistUpgrade/dist-upgrade.py | 13 |
1 files changed, 11 insertions, 2 deletions
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() |
