#NEWLINE# def hook( self , hook_name ) : #NEWLINE# #INDENT# "A decorator that's used to register a new hook handler.\n\n        :param hook_name: the event to handle\n        " #NEWLINE# def wrapper( fn ) : #NEWLINE# #INDENT# self . register_hook ( hook_name , fn ) #NEWLINE# return fn #NEWLINE# #UNINDENT# return wrapper