]> code.delx.au - offlineimap/commitdiff
--help shows available UIs now
authorJohn Goerzen <jgoerzen@complete.org>
Thu, 11 Jan 2007 09:15:06 +0000 (10:15 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Thu, 11 Jan 2007 09:15:06 +0000 (10:15 +0100)
Thanks to Daniel Rall for the patch.
fixes #5

offlineimap/ui/detector.py
offlineimap/version.py

index 908b9f8d51cd6dc6ba91d16102f0077cc3aa6e95..a320d1eeabbec02496c8770b7368efc82fadf47a 100644 (file)
 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)
 
index f45bbfdd14284b5aa559b5ef324d58e4c05247dc..eee66193e19dde0c169677d776c72448423f7874 100644 (file)
@@ -100,7 +100,10 @@ cmdhelp = """
               configuration file.  The UI specified with -u  will
               be  forced to be used, even if its isuable() method
               states that it cannot be.   Use  this  option  with
-              care.   The  pre-defined  options are listed in the
-              USER INTERFACES section.
-
+              care.   The  pre-defined  options, described in the
+              USER INTERFACES section of the man page, are:
 """
+from offlineimap.ui import detector
+import os
+for ui in detector.DEFAULT_UI_LIST:
+    cmdhelp += "                " + ui + os.linesep