Make a generic graphical error function

This commit is contained in:
Chris Jones 2009-08-18 12:52:06 +01:00
parent 1f156248ee
commit ad372bbdcd
1 changed files with 12 additions and 2 deletions

View File

@ -29,3 +29,13 @@ def dbg (log = ""):
def err(log = ""):
"""Print an error message"""
print >> sys.stderr, log
def gerr(message = None):
"""Display a graphical error. This should only be used for serious
errors as it will halt execution"""
import gtk
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL,
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, message)
dialog.run()