#NEWLINE# def load_cached_sources_list( sources_cache_dir = None , verbose = False ) : #NEWLINE# #INDENT# '\n    Load cached data based on the sources list.\n\n    :returns: list of :class:`CachedDataSource` instance with raw\n        rosdep data loaded.\n    :raises: :exc:`OSError` if cache cannot be read\n    :raises: :exc:`IOError` if cache cannot be read\n    ' #NEWLINE# if ( sources_cache_dir is None ) : #NEWLINE# #INDENT# sources_cache_dir = get_sources_cache_dir ( ) #NEWLINE# #UNINDENT# cache_index = os . path . join ( sources_cache_dir , 'index' ) #NEWLINE# if ( not os . path . exists ( sources_cache_dir ) ) : #NEWLINE# #INDENT# if verbose : #NEWLINE# #INDENT# print ( 'no cache index present, not loading cached sources' , file = sys . stderr ) #NEWLINE# #UNINDENT# return [ ] #NEWLINE# #UNINDENT# with open ( cache_index , 'r' ) as f : #NEWLINE# #INDENT# cache_data = f . read ( ) #NEWLINE# #UNINDENT# model = cache_data_source_loader ( sources_cache_dir , verbose = verbose ) #NEWLINE# return parse_sources_data ( cache_data , origin = cache_index , model = model )