Back to index

plone3  3.1.7
CMFDTHtmlDiff.py
Go to the documentation of this file.
00001 from Globals import InitializeClass
00002 from Products.CMFDiffTool.TextDiff import TextDiff
00003 from Products.CMFDiffTool.libs import htmldiff
00004 
00005 # Give it a dumb name so it doesn't conflict with all the other html diffs
00006 # around.  This uses Ian Bicking's very nice htmldiff.py from Web Ware for
00007 # Python.
00008 class CMFDTHtmlDiff(TextDiff):
00009     """Text difference"""
00010 
00011     meta_type = "HTML Diff"
00012 
00013     def inline_diff(self):
00014         """Return a specialized diff for HTML"""
00015         a = '\n'.join(self._parseField(self.oldValue))
00016         b = '\n'.join(self._parseField(self.newValue))
00017         return htmldiff.htmldiff(a, b)
00018 
00019 InitializeClass(CMFDTHtmlDiff)