#!/usr/bin/python
print """Content-Type: text/html\n\n"""
print """\n\n"""
import cgitb; cgitb.enable()
import os
import sys
try:
from Tanks import Program, setup, conditions, actions, docs
except:
path = os.getcwd().split('/')
path.pop()
path.append('lib')
sys.path.append(os.path.join('/', *path))
import Program, setup, conditions, actions, docs
print open('head.html').read() % "Documentation"
print '
'
print 'Pflanzarr Documentation
'
print open('links.html').read()
print Program.__doc__
print 'Setup Actions:
'
print 'These functions can be used to setup your tank. Abuse of these functions has, in the past, resulted in mine sweeping duty. With a broom.'
print ""
docs.mkDocTable(setup.setup.values())
print '
Conditions:
'
print 'These functions are used to check the state of reality. If reality stops being real, refer to chapter 5 in your girl scout handbook.'
docs.mkDocTable(conditions.conditions.values())
print '
Actions:
'
print 'These actions are not for cowards. Remember, if actions contradict, your tank will simply do the last thing it was told in a turn. If ordered to hop on a plane to hell it will gladly do so. If order to make tea shortly afterwards, it will serve it politely and with cookies instead.'
docs.mkDocTable(actions.actions.values())
print '