'
for line in f:
todos = r_todo.findall(line)
result.extend(msg % (path, path, t) for t in todos)
f.close()
result.extend(['
', ''])
return result
def todo(site=None):
if site is None:
site = os.environ.get('DOCUMENT_ROOT') or '/web/inamidst.com'
if site.endswith('/'):
prefix = '/'
else: prefix = ''
robotstxt = os.path.join(site, 'robots.txt')
if os.path.exists(robotstxt):
rp = cgiu.RobotsTxt(fn=robotstxt)
else: rp = None
result = []
for (dirpath, dirnames, filenames) in os.walk(site):
for name in filenames:
fn = os.path.join(dirpath, name)
path = prefix + fn[len(site):]
if (not rp) or rp.fetchable(path):
if cgiu.any(suffixen, fn.endswith):
result.extend(getTodos(fn, path))
i = __doc__.find('---')
cgiu.serve(200, __doc__[i+3:] % '\n'.join(result))
def main():
if cgiu.method == 'GET': todo()
else: cgiu.serve(501, "