Remove ui.detector class

The ui.detector class was not really needed and leads to the illusion
that we provide GUI plugins. For the sake of code maintainability we
don't :-).

Rather than having GUI names equivalent to the classes they are in
(which leads to weird names like TTY.TTYUI), this patch allows to give
each GUI an arbitrary string name. GUI names remain still unchanged in
this patch, the default UI when none was configured is TTY.TTYUI.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2011-01-05 17:00:54 +01:00
committed by Nicolas Sebrecht
parent ff3eb17b0f
commit c3540de763
3 changed files with 26 additions and 79 deletions

View File

@ -1,6 +1,5 @@
# UI module directory
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
# UI module
# Copyright (C) 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -16,23 +15,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from offlineimap.ui.UIBase import getglobalui, setglobalui
from offlineimap.ui import TTY, Noninteractive, Machine
import UIBase, Blinkenlights
UI_LIST = {'TTY.TTYUI': TTY.TTYUI,
'Noninteractive.Basic': Noninteractive.Basic,
'Noninteractive.Quiet': Noninteractive.Quiet,
'Machine.MachineUI': Machine.MachineUI}
#add Blinkenlights UI if it imports correctly (curses installed)
try:
import TTY
from offlineimap.ui import Curses
UI_LIST['Curses.Blinkenlights'] = Curses.Blinkenlights
except ImportError:
pass
try:
import curses
except ImportError:
pass
else:
import Curses
import Noninteractive
import Machine
# Must be last
import detector