equal
deleted
inserted
replaced
91 |
91 |
92 |
92 |
93 ignored_exceptions = [] # a problem with a line in a module is only reported once per session |
93 ignored_exceptions = [] # a problem with a line in a module is only reported once per session |
94 |
94 |
95 |
95 |
96 def AddExceptHook(app_version='[No version]'): |
96 def AddExceptHook(app_version='[No version]', logf = None): |
97 |
97 |
98 def save_bug_report(e_type, e_value, e_traceback, bug_report_path, date): |
98 def save_bug_report(e_type, e_value, e_traceback, bug_report_path, date): |
99 info = { |
99 info = { |
100 'app-title': wx.GetApp().GetAppName(), |
100 'app-title': wx.GetApp().GetAppName(), |
101 'app-version': app_version, |
101 'app-version': app_version, |
123 os.mkdir(path) |
123 os.mkdir(path) |
124 output = open(bug_report_path, 'w') |
124 output = open(bug_report_path, 'w') |
125 lst = info.keys() |
125 lst = info.keys() |
126 lst.sort() |
126 lst.sort() |
127 for a in lst: |
127 for a in lst: |
128 output.write(a + ":\n" + str(info[a]) + "\n\n") |
128 line = a + ":\n" + str(info[a]) + "\n\n" |
|
129 output.write(line) |
|
130 if logf is not None: |
|
131 logf.write(line) |
129 output.close() |
132 output.close() |
130 |
133 |
131 def handle_exception(e_type, e_value, e_traceback, exit=False): |
134 def handle_exception(e_type, e_value, e_traceback, exit=False): |
132 traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func |
135 traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func |
133 last_tb = get_last_traceback(e_traceback) |
136 last_tb = get_last_traceback(e_traceback) |