#NEWLINE# def __init__( self , parent , event_type , * args , **kwargs ) : #NEWLINE# #INDENT# if ( parent is None ) : #NEWLINE# #INDENT# parent = self #NEWLINE# #UNINDENT# self . parent = parent #NEWLINE# self . event_type = event_type #NEWLINE# self . listeners = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . callback_fnname = ( 'on%s' % event_type ) #NEWLINE# self . extra_args = args #NEWLINE# self . extra_kwargs = kwargs #NEWLINE# add_listener_fnname = ( 'add%sListener' % event_type ) #NEWLINE# del_listener_fnname = ( 'remove%sListener' % event_type ) #NEWLINE# listener = ( '_%sListeners' % event_type ) #NEWLINE# on_event_name = ( 'on%sEvent' % event_type ) #NEWLINE# setattr ( parent , listener , self ) #NEWLINE# setattr ( parent , add_listener_fnname , self . addListener ) #NEWLINE# setattr ( parent , del_listener_fnname , self . removeListener ) #NEWLINE# setattr ( parent , on_event_name , self . onEvent )