BeremizIDE.py
changeset 1737 a39c2918c015
parent 1736 7e61baa047f0
child 1739 ec153828ded2
equal deleted inserted replaced
1736:7e61baa047f0 1737:a39c2918c015
  1138 
  1138 
  1139 def format_namespace(d, indent='    '):
  1139 def format_namespace(d, indent='    '):
  1140     return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()])
  1140     return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()])
  1141 
  1141 
  1142 
  1142 
  1143 ignored_exceptions = [] # a problem with a line in a module is only reported once per session
  1143 ignored_exceptions = []  # a problem with a line in a module is only reported once per session
  1144 
  1144 
  1145 
  1145 
  1146 def AddExceptHook(path, app_version='[No version]'):#, ignored_exceptions=[]):
  1146 def AddExceptHook(path, app_version='[No version]'):  #, ignored_exceptions=[]):
  1147 
  1147 
  1148     def save_bug_report(e_type, e_value, e_traceback, bug_report_path,date):
  1148     def save_bug_report(e_type, e_value, e_traceback, bug_report_path,date):
  1149         info = {
  1149         info = {
  1150             'app-title': wx.GetApp().GetAppName(),  # app_title
  1150             'app-title': wx.GetApp().GetAppName(),  # app_title
  1151             'app-version': app_version,
  1151             'app-version': app_version,
  1176         for a in lst:
  1176         for a in lst:
  1177             output.write(a + ":\n" + str(info[a]) + "\n\n")
  1177             output.write(a + ":\n" + str(info[a]) + "\n\n")
  1178         output.close()
  1178         output.close()
  1179 
  1179 
  1180     def handle_exception(e_type, e_value, e_traceback):
  1180     def handle_exception(e_type, e_value, e_traceback):
  1181         traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func
  1181         traceback.print_exception(e_type, e_value, e_traceback)  # this is very helpful when there's an exception in the rest of this func
  1182         last_tb = get_last_traceback(e_traceback)
  1182         last_tb = get_last_traceback(e_traceback)
  1183         ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno)
  1183         ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno)
  1184         if ex not in ignored_exceptions:
  1184         if ex not in ignored_exceptions:
  1185             ignored_exceptions.append(ex)
  1185             ignored_exceptions.append(ex)
  1186             date = time.ctime()
  1186             date = time.ctime()