def setup_python_path(collector_dir):
 mydir = os.path.dirname(collector_dir)
 libdir = os.path.join(mydir, 'collectors', 'lib')
 if (not os.path.isdir(libdir)):
  return
 pythonpath = os.environ.get('PYTHONPATH', '')
 if pythonpath:
  pythonpath += ':'
 pythonpath += mydir
 os.environ['PYTHONPATH'] = pythonpath
 LOG.debug('Set PYTHONPATH to %r', pythonpath)

def setup_python_path ( collector_dir ) : mydir = os . path . dirname ( collector_dir ) libdir = os . path . join ( mydir , 'collectors' , 'lib' ) if ( not os . path . isdir ( libdir ) ) : return pythonpath = os . environ . get ( 'PYTHONPATH' , '' ) if pythonpath : pythonpath += ':' pythonpath += mydir os . environ [ 'PYTHONPATH' ] = pythonpath LOG . debug ( 'Set PYTHONPATH to %r' , pythonpath )
sets up pythonpath so that collectors can easily import common code .