From cb7620ebf655e86cfe8000bf0bac9269394b652e Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 6 Nov 2008 10:47:56 -0800 Subject: [PATCH] cumulus-util: Automatically set Python search path. Attempt to set the Python library search path so that cumulus-util can find the cumulus Python modules, without PYTHON_PATH having to be set explicitly. Modules are looked for in the "python" directory where the cumulus-util binary resides; this is appropriate for running cumulus-util directly from the source code directory, but may not be if the tools are installed somewhere else. --- cumulus-util | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cumulus-util b/cumulus-util index 05043f1..ce80ff6 100755 --- a/cumulus-util +++ b/cumulus-util @@ -4,6 +4,12 @@ import getpass, os, stat, sys, time from optparse import OptionParser + +# Automatically set Python path, based on script directory. This should be +# removed if the tools are properly installed somewhere. +script_directory = os.path.dirname(sys.argv[0]) +sys.path.append(os.path.join(script_directory, 'python')) + import cumulus # Compatibility -- 2.20.1