#NEWLINE# def on_key_press( self , symbol , modifiers ) : #NEWLINE# #INDENT# if ( ( modifiers & key . key . MOD_CTRL ) and ( symbol == key . key . C ) ) : #NEWLINE# #INDENT# self . buffer = '' #NEWLINE# self . pre_buffer = '' #NEWLINE# return #NEWLINE# #UNINDENT# if ( symbol == key . key . ENTER ) : #NEWLINE# #INDENT# self . write ( ( '%s%s\n' % ( self . get_prompt ( ) , self . buffer ) ) ) #NEWLINE# self . execute ( ( self . pre_buffer + self . buffer ) ) #NEWLINE# self . buffer = '' #NEWLINE# return #NEWLINE# #UNINDENT# if ( symbol == key . key . BACKSPACE ) : #NEWLINE# #INDENT# self . buffer = self . buffer [ : ( - 1 ) ] #NEWLINE# return #NEWLINE# #UNINDENT# return EVENT_UNHANDLED