aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server/fix_pythonpath.py
blob: cc32f4a6bcf3fa075ac3534a85e06c60ca4347ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python

"""
Copyright 2014 Google Inc.

Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.

Adds possibly-needed directories to PYTHONPATH, if they aren't already there.
"""

import os
import sys

TRUNK_DIRECTORY = os.path.abspath(os.path.join(
    os.path.dirname(__file__), os.pardir, os.pardir))
for subdir in ['common', 'gm', 'tools']:
  fullpath = os.path.join(TRUNK_DIRECTORY, subdir)
  if fullpath not in sys.path:
    sys.path.append(fullpath)