예제 #1
0
__author__ = 'micheng'

import athletemodel
import yate
import glob
import cgitb

athletes = athletemodel.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("NUAC's List of Athletes"))
print(yate.start_form("generate_data_web.py"))
print(yate.para("Select an athlete from the list to work with:"))

for each_athlete in sorted(athletes):
    print(
        yate.radio_button_id("which_athlete", each_athlete[0],
                             str(each_athlete[1])))
print(yate.end_form("Select"))

print(yate.include_footer({"See the Champion": "/cgi-bin/champion.py"}))

print(yate.include_footer({"Home": "/index.html"}))
cgitb.enable()

athletes = athletemodel.get_namesID_from_store()  #返回一个列表,包含id、name

print(yate.start_response())
print(yate.include_header("'NUAC' List of Athletes"))

print(yate.start_form("generate_timing_data.py"))
print(yate.para("Select an athlete from the list"))
for each_athlete in athletes:
    # 模板函数: def radio_button_id(rb_name, rb_value, rb_id):
    # <input  type="radio" name=rb_name  value= tr(rb_id)> rb_value
    #页面结果<input name='whick_athlete' value="1" type='radio'>James Lee
    #value的值对应数据库中某选手的id值
    print(
        yate.radio_button_id('which_athlete', each_athlete[0],
                             each_athlete[1]))
print(yate.end_form('Select'))

#新增一个表单,用于给选手增加时间值
print(yate.start_form("test_form.py"))
print(yate.para("Select an athlete from the list,and add a timing data"))
for each_athlete in athletes:
    # 模板函数: def radio_button_id(rb_name, rb_value, rb_id):
    # <input  type="radio" name=rb_name  value= tr(rb_id)> rb_value
    #页面结果<input name='whick_athlete' value="1" type='radio'>James Lee
    #value的值对应数据库中某选手的id值
    print(
        yate.radio_button_id('which_athlete', each_athlete[0],
                             each_athlete[1]))
print(yate.end_form('Select'))
예제 #3
0
#! /usr/bin/env python

import athletemodel
import yate
import cgitb

#cgitb.enable()

athletes = athletemodel.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("NUAC's List of Athletes"))
print(yate.start_form('generate_timing_data.py'))
print(yate.para('Select an athlete from the list to work with: '))

for each_athlete in sorted(athletes):
    print(yate.radio_button_id('which_athlete', each_athlete[0], each_athlete[1]))
print(yate.end_form('Select'))

print(yate.include_footer({'Home': '/index.html'}))
예제 #4
0
__author__ = 'micheng'

import athletemodel
import yate
import glob
import cgitb

athletes = athletemodel.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("NUAC's List of Athletes"))
print(yate.start_form("generate_data_web.py"))
print(yate.para("Select an athlete from the list to work with:"))

for each_athlete in sorted(athletes):
    print(yate.radio_button_id("which_athlete", each_athlete[0], str(each_athlete[1])))
print(yate.end_form("Select"))

print(yate.include_footer({"See the Champion": "/cgi-bin/champion.py"}))

print(yate.include_footer({"Home":"/index.html"}))
예제 #5
0
#!/usr/local/bin/python3
# _*_ coding:utf-8 _*_
''' generate the select list'''

import athletemodel
import yate

athletes = athletemodel.get_namesID_from_store()
print(yate.start_response())
print(yate.include_header("NUAC's List of Athletes:"))
print(yate.para("Select an athlete from the list to work with:"))
print(yate.start_form("generate_timing_data.py"))
for each_athlete in sorted(athletes):
    print(yate.radio_button_id("which_athlete",each_athlete[0],each_athlete[1]))
print(yate.end_form('Select'))
print(yate.include_footer({"Home":"/index.html"}))
예제 #6
0
#! /usr/bin/env python
import cgitb; cgitb.enable()
import athletemodel
import yate

athletes = athletemodel.get_namesID_from_store()

print yate.start_response()
print yate.include_header("Coach Kelly's List of Athletes")
print yate.start_form("generate_timing_data.py")
print yate.para("Select an athlete from the list to work with:")
for each_athlete in athletes:
    print yate.radio_button_id("which_athlete", each_athlete[0], each_athlete[1])
print yate.end_form("Select")
print yate.include_footer({"Home": "../index.html"})
예제 #7
0
#! /usr/local/bin/python3

import sportlermodell
import yate

alle_sportler = sportlermodell.namen_ids_lesen()

print(yate.antwort_anfang())
print(yate.seitenanfang("Die Sportler des DJLV"))
print(yate.form_anfang("zeitdaten_generieren.py"))
print(yate.para("Wählen Sie einen Sportler aus der Liste aus:"))

for sportler in sorted(alle_sportler):
    print(yate.radio_button_id("sportlerwahl", sportler[0], sportler[1]))
print(yate.form_ende("Auswählen"))
print(yate.seitenende({"Home": "/index.html"}))
예제 #8
0
import athletemodel
import yate
import cgitb
cgitb.enable()

athletes = athletemodel.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form('generate_timing_data.py'))
print(yate.para('Select an athlete from the list work with:'))

for each_athlete in athletes:
    print(yate.radio_button_id('which_athlete', each_athlete[0], \
                               each_athlete[1] ))

print(yate.end_form('Select'))

print(yate.include_footer({'Home':'/index.html'}))
예제 #9
0
#!/usr/bin/env python
import webprocess
import yate
#Due to the sqlite solution for storage, no need file handle anymore
#import glob

import cgitb

cgitb.enable()


#data_files = glob.glob("data/*.txt")
#ref_datas = webprocess.put_to_store(data_files)
ref_datas = webprocess.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("List of Data"))
print(yate.start_form("generate_timing_data.py"))
print(yate.para("Select an object from below: "))

for each_ref_data in ref_datas:
    #print(yate.radio_button("which_athlete", ref_datas[each_ref_data].name))
    print(yate.radio_button_id("which_athlete", each_ref_data[0],each_ref_data[1]))
print(yate.end_form("Select"))

print(yate.include_footer({"Home":"/index.html"}))
예제 #10
0
#!/usr/local/bin/python3
import athletemodel2
import yate
# import glob

# data_files = glob.glob("data/*.txt")
# athletes = athletemodel2.put_to_store(data_files)
athletes = athletemodel2.get_namesID_from_store()

print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("generate_timing_data.py"))
print(yate.para("select an athlete from the list to work with:"))
for e in athletes:
    print(yate.radio_button_id("which_athlete", e[0], e[1]))
print(yate.end_form("Select"))
print(yate.include_footer({"Home": "/index.html"}))