From c61e3a89cfe6ba039a503f6a28300146cfaab87a Mon Sep 17 00:00:00 2001 From: jgoerzen Date: Fri, 9 Aug 2002 22:12:09 +0100 Subject: [PATCH] /offlineimap/head: changeset 231 Applied part 2 of tv's patch --- offlineimap/head/offlineimap.py | 5 +---- offlineimap/head/offlineimap/ui/detector.py | 8 ++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/offlineimap/head/offlineimap.py b/offlineimap/head/offlineimap.py index d24f2e9..45164bb 100644 --- a/offlineimap/head/offlineimap.py +++ b/offlineimap/head/offlineimap.py @@ -64,10 +64,7 @@ else: path=None localeval = localeval.LocalEval(path) -if '-u' in options: - ui = offlineimap.ui.detector.getUImod(options['-u'])(config, localeval) -else: - ui = offlineimap.ui.detector.findUI(config, localeval) +ui = offlineimap.ui.detector.findUI(config, localeval, options.get('-u')) ui.init_banner() if '-d' in options: diff --git a/offlineimap/head/offlineimap/ui/detector.py b/offlineimap/head/offlineimap/ui/detector.py index 361ae7f..f33552d 100644 --- a/offlineimap/head/offlineimap/ui/detector.py +++ b/offlineimap/head/offlineimap/ui/detector.py @@ -19,7 +19,7 @@ import offlineimap.ui import sys -def findUI(config, localeval): +def findUI(config, localeval, chosenUI=None): uistrlist = ['Tk.Blinkenlights', 'Tk.VerboseUI', 'TTY.TTYUI', 'Noninteractive.Basic', 'Noninteractive.Quiet'] namespace={} @@ -27,8 +27,12 @@ def findUI(config, localeval): if ui.startswith('_') or ui=='detector': continue namespace[ui]=getattr(offlineimap.ui, ui) - if config.has_option("general", "ui"): + + if chosenUI is not None: + uistrlist = [chosenUI] + elif config.has_option("general", "ui"): uistrlist = config.get("general", "ui").replace(" ", "").split(",") + for uistr in uistrlist: uimod = getUImod(uistr, localeval, namespace) if uimod: