summaryrefslogtreecommitdiff
path: root/portato/gui/utils.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-23 22:33:20 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-23 22:33:20 +0200
commit88d60d9f5082d6dd62778614681638415f25a8d6 (patch)
tree12c4863eed252b23d4ce4675b1a7c33abd2f158b /portato/gui/utils.py
parent84ce6de169ab527d8393bfe9da63944c550ee16a (diff)
parent0392a7dcbaa08cbc73e091422bf6f68dbfa8d7f6 (diff)
downloadportato-88d60d9f5082d6dd62778614681638415f25a8d6.tar.gz
portato-88d60d9f5082d6dd62778614681638415f25a8d6.tar.bz2
portato-88d60d9f5082d6dd62778614681638415f25a8d6.zip
Added the possibility to directly mail bugs
Diffstat (limited to '')
-rw-r--r--portato/gui/utils.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/portato/gui/utils.py b/portato/gui/utils.py
index 0a2930b..6e04814 100644
--- a/portato/gui/utils.py
+++ b/portato/gui/utils.py
@@ -14,19 +14,38 @@ from __future__ import absolute_import, with_statement
# some stuff needed
import re
+import sys
import logging
+import gettext
from collections import defaultdict
-from threading import RLock
+from threading import Thread, RLock
from functools import wraps
# some backend things
from ..backend import flags, system, set_system
from ..helper import debug, info, set_log_level
-from ..constants import USE_CATAPULT
+from ..constants import USE_CATAPULT, APP, LOCALE_DIR
# parser
from ..config_parser import ConfigParser
+class GtkThread (Thread):
+ def run(self):
+ # for some reason, I have to install this for each thread ...
+ gettext.install(APP, LOCALE_DIR, unicode = True)
+ try:
+ Thread.run(self)
+ except SystemExit:
+ raise # let normal thread handle it
+ except:
+ type, val, tb = sys.exc_info()
+ try:
+ sys.excepthook(type, val, tb, thread = self.getName())
+ except TypeError:
+ raise type, val, tb # let normal thread handle it
+ finally:
+ del type, val, tb
+
class Config (ConfigParser):
def __init__ (self, cfgFile):