#NEWLINE# def _get_diff_data( self , request , mimetype , * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# resources . review_request . get_object ( request , * args , ** kwargs ) #NEWLINE# filediff = self . get_object ( request , * args , ** kwargs ) #NEWLINE# #UNINDENT# except ObjectDoesNotExist : #NEWLINE# #INDENT# return DOES_NOT_EXIST #NEWLINE# #UNINDENT# highlighting = request . GET . get ( 'syntax-highlighting' , False ) #NEWLINE# files = get_diff_files ( filediff . diffset , filediff , request = request ) #NEWLINE# populate_diff_chunks ( files , highlighting , request = request ) #NEWLINE# if ( not files ) : #NEWLINE# #INDENT# return DOES_NOT_EXIST #NEWLINE# #UNINDENT# assert ( len ( files ) == 1 ) #NEWLINE# f = files [ 0 ] #NEWLINE# payload = { #NEWLINE# #INDENT# 'diff_data' : { #NEWLINE# #INDENT# 'binary' : f [ 'binary' ] , #NEWLINE# 'chunks' : f [ 'chunks' ] , #NEWLINE# 'num_changes' : f [ 'num_changes' ] , #NEWLINE# 'changed_chunk_indexes' : f [ 'changed_chunk_indexes' ] , #NEWLINE# 'new_file' : f [ 'newfile' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# api_format = mimetype . split ( '+' ) [ ( - 1 ) ] #NEWLINE# resp = WebAPIResponse ( request , payload , api_format = api_format ) #NEWLINE# set_last_modified ( resp , filediff . diffset . timestamp ) #NEWLINE# return resp