From 4a24f8fe27f4f84dc8c420288092e569d7f1179d Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Fri, 17 Jun 2011 09:07:03 -0700 Subject: [PATCH] Throw up a message box on quirk function loading problems --- pyquirks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyquirks.py b/pyquirks.py index 48288b0..c056d3a 100644 --- a/pyquirks.py +++ b/pyquirks.py @@ -1,4 +1,5 @@ import os, sys, imp, re +from PyQt4 import QtGui, QtCore class PythonQuirks(object): def __init__(self): @@ -23,6 +24,10 @@ class PythonQuirks(object): try: module = imp.load_source(name, filename) except Exception, e: print "Error loading %s: %s (in pyquirks.py)" % (name, e) + msgbox = QtGui.QMessageBox() + msgbox.setWindowTitle("Error!") + msgbox.setText("Error loading %s: %s (in pyquirks.py)" % (name, e)) + msgbox.exec_() else: if hasattr(module, 'setup'): module.setup() @@ -45,6 +50,10 @@ class PythonQuirks(object): raise Exception except: print "Quirk malformed: %s" % (obj.command) + msgbox = QtGui.QMessageBox() + msgbox.setWindowTitle("Error!") + msgbox.setText("Quirk malformed: %s" % (obj.command)) + msgbox.exec_() else: self.quirks[obj.command+"("] = obj