/head: changeset 110

Initial documentation added; more updates
This commit is contained in:
jgoerzen
2002-07-12 05:08:27 +01:00
parent 5342dacc6c
commit f4966e3a40
5 changed files with 142 additions and 11 deletions

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import TTY, UIBase, detector
import TTY, UIBase
availableUIs = {'TTY': TTY, 'UIBase': UIBase}
try:
import Tkinter
@ -27,3 +27,4 @@ else:
import Tk
availableUIs['Tk'] = Tk
import detector

View File

@ -20,19 +20,21 @@ from offlineimap.ui import *
import sys
def findUI(config):
uistrlist = ['Tk.TKUI', 'TTY.TTYUI']
uistrlist = ['Tk.TkUI', 'TTY.TTYUI']
if config.has_option("general", "ui"):
uistrlist = config.get("general", "ui").replace(" ", "").split(",")
for uistr in uistrlist:
uimod = getUImod(uistr)
if uimod and uimod.isusable():
return uimod
if uimod:
uiinstance = uimod()
if uiinstance.isusable():
return uiinstance
sys.stderr.write("ERROR: No UIs were found usable!\n")
sys.exit(200)
def getUImod(uistr):
try:
uimod = eval(uistr)
except AttributeError, NameError:
except (AttributeError, NameError):
return None
return uimod