#! /usr/local/bin/python2.7
import cgitb

import sys
sys.path.append('..')

import cgi

import athletemodel
import yate


athletes=athletemodel.get_from_store()

form_data=cgi.FieldStorage()
athlete_name=form_data['which_athlete'].value

print(yate.start_response())
print(yate.include_header("Coach Kelly's Timing Data"))
print(yate.header("Athlete:"+ athlete_name+ ".DOB:"+ \
                  athletes[athlete_name].dob+ "."))
print(yate.para("the top times for this athlete are:"))
print(yate.u_list(athletes[athlete_name].top3))
print(yate.include_footer ({"Home" :"/index.html", \
                            "Select another athlete": "generate_list.py"})) 
