script_runner/tasks.py
def _get_process_environment(process, proxy):
    """Get env to be used by the script process.

    This env must at the very least contain the proxy url, and a PATH
    allowing bash scripts to use `ctx`, which is expected to live next to
    the current executable.
    """
    env = os.environ.copy()
    process_env = process.get('env', {})
    env.update(process_env)

    env[CTX_SOCKET_URL] = proxy.socket_url

    env_path = env.get('PATH')
    bin_dir = os.path.dirname(sys.executable)
    if env_path:
        if bin_dir not in env_path.split(os.pathsep):
            env['PATH'] = os.pathsep.join([env_path, bin_dir])
    else:
        env['PATH'] = bin_dir

    return env
Get env to be used by the script process.

    This env must at the very least contain the proxy url, and a PATH
    allowing bash scripts to use `ctx`, which is expected to live next to
    the current executable.
    
Get env to be used by the script process.
This env must at the very least contain the proxy url, and a PATH
allowing bash scripts to use `ctx`, which is expected to live next to
the current executable.
Get env to be used by the script process . This env must at the very least contain the proxy url and a PATH allowing bash scripts to use ` ctx ` which is expected to live next to the current executable .
def _get_process_environment(process, proxy):
    env = os.environ.copy()
    process_env = process.get('env', {})
    env.update(process_env)
    env[CTX_SOCKET_URL] = proxy.socket_url
    env_path = env.get('PATH')
    bin_dir = os.path.dirname(sys.executable)
    if env_path:
        if bin_dir not in env_path.split(os.pathsep):
            env['PATH'] = os.pathsep.join([env_path, bin_dir])
    else:
        env['PATH'] = bin_dir
    return env
def _get_process_environment ( process , proxy ) : env = os . environ . copy ( ) process_env = process . get ( 'env' , { } ) env . update ( process_env ) env [ CTX_SOCKET_URL ] = proxy . socket_url env_path = env . get ( 'PATH' ) bin_dir = os . path . dirname ( sys . executable ) if env_path : if bin_dir not in env_path . split ( os . pathsep ) : env [ 'PATH' ] = os . pathsep . join ( [ env_path , bin_dir ] ) else : env [ 'PATH' ] = bin_dir return env
Get env to be used by the script process.
Get env to be used by the script process .
"""Get env to be used by the script process.

    This env must at the very least contain the proxy url, and a PATH
    allowing bash scripts to use `ctx`, which is expected to live next to
    the current executable.
    """
process
proxy