parameters: (env)
return_statement: return 1
docstring: Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
  
      MWCW_VERSIONS is set to a list of objects representing installed versions
  
      MWCW_VERSION  is set to the version object that will be used for building.
                    MWCW_VERSION can be set to a string during Environment
                    construction to influence which version is chosen, otherwise
                    the latest one from MWCW_VERSIONS is used.
  
      Returns true if at least one version is found, false otherwise
docstring_summary: Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
docstring_tokens: Set MWCW_VERSION MWCW_VERSIONS and some codewarrior environment vars
function: def set_vars(env):
      """Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
  
      MWCW_VERSIONS is set to a list of objects representing installed versions
  
      MWCW_VERSION  is set to the version object that will be used for building.
                    MWCW_VERSION can be set to a string during Environment
                    construction to influence which version is chosen, otherwise
                    the latest one from MWCW_VERSIONS is used.
  
      Returns true if at least one version is found, false otherwise
      """
      desired = env.get('MWCW_VERSION', '')
  
      # return right away if the variables are already set
      if isinstance(desired, MWVersion):
          return 1
      elif desired is None:
          return 0
  
      versions = find_versions()
      version = None
  
      if desired:
          for v in versions:
              if str(v) == desired:
                  version = v
      elif versions:
          version = versions[-1]
  
      env['MWCW_VERSIONS'] = versions
      env['MWCW_VERSION'] = version
  
      if version is None:
        return 0
  
      env.PrependENVPath('PATH', version.clpath)
      env.PrependENVPath('PATH', version.dllpath)
      ENV = env['ENV']
      ENV['CWFolder'] = version.path
      ENV['LM_LICENSE_FILE'] = version.license
      plus = lambda x: '+%s' % x
      ENV['MWCIncludes'] = os.pathsep.join(map(plus, version.includes))
      ENV['MWLibraries'] = os.pathsep.join(map(plus, version.libs))
      return 1
function_tokens: def set_vars ( env ) : desired = env . get ( 'MWCW_VERSION' , '' ) # return right away if the variables are already set if isinstance ( desired , MWVersion ) : return 1 elif desired is None : return 0 versions = find_versions ( ) version = None if desired : for v in versions : if str ( v ) == desired : version = v elif versions : version = versions [ - 1 ] env [ 'MWCW_VERSIONS' ] = versions env [ 'MWCW_VERSION' ] = version if version is None : return 0 env . PrependENVPath ( 'PATH' , version . clpath ) env . PrependENVPath ( 'PATH' , version . dllpath ) ENV = env [ 'ENV' ] ENV [ 'CWFolder' ] = version . path ENV [ 'LM_LICENSE_FILE' ] = version . license plus = lambda x : '+%s' % x ENV [ 'MWCIncludes' ] = os . pathsep . join ( map ( plus , version . includes ) ) ENV [ 'MWLibraries' ] = os . pathsep . join ( map ( plus , version . libs ) ) return 1