#NEWLINE# def _register( event , handler ) : #NEWLINE# #INDENT# ' Registers the given event handler (e.g., "on_end_request").\n    ' #NEWLINE# k = handler . __name__ #NEWLINE# setattr ( cp . tools , k , cp . Tool ( event , handler ) ) #NEWLINE# cp . config . update ( { #NEWLINE# #INDENT# ( 'tools.%s.on' % k ) : True , #NEWLINE# #UNINDENT# } )