/offlineimap/head: changeset 231
Applied part 2 of tv's patch
This commit is contained in:
parent
442c820f87
commit
c61e3a89cf
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user