~doko/python/pkg2.5u

9 by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py
1
# FOR DEBIAN, sys.path is augmented with directories in /usr/local.
2
# Local addons go into /usr/local/lib/python<version>/site-packages
3
# (resp. /usr/local/lib/site-python), Debian addons install into
4
# /usr/lib/python<version>/site-packages.
5
12 by Matthias Klose
* Move site.py to python2.4-minimal, remove `addbuilddir' from site.py,
6
import os, sys
9 by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py
7
8
local_site_python = '/usr/local/lib/site-python'
9
local_site_packages = '/usr/local/lib/@PVER@/site-packages'
10
11
try:
12
    idx = sys.path.index('/usr/lib/@PVER@/site-packages')
13
    if os.path.isdir(local_site_python):
14
        sys.path.insert(idx, local_site_python)
15
    if os.path.isdir(local_site_packages):
16
        sys.path.insert(idx, local_site_packages)
17
except ValueError:
18
    if os.path.isdir(local_site_python):
19
        sys.path.append(local_site_python)
20
    if os.path.isdir(local_site_packages):
21
        sys.path.append(local_site_packages)
22
23
# install the apport exception handler if available
24
try:
25
    import apport_python_hook
26
except ImportError:
27
    pass
28
else:
29
    apport_python_hook.install()