#NEWLINE# def register_plugin( self , name , plugin ) : #NEWLINE# #INDENT# if ( not isinstance ( plugin , Plugin ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Expected Plugin, got: %r' % plugin ) ) #NEWLINE# #UNINDENT# if ( name in self . plugins ) : #NEWLINE# #INDENT# raise KeyError ( ( 'Plugin with name already exists: %r' % name ) ) #NEWLINE# #UNINDENT# self . plugins [ name ] = self