[PATCH 5/5] Rename the GUI classes

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Jan 5 16:00:58 GMT 2011


Rename the GUI classes (TTY.TTYUI,...) with shorter and nicer to use
names. We call them "Blinkenlights, Machine, Quiet, Basic, and TTY
(default)" now.

If an unknown ui is specified, e.g. an old value in the config file,
we abort and print out the list of possible values.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 offlineimap/init.py        |    2 +-
 offlineimap/ui/__init__.py |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/offlineimap/init.py b/offlineimap/init.py
index 4f8490b..f1a18bb 100644
--- a/offlineimap/init.py
+++ b/offlineimap/init.py
@@ -187,7 +187,7 @@ class OfflineImap:
                 config.set(section, key, value)
 
         #init the ui, cmd line option overrides config file
-        ui_type = config.getdefault('general','ui', 'TTY.TTYUI')
+        ui_type = config.getdefault('general','ui', 'TTY')
         if options.interface != None:
             ui_type = options.interface
         try:
diff --git a/offlineimap/ui/__init__.py b/offlineimap/ui/__init__.py
index 83d81c6..b3a1d14 100644
--- a/offlineimap/ui/__init__.py
+++ b/offlineimap/ui/__init__.py
@@ -18,14 +18,14 @@
 from offlineimap.ui.UIBase import getglobalui, setglobalui
 from offlineimap.ui import TTY, Noninteractive, Machine
 
-UI_LIST = {'TTY.TTYUI': TTY.TTYUI,
-           'Noninteractive.Basic': Noninteractive.Basic,
-           'Noninteractive.Quiet': Noninteractive.Quiet, 
-           'Machine.MachineUI': Machine.MachineUI}
+UI_LIST = {'TTY': TTY.TTYUI,
+           'Basic': Noninteractive.Basic,
+           'Quiet': Noninteractive.Quiet, 
+           'Machine': Machine.MachineUI}
 
 #add Blinkenlights UI if it imports correctly (curses installed)
 try:
     from offlineimap.ui import Curses
-    UI_LIST['Curses.Blinkenlights'] = Curses.Blinkenlights
+    UI_LIST['Blinkenlights'] = Curses.Blinkenlights
 except ImportError:
     pass
-- 
1.7.1





More information about the OfflineIMAP-project mailing list