/offlineimap/head: changeset 231

Applied part 2 of tv's patch
This commit is contained in:
jgoerzen 2002-08-09 22:12:09 +01:00
parent 442c820f87
commit c61e3a89cf
2 changed files with 7 additions and 6 deletions

View File

@ -64,10 +64,7 @@ else:
path=None path=None
localeval = localeval.LocalEval(path) localeval = localeval.LocalEval(path)
if '-u' in options: ui = offlineimap.ui.detector.findUI(config, localeval, options.get('-u'))
ui = offlineimap.ui.detector.getUImod(options['-u'])(config, localeval)
else:
ui = offlineimap.ui.detector.findUI(config, localeval)
ui.init_banner() ui.init_banner()
if '-d' in options: if '-d' in options:

View File

@ -19,7 +19,7 @@
import offlineimap.ui import offlineimap.ui
import sys import sys
def findUI(config, localeval): def findUI(config, localeval, chosenUI=None):
uistrlist = ['Tk.Blinkenlights', 'Tk.VerboseUI', 'TTY.TTYUI', uistrlist = ['Tk.Blinkenlights', 'Tk.VerboseUI', 'TTY.TTYUI',
'Noninteractive.Basic', 'Noninteractive.Quiet'] 'Noninteractive.Basic', 'Noninteractive.Quiet']
namespace={} namespace={}
@ -27,8 +27,12 @@ def findUI(config, localeval):
if ui.startswith('_') or ui=='detector': if ui.startswith('_') or ui=='detector':
continue continue
namespace[ui]=getattr(offlineimap.ui, ui) 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(",") uistrlist = config.get("general", "ui").replace(" ", "").split(",")
for uistr in uistrlist: for uistr in uistrlist:
uimod = getUImod(uistr, localeval, namespace) uimod = getUImod(uistr, localeval, namespace)
if uimod: if uimod: