def _attach_handler_events(self, handler, events=None):
if not events:<EOL><INDENT>events = self<EOL><DEDENT>for name in events:<EOL><INDENT>meth = getattr(handler, name, None)<EOL>if meth:<EOL><INDENT>self.events[name] += meth<EOL><DEDENT><DEDENT>
Search handler for methods named after events, attaching to event handlers as applicable.

:param object handler: Handler instance
:param list events: List of event names to look for. If not specified, will do all known event names.