summaryrefslogtreecommitdiffstats
path: root/src/Hooks/sitecustomize.py
blob: abae27bf28a9e394b575b541cee0f5c3283473a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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