summarylogtreecommitdiffstats
path: root/sitecustomize.py
blob: 49110b39299ae7942e12488b470f8949a0be361a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/python3

import os, sys

cur_path = os.path.dirname(os.path.realpath(__file__))
path_segments = []
for segment in reversed(cur_path.lstrip("/").split("/")):
    path_segments.insert(0, segment)
    if segment == "lib":
        path_segments.insert(0, "local")

sys.path.insert(0, "/" + os.path.join(*path_segments))
path_segments.pop()
sys.path.insert(1, "/" + os.path.join(*path_segments))