Esempio n. 1
0
import cgi
import cgitb

from templates import yate

cgitb.enable()

form_data = cgi.FieldStorage()

athlete_ID = form_data['ID'].value

print(yate.start_response())

print(yate.include_header("Introducir el nueovo tiempo"))

print(yate.start_form("AnadirTiempoDDBB.py"))

print(yate.para("Añadir tiempo para el atleta con ID: {}".format(athlete_ID)))

print(yate.text_field("tiempo", "Introducir Tiempo"))

print(yate.hidden_input("ID", athlete_ID))

print(yate.end_form("Aceptar"))

print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
Esempio n. 2
0
import glob

from lib import athletemodel
from templates import yate

data_files = glob.glob("data/*.txt")
athletes_info = athletemodel.get_namesID_from_store()

print(yate.start_response())

print(yate.include_header("Coach Martin's List of Athletes"))

print(yate.start_form("adding_time.py"))

print(yate.para("Select an athlete from the list to add time:"))
for each_athlete in athletes_info:
    print(
        yate.radio_button("which_athlete", each_athlete['name'],
                          each_athlete['ID']))

print(yate.text_field("athlete_new_time", "athlete_new_time"))

print(yate.end_form("Select"))

print(
    yate.include_footer({
        "Home": "/index.html",
        "Show timing athlete": "generate_list.py"
    }))
Esempio n. 3
0
from templates import yate
from images import GeneradorGraficas

cgitb.enable()

form_data = cgi.FieldStorage()
athlete_ID = form_data['ID'].value

athlete_info = athletemodel.get_athlete_from_id(athlete_ID)

print(yate.start_response())

print(yate.start_form("ConfirmarBorrado.py"))

print(yate.include_header("Tiempos para " + athlete_info['Name']))

print(yate.para("Seleccionar la marca que se quiere borrar:"))

for data in athlete_info['data']:
    print(yate.radio_button("Tiempo", "", data))

print(yate.hidden_input("ID", athlete_ID))

print(yate.end_form("Aceptar"))

print(
    yate.include_footer({
        "Seleccinar otro atleta":
        "/cgi-bin/BorrarTiempoAtleta/MostrarySeleccionarAtleta.py"
    }))
print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
Esempio n. 4
0
'''
Created on 25 Enero. 2017

@author: jkmrto
'''
import cgi
import cgitb

from lib import athletemodel
from templates import yate
cgitb.enable()

form_data = cgi.FieldStorage()
athlete_ID = form_data['ID'].value
Tiempo = form_data['Tiempo'].value

athlete_info = athletemodel.get_athlete_from_id(athlete_ID)

print(yate.start_response())
print(yate.include_header("Borrando la  marca {0}"
                          " para el atleta {1}".format(Tiempo, athlete_info['Name'])))
try:
    athletemodel.BorraTiempoAtleta(athlete_ID, Tiempo)
    print(yate.para(" El borrado se ha relizado correctamente"))
except Exception as e:
    print(yate.para("Error borrando el dato:" + str(e)))



print(yate.include_footer({"Indice": "/index.html"}))
Esempio n. 5
0
import cgitb

from lib import athletemodel
from templates import yate
cgitb.enable()

form_data = cgi.FieldStorage()
athlete_ID = form_data['ID'].value

athlete_info = athletemodel.get_athlete_from_id(athlete_ID)

print(yate.start_response())

print(yate.start_form("RealizarBorrado.py"))

print(
    yate.include_header(
        "Esta seguro que desea borrar al atleta: {0} con ID: {1}".format(
            athlete_info["Name"], athlete_ID)))

print(yate.hidden_input("ID", athlete_ID))

print(yate.end_form("Aceptar"))

print(
    yate.include_footer({
        "Seleccinar otro atleta":
        "/cgi-bin/borrarAtleta/MostrarySeleccionarAtleta.py"
    }))
print(yate.include_footer({"Indice": "/index.html"}))
Esempio n. 6
0
@author: Manuel
'''
import cgi
import cgitb

from lib import athletemodel
from templates import yate
from images.GeneradorGraficas import GenerarGraficasTiempos

cgitb.enable()

form_data = cgi.FieldStorage()
athlete_ID = form_data['ID'].value

athlete_info = athletemodel.get_athlete_from_id(athlete_ID)

print(yate.start_response())

print(yate.include_header("Datos de tiempo para: " + athlete_info['Name']))

print(yate.para("The top times for this athlete are:"))
print(yate.u_list(athlete_info['top3']))

GenerarGraficasTiempos(athlete_info, "images/tiempos.png")

print(yate.para("Grafica de Evolucion de sus tiempos:"))
print(yate.simple_plot("/images/tiempos.png"))

print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
print(yate.include_footer({"Seleccionar otro atleta": "generate_list.py"}))
Esempio n. 7
0
import cgi
import cgitb

from lib import athletemodel
from templates import yate

cgitb.enable()

form_data = cgi.FieldStorage()

athlete_ID = form_data['which_athlete'].value
athlete_new_time = form_data['athlete_new_time'].value

print(yate.start_response())

print(yate.include_header("Coach Martin's List of Athletes"))

try:
    athletemodel.add_new_time_to_athelte(athlete_ID, athlete_new_time)
    print(
        yate.para("New time: {0} added correctly to athleteID: {1}".format(
            athlete_new_time, athlete_ID)))
except Exception as e:
    print(yate.para("Error adding new time" + str(e)))

print(
    yate.include_footer({
        "Home": "/index.html",
        "Add timing to athlete": "add_time_form.py",
        "Show time of athlete": ""
    }))
Esempio n. 8
0
cgitb.enable()
form_data = cgi.FieldStorage()

nombre_atleta = form_data['nombre_atleta'].value

print(yate.start_response())

print(yate.include_header("Introducir las marcas de {}".format(nombre_atleta)))

print(yate.start_form("FinalAnadirAtletaDDBB.py"))

print(yate.hidden_input("Nombre", nombre_atleta))
print(yate.text_field("tiempo1", "Indicar tiempo"))
print(yate.text_field("tiempo2", "Indicar tiempo"))
print(yate.text_field("tiempo3", "Indicar tiempo"))
print(yate.text_field("tiempo4", "Indicar tiempo"))
print(yate.text_field("tiempo5", "Indicar tiempo"))
print(yate.text_field("tiempo6", "Indicar tiempo"))
print(yate.text_field("tiempo7", "Indicar tiempo"))
print(yate.text_field("tiempo8", "Indicar tiempo"))
print(yate.text_field("tiempo9", "Indicar tiempo"))
print(yate.text_field("tiempo10", "Indicar tiempo"))


print(yate.end_form("Aceptar"))

print(yate.include_footer({"Renombrar Atleta":
                               "/cgi-bin/AnadirAtleta/IndicarNombreAtleta.py"}))
print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))