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)
|
||||
Reference in New Issue
Block a user