Commits

Anonymous committed 43bf220

Added wxPyExceptHook for better exception displaying with sys.excepthook. Fixed translated tips.txt finding code.

Comments (0)

Files changed (1)

 # Copyright:   (c) 1999 - 2007 Riaan Booysen
 # Licence:     GPL
 #----------------------------------------------------------------------
-import string, os, sys, glob, pprint, types, re
+import string, os, sys, glob, pprint, types, re, traceback
 
 import wx
 
     path = toPyPath(os.path.join('locale', d))
     if not os.path.exists(path):
         if '_' in d:
-            path = os.path.join('locale', d.split('_', 1)[0])
+            path = toPyPath(os.path.join('locale', d.split('_', 1)[0]))
             if not os.path.exists(path):
                 return ''
         else:
         if child not in ignoreCtrls and not isinstance(child, ignoreClasses):
             resetMinSize(child, ignoreCtrls, ignoreClasses) 
 
+def wxPyExceptHook(type, value, trace):
+    if wx and sys and traceback:
+        exc = traceback.format_exception(type, value, trace)
+        for e in exc: 
+            wx.LogError(e)
+        sys.__excepthook__(type, value, trace)
+
 
 #-------------------------------------------------------------------------------