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)