1
##############################################################################
3
# Copyright (c) 2002 Zope Corporation and Contributors.
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
13
##############################################################################
14
"""Beautify a XXX report.
16
Creates a HTML file from a XXXReport file.
18
$Id: XXXreport2html.py 26446 2004-07-13 16:11:36Z philikon $
26
print "Usage: beautifyXXX.py <input-filename> <output-filename>"
29
inputname = sys.argv[1]
30
outputname = sys.argv[2]
32
inputfile = open(inputname, "r")
33
outputfile = open(outputname, "w")
35
# Scan the inputfile. All lines that are "---" are used as delimiters
38
# This is file, line, context
40
for x in inputfile.readlines():
43
comments.append(current)
49
splitted = x.split(":")
50
current[0] = splitted[0]
51
current[1] = splitted[1]
52
x = ":".join(splitted[2:])
54
splitted = x.split("-")
55
x = "-".join(splitted[2:])
58
outputfile.write("""<html><head><title>XXX/TODO-Comment report for Zope 3</title>
62
<h1>Zope 3 - Developer report tools: XXX/TODO comments</h1>
63
<p>Generated on %(reporttime)s</p>
67
There are currently %(commentcount)s XXX/TODO comments.
71
<ol>""" % {"commentcount" : len(comments),
72
"reporttime" : time.strftime("%a, %d %b %Y %H:%M:%S %Z", time.localtime())
75
# Write the comments down
78
outputfile.write("""<li><b>File: %(filename)s:%(line)s</b><br/><pre>%(text)s</pre></li>""" % {'filename':x[0], 'line':x[1], 'text':"".join(x[2])})
80
outputfile.write("<ol></body></html>")