#NEWLINE# @ classmethod #NEWLINE# def _refresh_registry( cls ) : #NEWLINE# #INDENT# 'Regenerates the event handler registry.' #NEWLINE# cls . _event_types_to_classes . clear ( ) #NEWLINE# for ( obj_name , obj ) in globals ( ) . iteritems ( ) : #NEWLINE# #INDENT# if ( inspect . isclass ( obj ) and issubclass ( obj , BaseEventHandler ) ) : #NEWLINE# #INDENT# if ( obj_name == 'BaseEventHandler' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not obj . EVENT_TYPE ) : #NEWLINE# #INDENT# raise Exception ( ( 'Event handler class %s does not specify an event type' % obj_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( obj . EVENT_TYPE in cls . _event_types_to_classes ) : #NEWLINE# #INDENT# raise Exception ( ( 'Duplicate event type %s' % obj . EVENT_TYPE ) ) #NEWLINE# #UNINDENT# #UNINDENT# cls . _event_types_to_classes [ obj . EVENT_TYPE ] = obj