From 2a44e81675d22aa5ed0844d5a4ac18bb9bd49f64 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 Nov 2008 23:26:29 +0000 Subject: 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 --- scripts/template_verifier.py | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'scripts/template_verifier.py') 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 -- cgit v1.2.3