#NEWLINE# def find_egg_entry_point( self , object_type , name = None ) : #NEWLINE# #INDENT# '\n        Returns the (entry_point, protocol) for the with the given\n        ``name``.\n        ' #NEWLINE# if ( name is None ) : #NEWLINE# #INDENT# name = 'main' #NEWLINE# #UNINDENT# possible = [ ] #NEWLINE# for protocol_options in object_type . egg_protocols : #NEWLINE# #INDENT# for protocol in protocol_options : #NEWLINE# #INDENT# pkg_resources . require ( self . spec ) #NEWLINE# entry = pkg_resources . get_entry_info ( self . spec , protocol , prot ) #NEWLINE# if ( entry is not None ) : #NEWLINE# #INDENT# possible . append ( ( entry . load ( ) , protocol , entry . name ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not possible ) : #NEWLINE# #INDENT# dist = pkg_resources . get_distribution ( self . spec ) #NEWLINE# raise LookupError ( ( 'Entry point %r not found in egg %r (dir: %s; protocols: %s; entry_points: %s)' % ( name , self . spec , dist . location , ', ' . join ( _flatten ( object_type . egg_protocols ) ) , ', ' . join ( _flatten ( ( [ dictkeys ( ( pkg_resources . get_entry_info ( self . spec , prot , name ) or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) for prot in protocol_options ] or '(no entry points)' ) ) ) ) ) ) #NEWLINE# #UNINDENT# if ( len ( possible ) > 1 ) : #NEWLINE# #INDENT# raise LookupError ( ( 'Ambiguous entry points for %r in egg %r (protocols: %s)' % ( name , self . spec , ', ' . join ( _flatten ( protocol_options ) ) ) ) ) #NEWLINE# #UNINDENT# return possible [ 0 ]