def populate_diff_chunks(files, enable_syntax_highlighting=True, request=None):
 from reviewboard.diffviewer.chunk_generator import get_diff_chunk_generator
 for diff_file in files:
  generator = get_diff_chunk_generator(request, diff_file[u'filediff'], diff_file[u'interfilediff'], diff_file[u'force_interdiff'], enable_syntax_highlighting)
  chunks = list(generator.get_chunks())
  diff_file.update({u'chunks': chunks, u'num_chunks': len(chunks), u'changed_chunk_indexes': [], u'whitespace_only': (len(chunks) > 0)})
  for (j, chunk) in enumerate(chunks):
   chunk[u'index'] = j
   if (chunk[u'change'] != u'equal'):
    diff_file[u'changed_chunk_indexes'].append(j)
    meta = chunk.get(u'meta', {})
    if (not meta.get(u'whitespace_chunk', False)):
     diff_file[u'whitespace_only'] = False
  diff_file.update({u'num_changes': len(diff_file[u'changed_chunk_indexes']), u'chunks_loaded': True})

def populate_diff_chunks ( files , enable_syntax_highlighting = True , request = None ) : from reviewboard . diffviewer . chunk_generator import get_diff_chunk_generator for diff_file in files : generator = get_diff_chunk_generator ( request , diff_file [ u'filediff' ] , diff_file [ u'interfilediff' ] , diff_file [ u'force_interdiff' ] , enable_syntax_highlighting ) chunks = list ( generator . get_chunks ( ) ) diff_file . update ( { u'chunks' : chunks , u'num_chunks' : len ( chunks ) , u'changed_chunk_indexes' : [ ] , u'whitespace_only' : ( len ( chunks ) > 0 ) } ) for ( j , chunk ) in enumerate ( chunks ) : chunk [ u'index' ] = j if ( chunk [ u'change' ] != u'equal' ) : diff_file [ u'changed_chunk_indexes' ] . append ( j ) meta = chunk . get ( u'meta' , { } ) if ( not meta . get ( u'whitespace_chunk' , False ) ) : diff_file [ u'whitespace_only' ] = False diff_file . update ( { u'num_changes' : len ( diff_file [ u'changed_chunk_indexes' ] ) , u'chunks_loaded' : True } )
populates a list of diff files with chunk data .