#NEWLINE# def load( self , name ) : #NEWLINE# #INDENT# if ( name in self . impls ) : #NEWLINE# #INDENT# return self . impls [ name ] ( ) #NEWLINE# #UNINDENT# if self . auto_fn : #NEWLINE# #INDENT# loader = self . auto_fn ( name ) #NEWLINE# if loader : #NEWLINE# #INDENT# self . impls [ name ] = loader #NEWLINE# return loader ( ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# import pkg_resources #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for impl in pkg_resources . iter_entry_points ( self . group , name ) : #NEWLINE# #INDENT# self . impls [ name ] = impl . load #NEWLINE# return impl . load ( ) #NEWLINE# #UNINDENT# #UNINDENT# raise exc . NoSuchModuleError ( ( "Can't load plugin: %s:%s" % ( self . group , name ) ) )