parameters: (output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH"))
return_statement: return dkeep
docstring: Parse output from running visual c++/studios vcvarsall.bat and running set
      To capture the values listed in keep
docstring_summary: Parse output from running visual c++/studios vcvarsall.bat and running set
      To capture the values listed in keep
docstring_tokens: Parse output from running visual c ++ / studios vcvarsall . bat and running set To capture the values listed in keep
function: def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH")):
      """
      Parse output from running visual c++/studios vcvarsall.bat and running set
      To capture the values listed in keep
      """
  
      # dkeep is a dict associating key: path_list, where key is one item from
      # keep, and pat_list the associated list of paths
      dkeep = dict([(i, []) for i in keep])
  
      # rdk will  keep the regex to match the .bat file output line starts
      rdk = {}
      for i in keep:
          rdk[i] = re.compile('%s=(.*)' % i, re.I)
  
      def add_env(rmatch, key, dkeep=dkeep):
          path_list = rmatch.group(1).split(os.pathsep)
          for path in path_list:
              # Do not add empty paths (when a var ends with ;)
              if path:
                  # XXX: For some reason, VC98 .bat file adds "" around the PATH
                  # values, and it screws up the environment later, so we strip
                  # it.
                  path = path.strip('"')
                  dkeep[key].append(str(path))
  
      for line in output.splitlines():
          for k, value in rdk.items():
              match = value.match(line)
              if match:
                  add_env(match, k)
  
      return dkeep
function_tokens: def parse_output ( output , keep = ( "INCLUDE" , "LIB" , "LIBPATH" , "PATH" ) ) : # dkeep is a dict associating key: path_list, where key is one item from # keep, and pat_list the associated list of paths dkeep = dict ( [ ( i , [ ] ) for i in keep ] ) # rdk will  keep the regex to match the .bat file output line starts rdk = { } for i in keep : rdk [ i ] = re . compile ( '%s=(.*)' % i , re . I ) def add_env ( rmatch , key , dkeep = dkeep ) : path_list = rmatch . group ( 1 ) . split ( os . pathsep ) for path in path_list : # Do not add empty paths (when a var ends with ;) if path : # XXX: For some reason, VC98 .bat file adds "" around the PATH # values, and it screws up the environment later, so we strip # it. path = path . strip ( '"' ) dkeep [ key ] . append ( str ( path ) ) for line in output . splitlines ( ) : for k , value in rdk . items ( ) : match = value . match ( line ) if match : add_env ( match , k ) return dkeep