def _download_diff_file(modified, request, review_request_id, revision, filediff_id, local_site=None):
 (review_request, response) = _find_review_request(request, review_request_id, local_site)
 if (not review_request):
  return response
 draft = review_request.get_draft(request.user)
 diffset = _query_for_diff(review_request, request.user, revision, draft)
 filediff = get_object_or_404(diffset.files, pk=filediff_id)
 encoding_list = diffset.repository.get_encoding_list()
 try:
  data = get_original_file(filediff, request, encoding_list)
 except FileNotFoundError:
  logging.exception(u'Could not retrieve file "%s" (revision %s) for filediff ID %s', filediff.dest_detail, revision, filediff_id)
  raise Http404
 if modified:
  data = get_patched_file(data, filediff, request)
 data = convert_to_unicode(data, encoding_list)[1]
 return HttpResponse(data, content_type=u'text/plain; charset=utf-8')

def _download_diff_file ( modified , request , review_request_id , revision , filediff_id , local_site = None ) : ( review_request , response ) = _find_review_request ( request , review_request_id , local_site ) if ( not review_request ) : return response draft = review_request . get_draft ( request . user ) diffset = _query_for_diff ( review_request , request . user , revision , draft ) filediff = get_object_or_404 ( diffset . files , pk = filediff_id ) encoding_list = diffset . repository . get_encoding_list ( ) try : data = get_original_file ( filediff , request , encoding_list ) except FileNotFoundError : logging . exception ( u'Could not retrieve file "%s" (revision %s) for filediff ID %s' , filediff . dest_detail , revision , filediff_id ) raise Http404 if modified : data = get_patched_file ( data , filediff , request ) data = convert_to_unicode ( data , encoding_list ) [ 1 ] return HttpResponse ( data , content_type = u'text/plain; charset=utf-8' )
downloads an original or modified file from a diff .