#NEWLINE# def _get_on_name( self , func ) : #NEWLINE# #INDENT# 'Return `eventname` when the function name is `on_<eventname>()`.' #NEWLINE# r = re . match ( '^on_(.+)$' , event . __name__ ) #NEWLINE# if r : #NEWLINE# #INDENT# event = r . group ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'The function name should be `on_<eventname>`().' ) #NEWLINE# #UNINDENT# return event