summaryrefslogtreecommitdiff
path: root/scripts/template_verifier.py
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-11-19 23:26:29 +0000
committerJames Cook <james@lindenlab.com>2008-11-19 23:26:29 +0000
commit2a44e81675d22aa5ed0844d5a4ac18bb9bd49f64 (patch)
tree595dd4b8b7beac938fc0e14ee075e5cfeb1f129b /scripts/template_verifier.py
parent2d2d427158ca2465e2d70d84b4499cab57e2e208 (diff)
QAR-1018 Lightweight Windows Setup App (windows-setup-3). svn merge -r102882:102883 svn+ssh://svn.lindenlab.com/svn/linden/branches/windows-setup/windows-setup-3-merge
Diffstat (limited to 'scripts/template_verifier.py')
-rwxr-xr-xscripts/template_verifier.py37
1 files changed, 20 insertions, 17 deletions
diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py
index 581f1168ff..8f822daf6a 100755
--- a/scripts/template_verifier.py
+++ b/scripts/template_verifier.py
@@ -47,23 +47,26 @@ import os.path
# * it doesn't depend on the current directory
# * it doesn't depend on another file being present.
-root = os.path.abspath(__file__)
-# always insert the directory of the script in the search path
-dir = os.path.dirname(root)
-if dir not in sys.path:
- sys.path.insert(0, dir)
-
-# Now go look for indra/lib/python in the parent dies
-while root != os.path.sep:
- root = os.path.dirname(root)
- dir = os.path.join(root, 'indra', 'lib', 'python')
- if os.path.isdir(dir):
- if dir not in sys.path:
- sys.path.insert(0, dir)
- break
-else:
- print >>sys.stderr, "This script is not inside a valid installation."
- sys.exit(1)
+def add_indra_lib_path():
+ root = os.path.realpath(__file__)
+ # always insert the directory of the script in the search path
+ dir = os.path.dirname(root)
+ if dir not in sys.path:
+ sys.path.insert(0, dir)
+
+ # Now go look for indra/lib/python in the parent dies
+ while root != os.path.sep:
+ root = os.path.dirname(root)
+ dir = os.path.join(root, 'indra', 'lib', 'python')
+ if os.path.isdir(dir):
+ if dir not in sys.path:
+ sys.path.insert(0, dir)
+ break
+ else:
+ print >>sys.stderr, "This script is not inside a valid installation."
+ sys.exit(1)
+
+add_indra_lib_path()
import optparse
import os