Display import errors in the GUI as well as the terminal, issue 789, thanks Marc

This commit is contained in:
Massimo Di Pierro
2012-05-11 08:26:53 -05:00
parent f35e026854
commit 750dbccb79
4 changed files with 24 additions and 4 deletions
+15
View File
@@ -0,0 +1,15 @@
import logging
try:
import tkMessageBox
except:
tkMessageBox = None
class MessageBoxHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
def emit(self, record):
if tkMessageBox:
msg = self.format(record)
tkMessageBox.showinfo('info1', msg)
-1
View File
@@ -405,7 +405,6 @@ class web2pyDialog(object):
if not self.server_ready():
self.button_start.configure(state='normal')
tkMessageBox.showerror('web2py start server', 'server didn\'t start - check console')
return
self.button_stop.configure(state='normal')