Throw up a message box on quirk function loading problems
This commit is contained in:
parent
88a5c958b4
commit
4a24f8fe27
1 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
import os, sys, imp, re
|
import os, sys, imp, re
|
||||||
|
from PyQt4 import QtGui, QtCore
|
||||||
|
|
||||||
class PythonQuirks(object):
|
class PythonQuirks(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -23,6 +24,10 @@ class PythonQuirks(object):
|
||||||
try: module = imp.load_source(name, filename)
|
try: module = imp.load_source(name, filename)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Error loading %s: %s (in pyquirks.py)" % (name, 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:
|
else:
|
||||||
if hasattr(module, 'setup'):
|
if hasattr(module, 'setup'):
|
||||||
module.setup()
|
module.setup()
|
||||||
|
@ -45,6 +50,10 @@ class PythonQuirks(object):
|
||||||
raise Exception
|
raise Exception
|
||||||
except:
|
except:
|
||||||
print "Quirk malformed: %s" % (obj.command)
|
print "Quirk malformed: %s" % (obj.command)
|
||||||
|
msgbox = QtGui.QMessageBox()
|
||||||
|
msgbox.setWindowTitle("Error!")
|
||||||
|
msgbox.setText("Quirk malformed: %s" % (obj.command))
|
||||||
|
msgbox.exec_()
|
||||||
else:
|
else:
|
||||||
self.quirks[obj.command+"("] = obj
|
self.quirks[obj.command+"("] = obj
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue