def _register(event, handler):
 k = handler.__name__
 setattr(cp.tools, k, cp.Tool(event, handler))
 cp.config.update({('tools.%s.on' % k): True})

def _register ( event , handler ) : k = handler . __name__ setattr ( cp . tools , k , cp . Tool ( event , handler ) ) cp . config . update ( { ( 'tools.%s.on' % k ) : True } )
registers the given event handler .