#! /usr/bin/env python
import sys, string
f = open('TODO', 'r')
sys.stdout = open('admin/www/todo.html', 'w')
lines = f.readlines()
f.close()
l = len(lines)
i = 0
print "
The Mailman TODO list"
while lines[i][0] <> '*':
if string.strip(lines[i]) <> '':
print "",lines[i][:-1], "
"
i = i + 1
if i == l: break
info = []
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]
else:
points.append(lines[i][:-1])
i = i + 1
info.append((category,points))
if i == l: break
print 'Categories:
'
print ''
x = 1
for category, stuff in info:
print '- %s
' % (x,category)
x = x + 1
print '
'
print '
'
x = 1
for category, stuff in info:
print '%s
' % (x, category)
x = x + 1
print ''
for item in stuff:
print '- %s
' % item
print '
'
print ''