#NEWLINE# def __call__( self , event = START ) : #NEWLINE# #INDENT# def decorator( handler ) : #NEWLINE# #INDENT# def wrapper( id ) : #NEWLINE# #INDENT# return handler ( ) #NEWLINE# #UNINDENT# if ( not ( ( event , handler ) in self . handlers ) ) : #NEWLINE# #INDENT# self . handlers . add ( ( event , handler ) ) #NEWLINE# cp . engine . subscribe ( ( event + '_thread' ) , wrapper ) #NEWLINE# #UNINDENT# return handler #NEWLINE# #UNINDENT# return decorator