/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
|
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:
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user