#NEWLINE# def __init__( self , path , metadata = None , env = None ) : #NEWLINE# #INDENT# self . finder = finder = resources . finder_for_path ( path ) #NEWLINE# if ( finder is None ) : #NEWLINE# #INDENT# import pdb #NEWLINE# pdb . set_trace ( ) #NEWLINE# #UNINDENT# if ( env and env . _cache_enabled and ( path in env . _cache . path ) ) : #NEWLINE# #INDENT# metadata = env . _cache . path [ finder ] . metadata #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( metadata is None ) : #NEWLINE# #INDENT# r = finder . find ( METADATA_FILENAME ) #NEWLINE# if ( r is None ) : #NEWLINE# #INDENT# r = finder . find ( 'METADATA' ) #NEWLINE# #UNINDENT# if ( r is None ) : #NEWLINE# #INDENT# raise ValueError ( ( 'no %s found in %s' % ( METADATA_FILENAME , path ) ) ) #NEWLINE# #UNINDENT# with contextlib . closing ( r . as_stream ( ) ) as stream : #NEWLINE# #INDENT# metadata = Metadata ( fileobj = stream , scheme = 'legacy' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# super ( InstalledDistribution , self ) . __init__ ( metadata , path , env ) #NEWLINE# if ( env and env . _cache_enabled ) : #NEWLINE# #INDENT# env . _cache . add ( self ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# r = finder . find ( 'REQUESTED' ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# import pdb #NEWLINE# pdb . set_trace ( ) #NEWLINE# #UNINDENT# self . requested = ( r is not None )