Display import errors in the GUI as well as the terminal, issue 789, thanks Marc
This commit is contained in:
@@ -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)
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user