#NEWLINE# def register( self , provider_class ) : #NEWLINE# #INDENT# '\n        Registers a provider with the site.\n        ' #NEWLINE# if ( not issubclass ( provider_class , BaseProvider ) ) : #NEWLINE# #INDENT# raise TypeError ( ( '%s is not a subclass of BaseProvider' % provider_class . __name__ ) ) #NEWLINE# #UNINDENT# if ( provider_class in self . _registered_providers ) : #NEWLINE# #INDENT# raise AlreadyRegistered ( ( '%s is already registered' % provider_class . __name__ ) ) #NEWLINE# #UNINDENT# if issubclass ( self , DjangoProvider ) : #NEWLINE# #INDENT# signals . post_save . connect ( self . invalidate_stored_oembeds , sender = provider_class . _meta . model ) #NEWLINE# #UNINDENT# self . _registered_providers . append ( provider_class ) #NEWLINE# self . invalidate_providers ( )