parameters: (output_of_set)
return_statement: return env
docstring: Extracts environment variables required for the toolchain to run from
    a textual dump output by the cmd.exe 'set' command.
docstring_summary: Extracts environment variables required for the toolchain to run from
    a textual dump output by the cmd.exe 'set' command.
docstring_tokens: Extracts environment variables required for the toolchain to run from a textual dump output by the cmd . exe set command .
function: def _ExtractImportantEnvironment(output_of_set):
    """Extracts environment variables required for the toolchain to run from
    a textual dump output by the cmd.exe 'set' command."""
    envvars_to_save = (
        'goma_.*', # TODO(scottmg): This is ugly, but needed for goma.
        'include',
        'lib',
        'libpath',
        'path',
        'pathext',
        'systemroot',
        'temp',
        'tmp',
        )
    env = {}
    for line in output_of_set.splitlines():
      for envvar in envvars_to_save:
        if re.match(envvar + '=', line.lower()):
          var, setting = line.split('=', 1)
          if envvar == 'path':
            # Our own rules (for running gyp-win-tool) and other actions in
            # Chromium rely on python being in the path. Add the path to this
            # python here so that if it's not in the path when ninja is run
            # later, python will still be found.
            setting = os.path.dirname(sys.executable) + os.pathsep + setting
          env[var.upper()] = setting
          break
    for required in ('SYSTEMROOT', 'TEMP', 'TMP'):
      if required not in env:
        raise Exception('Environment variable "%s" '
                        'required to be set to valid path' % required)
    return env
function_tokens: def _ExtractImportantEnvironment ( output_of_set ) : envvars_to_save = ( 'goma_.*' , # TODO(scottmg): This is ugly, but needed for goma. 'include' , 'lib' , 'libpath' , 'path' , 'pathext' , 'systemroot' , 'temp' , 'tmp' , ) env = { } for line in output_of_set . splitlines ( ) : for envvar in envvars_to_save : if re . match ( envvar + '=' , line . lower ( ) ) : var , setting = line . split ( '=' , 1 ) if envvar == 'path' : # Our own rules (for running gyp-win-tool) and other actions in # Chromium rely on python being in the path. Add the path to this # python here so that if it's not in the path when ninja is run # later, python will still be found. setting = os . path . dirname ( sys . executable ) + os . pathsep + setting env [ var . upper ( ) ] = setting break for required in ( 'SYSTEMROOT' , 'TEMP' , 'TMP' ) : if required not in env : raise Exception ( 'Environment variable "%s" ' 'required to be set to valid path' % required ) return env