#NEWLINE# def process_response( self , request , response ) : #NEWLINE# #INDENT# if ( settings . DEBUG and ( 'prof' in request . GET ) ) : #NEWLINE# #INDENT# self . prof . close ( ) #NEWLINE# out = StringIO ( ) #NEWLINE# old_stdout = sys . stdout #NEWLINE# sys . stdout = out #NEWLINE# stats = hotshot . stats . load ( self . tmpfile . name ) #NEWLINE# stats . sort_stats ( 'time' , 'calls' ) #NEWLINE# stats . print_stats ( ) #NEWLINE# sys . stdout = old_stdout #NEWLINE# stats_str = out . getvalue ( ) #NEWLINE# if ( response and response . content and stats_str ) : #NEWLINE# #INDENT# response . content = ( ( '<pre>' + stats_str ) + '</pre>' ) #NEWLINE# #UNINDENT# #UNINDENT# return response