add the proper resources into the environment
12187
def __add_paths(self, config):
        
        bin_path = os.path.join(self.directory.install_directory(self.feature_name), 'bin')
        whitelist_executables = self._get_whitelisted_executables(config)
        for f in os.listdir(bin_path):
            for pattern in BLACKLISTED_EXECUTABLES:
                if re.match(pattern, f):
                    continue
            if whitelist_executables and f not in whitelist_executables:
                continue
            self.directory.symlink_to_bin(f, os.path.join(bin_path, f))
1037012
def setup!
      env = ::Librarian::Chef::Environment.new(project_path: Dir.pwd)
      @originalpath, env.config_db.local['path'] = env.config_db.local['path'], @tmpdir
      ::Librarian::Action::Resolve.new(env).run
      ::Librarian::Action::Install.new(env).run

      ::RSpec.configure { |config| config.cookbook_path = @tmpdir }
    end
625023
@Override
    public void buildEnvironment(Run<?,?> build, EnvVars env) {
        env.put(name,originalFileName);
    }
1000260
def bind(self, environment):
        """"""
        rv = object.__new__(self.__class__)
        rv.__dict__.update(self.__dict__)
        rv.environment = environment
        return rv
652981
def _init_env(self):
        '''
        
        '''
        from salt.config import minion_config
        from salt.grains import core as g_core
        g_core.__opts__ = minion_config(self.DEFAULT_MINION_CONFIG_PATH)
        self.grains_core = g_core
330614
def update_environment(lib_directory):
        """"""
        # Use this if you want to include modules from a subfolder
        # lib_path = os.path.realpath(
        #     os.path.abspath(
        #         os.path.join(
        #             os.path.split(inspect.getfile(inspect.currentframe()))[0], lib_directory)))
        lib_path = os.path.join(os.getcwd(), lib_directory)
        if 'PYTHONPATH' in os.environ:
            os.environ['PYTHONPATH'] = '{}{}{}'.format(
                lib_path, os.pathsep, os.environ['PYTHONPATH']
            )
        else:
            os.environ['PYTHONPATH'] = '{}'.format(lib_path)
646739
def register(self):
        
        os.environ[self.resourceEnvNamePrefix + self.pathHash] = self.pickle()
1255811
function resolveEnvSources(env) {
  let paths = [];

  if (process.env[env]) {
    paths = process.env[env].includes(path.delimiter) ? process.env[env].split(path.delimiter) : [process.env[env]];
  }

  return paths;
}
353172
def modify_environment (self, env):
        
        plat = self._platform

        def path (*args):
            return os.path.join (self._installdir, *args)

        env['CALDB'] = b'http://heasarc.gsfc.nasa.gov/FTP/caldb'
        env['CALDBCONFIG'] = path ('caldb.config')
        env['CALDBALIAS'] = path ('alias_config.fits')

        env['HEADAS'] = path (plat)
        env['LHEASOFT'] = env['HEADAS']
        env['FTOOLS'] = env['HEADAS']

        prepend_environ_path (env, 'PATH', path (plat, 'bin'))
        prepend_environ_path (env, 'LD_LIBRARY_PATH', path (plat, 'lib'))
        prepend_environ_path (env, 'PERLLIB', path (plat, 'lib', 'perl'))
        prepend_environ_path (env, 'PERL5LIB', path (plat, 'lib', 'perl'))
        prepend_environ_path (env, 'PYTHONPATH', path (plat, 'lib'))
        prepend_environ_path (env, 'PYTHONPATH', path (plat, 'lib', 'python'))

        userpfiles = user_data_path ('hea-pfiles')
        io.ensure_dir (userpfiles, parents=True)
        env['PFILES'] = ';'.join ([userpfiles,
                                   path (plat, 'syspfiles')])

        env['LHEA_DATA'] = path (plat, 'refdata')
        env['LHEA_HELP'] = path (plat, 'help')
        env['PGPLOT_DIR'] = path (plat, 'lib')
        env['PGPLOT_FONT'] = path (plat, 'lib', 'grfont.dat')
        env['PGPLOT_RGB'] = path (plat, 'lib', 'rgb.txt')
        env['POW_LIBRARY'] = path (plat, 'lib', 'pow')
        env['TCLRL_LIBDIR'] = path (plat, 'lib')
        env['XANADU'] = path ()
        env['XANBIN'] = path (plat)
        env['XRDEFAULTS'] = path (plat, 'xrdefaults')

        env['EXT'] = b'lnx' # XXX portability probably ...
        env['LHEAPERL'] = b'/usr/bin/perl' # what could go wrong?
        env['PFCLOBBER'] = b'1'
        env['FTOOLSINPUT'] = b'stdin'
        env['FTOOLSOUTPUT'] = b'stdout'
        return env
1320328
def _set_environment(self, environ):
        """"""
        if environ:
            q_environ = self._process.processEnvironment()
            for k, v in environ.items():
                q_environ.insert(k, v)
            self._process.setProcessEnvironment(q_environ)
392938
def new_env(environment):
    
    if not environment:
        print("You need to supply an environment name")
        return

    parser = read_config()

    if environment in parser.sections():
        print("Environment '%s' already exists" % environment)
        return

    print("Please introduce (in order) the commands for '%s'\n" % environment)
    print("Press RETURN to end command and RETURN with empty line to finish\n")

    commands = []
    cmd = ""

    while True:
        try:
            cmd = raw_input("> ")

            if not cmd:
                break

            commands.append(cmd)

        except KeyboardInterrupt:
            return

    parser.add_section(environment)
    parser.set(environment, "cmd", "\n".join(commands))

    write_config(parser)

    print("Added environment '%s'" % environment)
1289988
def put(self, request, bot_id, id, format=None):
              
        return super(EnvironmentVarDetail, self).put(request, bot_id, id, format)
1124138
private function createEnv(): void
    {
        if (file_exists(base_dir('.env'))) {
            $dotEnv = new Dotenv();
            $dotEnv->load(base_dir('.env'));
            $this->env = $dotEnv;
        }
    }
168492
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceListDupeError(
                "Attempt to add resource already in resource_list")
        self[uri] = resource
822508
def add_helpingmaterials(config, helping_materials_file, helping_type):
    """"""
    res = _add_helpingmaterials(config, helping_materials_file, helping_type)
    click.echo(res)
669398
protected function initEnvironment()
    {
        $path = getcwd();
        if (!is_file("$path/.env")) {
            return;
        }
        $dotenv = new \Dotenv\Dotenv($path);
        if ($this->dotEnvOverload) {
            $dotenv->overload();
        } else {
            $dotenv->load();
        }
    }
759676
def add(self, resource, replace=False):
        
        if isinstance(resource, collections.Iterable):
            for r in resource:
                self.resources.add(r, replace)
        else:
            self.resources.add(resource, replace)