def diff_prettyHtml(self, diffs):
 html = []
 ct = 1
 for (op, data) in diffs:
  text = data.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<br>')
  if (op == self.DIFF_INSERT):
   html.append(('<ins style="background:#e6ffe6;">%s</ins>' % text))
  elif (op == self.DIFF_DELETE):
   html.append(('<del style="background:#ffe6e6;">%s</del>' % text))
  elif (op == self.DIFF_EQUAL):
   html.append(('<span>%s</span>' % text))
 return ''.join(html)

def diff_prettyHtml ( self , diffs ) : html = [ ] ct = 1 for ( op , data ) in diffs : text = data . replace ( '&' , '&amp;' ) . replace ( '<' , '&lt;' ) . replace ( '>' , '&gt;' ) . replace ( '\n' , '<br>' ) if ( op == self . DIFF_INSERT ) : html . append ( ( '<ins style="background:#e6ffe6;">%s</ins>' % text ) ) elif ( op == self . DIFF_DELETE ) : html . append ( ( '<del style="background:#ffe6e6;">%s</del>' % text ) ) elif ( op == self . DIFF_EQUAL ) : html . append ( ( '<span>%s</span>' % text ) ) return '' . join ( html )
convert a diff array into a pretty html report .