equal
deleted
inserted
replaced
2945 return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()]) |
2945 return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()]) |
2946 |
2946 |
2947 |
2947 |
2948 ignored_exceptions = [] # a problem with a line in a module is only reported once per session |
2948 ignored_exceptions = [] # a problem with a line in a module is only reported once per session |
2949 |
2949 |
2950 def wxAddExceptHook(path, app_version='[No version]'):#, ignored_exceptions=[]): |
2950 def AddExceptHook(path, app_version='[No version]'):#, ignored_exceptions=[]): |
2951 |
2951 |
2952 def handle_exception(e_type, e_value, e_traceback): |
2952 def handle_exception(e_type, e_value, e_traceback): |
2953 traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func |
2953 traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func |
2954 last_tb = get_last_traceback(e_traceback) |
2954 last_tb = get_last_traceback(e_traceback) |
2955 ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno) |
2955 ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno) |
2991 if __name__ == '__main__': |
2991 if __name__ == '__main__': |
2992 app = wx.PySimpleApp() |
2992 app = wx.PySimpleApp() |
2993 wx.InitAllImageHandlers() |
2993 wx.InitAllImageHandlers() |
2994 |
2994 |
2995 # Install a exception handle for bug reports |
2995 # Install a exception handle for bug reports |
2996 wxAddExceptHook(os.getcwd(),__version__) |
2996 AddExceptHook(os.getcwd(),__version__) |
2997 |
2997 |
2998 frame = PLCOpenEditor(None) |
2998 frame = PLCOpenEditor(None) |
2999 |
2999 |
3000 frame.Show() |
3000 frame.Show() |
3001 app.MainLoop() |
3001 app.MainLoop() |