def read_installed_packages_list():
 def read_from_file(config_filename):
  '\n        Reads an installed.lst file from a given location\n\n        :param config_filename: the configuration file to read\n        '
  global installed_packages_list
  try:
   installed_list_file = open(config_filename)
  except IOError:
   pass
  else:
   for line in installed_list_file:
    l = line.rstrip().split(' ')
    if l:
     installed_packages_list[l[0]] = this_package = package_info(config_filename, l[0], l[1], l[2], urllib.unquote(l[3]), urllib.unquote(l[4]))
    else:
     pass
 if super_powers:
  read_from_file(os.path.join(dataset_conf_path, 'installed.lst'))
 else:
  paths = [os.path.join(root_conf_path, 'installed.lst'), os.path.join(user_conf_path, 'installed.lst')]
  try:
   paths += [os.path.join(x, 'installed.lst') for x in re.split(':|;', os.environ['PYLEARN2_DATA_PATH'])]
  except Exception:
   pass
 for path in paths:
  read_from_file(path)
 if (len(installed_packages_list) == 0):
  logger.warning('[cf] no install.lst found (will be created on install/upgrade)')

def read_installed_packages_list ( ) : def read_from_file ( config_filename ) : global installed_packages_list try : installed_list_file = open ( config_filename ) except IOError : pass else : for line in installed_list_file : l = line . rstrip ( ) . split ( ' ' ) if l : installed_packages_list [ l [ 0 ] ] = this_package = package_info ( config_filename , l [ 0 ] , l [ 1 ] , l [ 2 ] , urllib . unquote ( l [ 3 ] ) , urllib . unquote ( l [ 4 ] ) ) else : pass if super_powers : read_from_file ( os . path . join ( dataset_conf_path , 'installed.lst' ) ) else : paths = [ os . path . join ( root_conf_path , 'installed.lst' ) , os . path . join ( user_conf_path , 'installed.lst' ) ] try : paths += [ os . path . join ( x , 'installed.lst' ) for x in re . split ( ':|;' , os . environ [ 'PYLEARN2_DATA_PATH' ] ) ] except Exception : pass for path in paths : read_from_file ( path ) if ( len ( installed_packages_list ) == 0 ) : logger . warning ( '[cf] no install.lst found (will be created on install/upgrade)' )
reads the various installed .