From 30def9df99f47ce6552fcda0712fc663a2ff8963 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 22 Sep 2000 16:54:53 +0000 Subject: New TODO => todo.html generator. Requires Python 2.0 --- admin/bin/mm2do | 99 +++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 52 deletions(-) (limited to 'admin') diff --git a/admin/bin/mm2do b/admin/bin/mm2do index 40e644305..f58ffb4b4 100755 --- a/admin/bin/mm2do +++ b/admin/bin/mm2do @@ -16,58 +16,53 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import sys, string -f = open('TODO', 'r') -sys.stdout = open('admin/www/todo.html', 'w') -lines = f.readlines() -f.close() -for l in range(len(lines)): - if lines[l][0] == '\f': - l = l - 1 - break -i = 0 -print "
' + del items[:] + + +header = '' +items = [['']] +hasitems = 0 while 1: - if lines[i][0] <> '*': break - category = lines[i][1:-1] - i = i + 1 - points = [] - while i<>l and lines[i][0] <> '*': - if string.strip(lines[i]) == '': - i = i + 1 - continue - if lines[i][0] == '-': - points.append(lines[i][1:-1]) - elif len(points): - if points[-1][-1] <> ' ' and lines[i][0] <> ' ': - points[-1] = points[-1] + ' ' - points[-1] = points[-1] + lines[i][:-1] + line = infp.readline() + if not line or line[0] == '\f': + break + if not line[0].isspace(): + dumpsection(header, items, hasitems) + header = line + continue + # find out what the first non-ws character on the line is + line = line.lstrip() + if line and line[0] == '-': + items.append([line[2:-1]]) + hasitems += 1 else: - points.append(lines[i][:-1]) - i = i + 1 - info.append((category,points)) - if i == l: break -print '