#NEWLINE# def get_traceback_frame_variables( self , request , tb_frame ) : #NEWLINE# #INDENT# '\n        Replaces the values of variables marked as sensitive with\n        stars (*********).\n        ' #NEWLINE# current_frame = tb_frame . f_back #NEWLINE# sensitive_variables = None #NEWLINE# while ( current_frame is not None ) : #NEWLINE# #INDENT# if ( ( current_frame . f_code . co_name == 'sensitive_variables_wrapper' ) and ( 'sensitive_variables_wrapper' in current_frame . f_locals ) ) : #NEWLINE# #INDENT# wrapper = current_frame . f_locals [ 'sensitive_variables_wrapper' ] #NEWLINE# sensitive_variables = getattr ( wrapper , 'sensitive_variables' , None ) #NEWLINE# break #NEWLINE# #UNINDENT# current_frame = current_frame . f_back #NEWLINE# #UNINDENT# cleansed = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( self . is_active ( request ) and sensitive_variables ) : #NEWLINE# #INDENT# if ( sensitive_variables == '__ALL__' ) : #NEWLINE# #INDENT# for ( name , value ) in tb_frame . f_locals . items ( ) : #NEWLINE# #INDENT# cleansed [ name ] = CLEANSED_SUBSTITUTE #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for ( name , value ) in tb_frame . f_locals . items ( ) : #NEWLINE# #INDENT# if ( name in sensitive_variables ) : #NEWLINE# #INDENT# value = CLEANSED_SUBSTITUTE #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , HttpRequest ) : #NEWLINE# #INDENT# value = self . get_request_repr ( value ) #NEWLINE# #UNINDENT# #UNINDENT# cleansed [ name ] = value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for ( name , value ) in tb_frame . f_locals . items ( ) : #NEWLINE# #INDENT# if isinstance ( value , HttpRequest ) : #NEWLINE# #INDENT# value = self . get_request_repr ( value ) #NEWLINE# #UNINDENT# cleansed [ name ] = value #NEWLINE# #UNINDENT# #UNINDENT# if ( ( tb_frame . f_code . co_name == 'sensitive_variables_wrapper' ) and ( 'sensitive_variables_wrapper' in tb_frame . f_locals ) ) : #NEWLINE# #INDENT# cleansed [ 'func_args' ] = CLEANSED_SUBSTITUTE #NEWLINE# cleansed [ 'func_kwargs' ] = CLEANSED_SUBSTITUTE #NEWLINE# #UNINDENT# return cleansed . items ( )