#NEWLINE# def register_pygame_handler( self , event , handler ) : #NEWLINE# #INDENT# "Registers a method to be a handler for a certain type of Pygame\n        event.\n\n        Args:\n            event: A string of the Pygame event name you're registering this\n            handler for.\n            handler: A method that will be called when this Pygame event is\n            posted.\n        " #NEWLINE# if ( event not in self . registered_pygame_handlers ) : #NEWLINE# #INDENT# self . registered_pygame_handlers [ event ] = set ( ) #NEWLINE# #UNINDENT# self . registered_pygame_handlers [ event ] . add ( handler ) #NEWLINE# self . pygame_allowed_events . append ( event ) #NEWLINE# self . log . debug ( 'Adding Window event handler. Event:%s, Handler:%s' , handler , handler ) #NEWLINE# pygame . event . set_allowed ( self . pygame_allowed_events )