diff options
Diffstat (limited to '')
-rwxr-xr-x | linden/scripts/template_verifier.py | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/linden/scripts/template_verifier.py b/linden/scripts/template_verifier.py index f1f3953..de9a444 100755 --- a/linden/scripts/template_verifier.py +++ b/linden/scripts/template_verifier.py | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | $LicenseInfo:firstyear=2007&license=viewergpl$ |
7 | 7 | ||
8 | Copyright (c) 2007-2008, Linden Research, Inc. | 8 | Copyright (c) 2007-2009, Linden Research, Inc. |
9 | 9 | ||
10 | Second Life Viewer Source Code | 10 | Second Life Viewer Source Code |
11 | The source code in this file ("Source Code") is provided by Linden Lab | 11 | The source code in this file ("Source Code") is provided by Linden Lab |
@@ -38,13 +38,35 @@ If [FILE] [FILE] is specified, two local files will be checked against | |||
38 | each other. | 38 | each other. |
39 | """ | 39 | """ |
40 | 40 | ||
41 | from os.path import realpath, dirname, join, exists | 41 | import sys |
42 | setup_path = join(dirname(realpath(__file__)), "setup-path.py") | 42 | import os.path |
43 | if exists(setup_path): | 43 | |
44 | execfile(setup_path) | 44 | # Look for indra/lib/python in all possible parent directories ... |
45 | # This is an improvement over the setup-path.py method used previously: | ||
46 | # * the script may blocated anywhere inside the source tree | ||
47 | # * it doesn't depend on the current directory | ||
48 | # * it doesn't depend on another file being present. | ||
49 | |||
50 | root = os.path.abspath(__file__) | ||
51 | # always insert the directory of the script in the search path | ||
52 | dir = os.path.dirname(root) | ||
53 | if dir not in sys.path: | ||
54 | sys.path.insert(0, dir) | ||
55 | |||
56 | # Now go look for indra/lib/python in the parent dies | ||
57 | while root != os.path.sep: | ||
58 | root = os.path.dirname(root) | ||
59 | dir = os.path.join(root, 'indra', 'lib', 'python') | ||
60 | if os.path.isdir(dir): | ||
61 | if dir not in sys.path: | ||
62 | sys.path.insert(0, dir) | ||
63 | break | ||
64 | else: | ||
65 | print >>sys.stderr, "This script is not inside a valid installation." | ||
66 | sys.exit(1) | ||
67 | |||
45 | import optparse | 68 | import optparse |
46 | import os | 69 | import os |
47 | import sys | ||
48 | import urllib | 70 | import urllib |
49 | 71 | ||
50 | from indra.ipc import compatibility | 72 | from indra.ipc import compatibility |