#NEWLINE# def strip_prompt( self , a_string ) : #NEWLINE# #INDENT# '\n        Strip the trailing router prompt from the output\n        ' #NEWLINE# response_list = a_string . split ( '\n' ) #NEWLINE# last_line = response_list [ ( - 1 ) ] #NEWLINE# if ( a_string . base_prompt in last_line ) : #NEWLINE# #INDENT# return '\n' . join ( response_list [ : ( - 1 ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return a_string