summaryrefslogtreecommitdiffstats
path: root/src/Hooks/sitecustomize.py
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-06-02 17:06:39 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-06-02 17:06:39 +0200
commit8024b6ca0335cb59f737769f2e573435e32dd155 (patch)
treea7aa3da017f04b56191fa2d93fd22096e269eef0 /src/Hooks/sitecustomize.py
parent8966e621a0809d2109133f180db6a23bb4335843 (diff)
New hook for python apps
- minor fixes in python analyzer
Diffstat (limited to 'src/Hooks/sitecustomize.py')
-rw-r--r--src/Hooks/sitecustomize.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Hooks/sitecustomize.py b/src/Hooks/sitecustomize.py
new file mode 100644
index 0000000..5e7b524
--- /dev/null
+++ b/src/Hooks/sitecustomize.py
@@ -0,0 +1,30 @@
+config = None
+conf = {}
+try:
+ config = open("/etc/abrt/pyhook.conf","r")
+except:
+ #silently ignore if file doesn't exist
+ pass
+
+try:
+ if config:
+ # we expect config in form
+ # key = value
+ # Enabled = yes
+ # this should strip
+ line = config.readline().lower().replace(' ','').strip('\n').split('=')
+ conf[line[0]] = line[1]
+except:
+ # ignore silently everything, because we don't want to bother user if this hook doesn't work
+ pass
+
+if conf.has_key("enabled"):
+ if conf["enabled"] == "yes":
+ try:
+ from abrt_exception_handler import *
+
+ installExceptionHandler(debug = 1)
+ except Exception, e:
+ # FIXME don't print anything, write it to some log file
+ print e
+ pass \ No newline at end of file