from lib import athletemodel 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" }))
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"}))
''' 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"}))
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" }))
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"}))
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 athlete_info = athletemodel.get_athlete_from_id(athlete_ID) print(yate.start_response()) print( yate.include_header( "Borrando el atleta con ID {0} y nombre {1} de la base de datos". format(athlete_ID, athlete_info['Name']))) try: athletemodel.BorraTodosTiemposAtleta(athlete_ID) athletemodel.BorraAtleta(athlete_ID) 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"}))
from templates import yate print(yate.start_response()) print(yate.include_header("Introducir el nombre del nuevo atleta")) print(yate.start_form("IndicarTiempos.py")) print(yate.text_field("nombre_atleta", "Introducir Nombre")) print(yate.end_form("Aceptar")) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
@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.start_form("RealizarBorrado.py")) print( yate.include_header( "Esta seguro que desea realizar el borrado de la marca {0}" " para el atleta {1}".format(Tiempo, athlete_info['Name']))) print(yate.hidden_input("Tiempo", Tiempo)) print(yate.hidden_input("ID", athlete_ID)) print(yate.end_form("Aceptar")) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
@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"}))
''' Created on 13 may. 2016 @author: Manuel ''' 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("Registro de atletas")) print(yate.start_form("generate_timing_data.py")) print(yate.para("Selecciona el atleta del cual deseas ver los tiempos:")) for each_athlete in athletes_info: print(yate.radio_button("ID", each_athlete['name'], each_athlete['ID'])) print(yate.end_form("Aceptar")) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
''' Created on 13 may. 2016 @author: jkmrto ''' import glob from lib import Funciones 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("Tabla comparativa de atletas")) Titulos = ["Nombre", "Mejor Tiempo", "Diferencia de tiempo con el mejor", "Media de los 3 mejores tiempos", "Diferencia con la mejor media de tiempos"] Tabla = Funciones.ObtenerDatosComparacion() Tabla.insert(0, Titulos) print(yate.simple_table(Tabla)) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
''' Created on 13 may. 2016 @author: jkmrto ''' 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("Lista actual de atletas")) print(yate.start_form("ConfirmarBorrado.py")) print(yate.para("Seleccionar el atleta que se quiere borrar:")) for each_athlete in athletes_info: print(yate.radio_button("ID", each_athlete['name'], each_athlete['ID'])) print(yate.end_form("Aceptar")) print(yate.include_footer({"Indice": "/index.html"}))
import cgi import cgitb from templates import yate 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":
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("Lista de Atletas:")) print(yate.start_form("IndicarTiempo.py")) print(yate.para("Seleccionar atleta al cual añadir el tiempo:")) for each_athlete in athletes_info: print(yate.radio_button("ID", each_athlete['name'], each_athlete['ID'])) print(yate.end_form("Acepar")) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
import cgi import cgitb from lib import athletemodel from templates import yate cgitb.enable() form_data = cgi.FieldStorage() athlete_ID = form_data['ID'].value new_time = form_data['tiempo'].value print(yate.start_response()) yate.para(new_time + athlete_ID) print( yate.include_header("Insertando el tiempo {0} del atleta {1}".format( new_time, athlete_ID))) try: athletemodel.add_new_time_to_athelte(athlete_ID, new_time) print( yate.para( "Nuevo tiempo: {0} insertado correctametne al atleta con ID: {1}". format(new_time, athlete_ID))) except Exception as e: print(yate.para("Error añadiendo el nuevo tiempo" + str(e))) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))