def read_packages_sources():
 def read_from_file(config_filename):
  '\n        Reads a sources.lst file from a given location\n\n        :param config_filename: the configuration file to read\n        '
  global packages_sources
  try:
   f = open(config_filename, 'r')
  except Exception as e:
   pass
  else:
   for line in f:
    t = line.rstrip().split(' ')
    packages_sources[t[0]] = this_package = package_info(config_filename, t[0], t[1], t[2], urllib.unquote(t[3]), None)
 if super_powers:
  read_from_file(os.path.join(dataset_conf_path, dataset_sources))
 else:
  paths = [os.path.join(root_conf_path, dataset_sources), os.path.join(user_conf_path, dataset_sources)]
  try:
   paths += [os.path.join(x, dataset_sources) for x in re.split(':|;', os.environ['PYLEARN2_DATA_PATH'])]
  except Exception:
   pass
 for path in paths:
  read_from_file(path)
 if (len(packages_sources) == 0):
  raise RuntimeError('[cf] fatal: could not find/read sources.lst (unexpected!)')

def read_packages_sources ( ) : def read_from_file ( config_filename ) : global packages_sources try : f = open ( config_filename , 'r' ) except Exception as e : pass else : for line in f : t = line . rstrip ( ) . split ( ' ' ) packages_sources [ t [ 0 ] ] = this_package = package_info ( config_filename , t [ 0 ] , t [ 1 ] , t [ 2 ] , urllib . unquote ( t [ 3 ] ) , None ) if super_powers : read_from_file ( os . path . join ( dataset_conf_path , dataset_sources ) ) else : paths = [ os . path . join ( root_conf_path , dataset_sources ) , os . path . join ( user_conf_path , dataset_sources ) ] try : paths += [ os . path . join ( x , dataset_sources ) for x in re . split ( ':|;' , os . environ [ 'PYLEARN2_DATA_PATH' ] ) ] except Exception : pass for path in paths : read_from_file ( path ) if ( len ( packages_sources ) == 0 ) : raise RuntimeError ( '[cf] fatal: could not find/read sources.lst (unexpected!)' )
reads the sources .