finally:
s.c.unlock()
- def terminate(s, exitstatus = 0):
+ def terminate(s, exitstatus = 0, errortitle = None, errormsg = None):
s.c.stop()
- UIBase.terminate(s, exitstatus)
+ if errormsg <> None:
+ if errortitle <> None:
+ sys.stderr.write('%s: %s\n'%(errortitle, errormsg))
+ else:
+ sys.stderr.write('%s\n' % errormsg)
+ UIBase.terminate(s, exitstatus = exitstatus, errortitle = errortitle, errormsg = errormsg)
def threadException(s, thread):
s.c.stop()
tf = s.availablethreadframes.pop()
tf.destroy()
s.tflock.release()
+
+ def terminate(s, exitstatus = 0, errortitle = None, errormsg = None):
+ if errormsg <> None:
+ if errortitle == None:
+ errortitle = "Error"
+ TextOKDialog(errortitle, errormsg)
+ UIBase.terminate(s, exitstatus = exitstatus, errortitle = None, errormsg = None)
def threadException(s, thread):
exceptionstr = s.getThreadExceptionString(thread)
def mainException(s):
s._msg(s.getMainExceptionString())
- def terminate(s, exitstatus = 0):
+ def terminate(s, exitstatus = 0, errortitle = None, errormsg = None):
"""Called to terminate the application."""
+ if errormsg <> None:
+ if errortitle <> None:
+ sys.stderr.write('ERROR: %s\n\n%s\n'%(errortitle, errormsg))
+ else:
+ sys.stderr.write('%s\n' % errormsg)
sys.exit(exitstatus)
def threadExited(s, thread):