[Zope3-checkins] CVS: Zope3/utilities - XXXreport:1.2 XXXreport2html.py:1.2
Christian Zagrodnick
cz@gocept.com
Sat, 7 Dec 2002 12:37:36 -0500
Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv8092
Modified Files:
XXXreport XXXreport2html.py
Log Message:
uses mktmp now
searches also for TODO comments
runs also if cwd is not the utilities directory
=== Zope3/utilities/XXXreport 1.1 => 1.2 ===
--- Zope3/utilities/XXXreport:1.1 Sat Dec 7 11:52:08 2002
+++ Zope3/utilities/XXXreport Sat Dec 7 12:37:35 2002
@@ -1,12 +1,34 @@
#!/bin/bash
-TMPFILE=/tmp/xxxtmp.txt
-TARGET=XXXreport.html
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+# $Id$
-rm $TARGET
-echo "Looking for XXX comments"
-grep "# XXX" ../* -niIr -A 3 > $TMPFILE
-echo "Beautifying XXX comments"
-python2.2 XXXreport2html.py $TMPFILE $TARGET
-rm $TMPFILE
-echo "Done."
+# This script assumes it is located in the utilities directory of Zope3
+
+
+PYTHON=`which python2.2`
+
+PATTERN='# ?(XXX|TODO)'
+TMPFILE=`mktemp`
+TARGET=${1:-XXXreport.html}
+ZOPEBASE=`dirname $0`/../
+BASE=`dirname $0`
+
+# find also finds hidden files
+find $ZOPEBASE -! -name "*.pyc" -print0 | \
+ xargs -0 grep -niIr -A 3 -E "$PATTERN" | \
+ $PYTHON $BASE/XXXreport2html.py /dev/stdin $TARGET >/dev/null
+
+rm -f $TMPFILE
=== Zope3/utilities/XXXreport2html.py 1.1 => 1.2 ===
--- Zope3/utilities/XXXreport2html.py:1.1 Sat Dec 7 11:52:08 2002
+++ Zope3/utilities/XXXreport2html.py Sat Dec 7 12:37:35 2002
@@ -54,15 +54,15 @@
x = "-".join(splitted[2:])
current[2].append(x)
-outputfile.write("""<html><head><title>XXX-Comment report for Zope 3</title>
+outputfile.write("""<html><head><title>XXX/TODO-Comment report for Zope 3</title>
</head>
<body>
-<h1>Zope 3 - Developer report tools: XXX comments</h1>
+<h1>Zope 3 - Developer report tools: XXX/TODO comments</h1>
<hr>
<h3>Summary</h3>
<p>
- There are currently %(commentcount)s XXX comments.
+ There are currently %(commentcount)s XXX/TODO comments.
</p>
<hr/>
<h3>Listing</h3>