Back to index

plone3  3.1.7
formatHistoryDiff.py
Go to the documentation of this file.
00001 ## Script (Python) "formatHistoryDiff"
00002 ##title=Formats the history diff
00003 ##bind container=container
00004 ##bind context=context
00005 ##bind namespace=
00006 ##bind script=script
00007 ##bind subpath=traverse_subpath
00008 ##parameters=lines
00009 
00010 lst = []
00011 
00012 map = {
00013     '+' : '<ins>%s</ins><br />',
00014     '-' : '<del>%s</del><br />',
00015     ' ' : '&nbsp;%s<br />',
00016     '@' : '<strong>%s</strong><br />',
00017 }
00018 
00019 for line in lines:
00020     first = len(line) and line[0] or ''
00021     mapping =map.get(first, '%s')
00022     print mapping % line
00023 
00024 return printed