--help shows available UIs now

Thanks to Daniel Rall for the patch.
fixes #5
This commit is contained in:
John Goerzen
2007-01-11 10:15:06 +01:00
parent 71b82fb385
commit ca3a306ecc
2 changed files with 12 additions and 7 deletions

View File

@ -19,13 +19,15 @@
import offlineimap.ui
import sys
DEFAULT_UI_LIST = ('Tk.Blinkenlights', 'Tk.VerboseUI',
'Curses.Blinkenlights', 'TTY.TTYUI',
'Noninteractive.Basic', 'Noninteractive.Quiet')
def findUI(config, chosenUI=None):
uistrlist = ['Tk.Blinkenlights', 'Tk.VerboseUI',
'Curses.Blinkenlights', 'TTY.TTYUI',
'Noninteractive.Basic', 'Noninteractive.Quiet']
uistrlist = list(DEFAULT_UI_LIST)
namespace={}
for ui in dir(offlineimap.ui):
if ui.startswith('_') or ui=='detector':
if ui.startswith('_') or ui in ('detector', 'UIBase'):
continue
namespace[ui]=getattr(offlineimap.ui, ui)