def _add_to_path_envvar(directory):
 orig_path = os.environ.get('PATH', '')
 if directory:
  if (not os.path.isdir(directory)):
   log.error('The given parameter is not a directory')
  os.environ['PATH'] = '{0}{1}{2}'.format(orig_path, os.pathsep, directory)
 return orig_path

def _add_to_path_envvar ( directory ) : orig_path = os . environ . get ( 'PATH' , '' ) if directory : if ( not os . path . isdir ( directory ) ) : log . error ( 'The given parameter is not a directory' ) os . environ [ 'PATH' ] = '{0}{1}{2}' . format ( orig_path , os . pathsep , directory ) return orig_path
adds directory to the path environment variable and returns the original one .