parameters: ()
return_statement: return versions
docstring: Return a list of MWVersion objects representing installed versions
docstring_summary: Return a list of MWVersion objects representing installed versions
docstring_tokens: Return a list of MWVersion objects representing installed versions
function: def find_versions():
      """Return a list of MWVersion objects representing installed versions"""
      versions = []
  
      ### This function finds CodeWarrior by reading from the registry on
      ### Windows. Some other method needs to be implemented for other
      ### platforms, maybe something that calls env.WhereIs('mwcc')
  
      if SCons.Util.can_read_reg:
          try:
              HLM = SCons.Util.HKEY_LOCAL_MACHINE
              product = 'SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions'
              product_key = SCons.Util.RegOpenKeyEx(HLM, product)
  
              i = 0
              while True:
                  name = product + '\\' + SCons.Util.RegEnumKey(product_key, i)
                  name_key = SCons.Util.RegOpenKeyEx(HLM, name)
  
                  try:
                      version = SCons.Util.RegQueryValueEx(name_key, 'VERSION')
                      path = SCons.Util.RegQueryValueEx(name_key, 'PATH')
                      mwv = MWVersion(version[0], path[0], 'Win32-X86')
                      versions.append(mwv)
                  except SCons.Util.RegError:
                      pass
  
                  i = i + 1
  
          except SCons.Util.RegError:
              pass
  
      return versions
function_tokens: def find_versions ( ) : versions = [ ] ### This function finds CodeWarrior by reading from the registry on ### Windows. Some other method needs to be implemented for other ### platforms, maybe something that calls env.WhereIs('mwcc') if SCons . Util . can_read_reg : try : HLM = SCons . Util . HKEY_LOCAL_MACHINE product = 'SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions' product_key = SCons . Util . RegOpenKeyEx ( HLM , product ) i = 0 while True : name = product + '\\' + SCons . Util . RegEnumKey ( product_key , i ) name_key = SCons . Util . RegOpenKeyEx ( HLM , name ) try : version = SCons . Util . RegQueryValueEx ( name_key , 'VERSION' ) path = SCons . Util . RegQueryValueEx ( name_key , 'PATH' ) mwv = MWVersion ( version [ 0 ] , path [ 0 ] , 'Win32-X86' ) versions . append ( mwv ) except SCons . Util . RegError : pass i = i + 1 except SCons . Util . RegError : pass return versions