Back to index

plone3  3.1.7
diffSpliter.py
Go to the documentation of this file.
00001 ##parameters=ndiff
00002 
00003 lines = ndiff.split('\n')
00004 lines = [l.replace('+\n','') for l in lines]
00005 lines = [l.replace('-\n','') for l in lines]
00006 
00007 result = []
00008 
00009 for line in lines:
00010     css_class = None
00011     if line.startswith('+'):
00012         css_class = 'pos_diff'
00013     if line.startswith('-'):
00014         css_class = 'neg_diff'
00015     result.append( {'css_class':css_class,'line':line} )
00016 
00017 return result