/head: changeset 110
Initial documentation added; more updates
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user