当前位置: 首页>>代码示例>>Python>>正文


Python yate.start_form函数代码示例

本文整理汇总了Python中yate.start_form函数的典型用法代码示例。如果您正苦于以下问题:Python start_form函数的具体用法?Python start_form怎么用?Python start_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了start_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: channels_offline

def channels_offline(channel_offline=True):
    message = ("""SELECT ulv_genchannels.channel_id,
    tvs_channel.chname, 
    ulv_genaddress.gen_address, 
    ulv_status.des
    FROM ulv_genchannels
    NATURAL JOIN tvs_channel, ulv_genaddress, ulv_status
    WHERE ulv_genchannels.channel_id = tvs_channel.chid 
    AND tvs_channel.chid = ulv_genaddress.channel_id 
    AND ulv_status.status_id=1 order by ulv_genchannels.sort_id, ulv_genchannels.channel_id""")

    conn = my_sql.connect()
    cursor = conn.cursor()
    cursor.execute(message)
    result = cursor.fetchall()
    conn.close()
    
    headers = ["频道名称", "频道编号", "直播路径", "发布状态"]
    print(yate.start_response())
    if channel_offline:
        print(yate.include_header("频道下线"))
    else:
        print(yate.include_header("已发布频道"))
    print(yate.start_form("ft_channels_offline.py"))
    print(yate.start_table(tb_width="100%", tb_border="1px solid"))
    print(yate.tb_header(headers))
    
    for array in result:
        print(yate.do_table(array, channel_offline))

    print(yate.end_table())
    if channel_offline==True:
        print(yate.end_form("确定"))
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:33,代码来源:printChannels.py

示例2: channels

def channels():
    message = """select live_channel.chid,tvs_channel.chname,live_server.live_ip,live_url.live_path,live_status.sname """
    message += """from tvs_channel,live_channel,live_server,live_url,live_status where tvs_channel.chid=live_channel.chid and """
    message += """live_status.statusid=live_channel.statusid and live_url.live_urlid=live_channel.live_urlid and live_url.serverid = live_server.serverid """
    message += """and live_url.status=0 order by live_channel.chid """

    conn = my_sql.connect()
    cursor = conn.cursor()
    cursor.execute(message)
    result = cursor.fetchall()
    conn.close()
    
    headers = ["频道名称", "直播地址", "直播路径", "发布状态"]
    print(yate.start_response())
    print(yate.include_header("JSB living system"))
    print(yate.start_form("edit.py"))
    print(yate.start_table(tb_width="80%", tb_border="1px solid"))
    print(yate.tb_caption("已发布频道"))
    print(yate.tb_header(headers))

    for array in result:
        print(yate.tb_data(array[1:]))
    print(yate.end_table())
    print(yate.end_form())
    print(yate.include_footer({"Home": "/index.html"}))
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:25,代码来源:delete_channels.py

示例3: ft_channels_edit_second

def ft_channels_edit_second():
    start_response()
    chid = get_formData('which_chid')
    obj = deal_mysql()
    msg = ("""SELECT ulv.channel_id,tvs.chname,ulv.gen_address 
    from ulv_genaddress as ulv inner join tvs_channel as tvs 
    on ulv.channel_id=tvs.chid and ulv.channel_id=%s""" % chid[0])
    result = obj.askdata(msg)
    info = result.pop(0)  
    headers = ["频道信息"]   
    print(yate.include_header("频道修改"))       
    print(yate.start_form("ft_channels_editDone.py"))
    print(yate.start_table(tb_width="100%", tb_border="1px solid"))
    print(yate.tb_header(headers))       
    print(yate.start_row())
    print(yate.checked_radio_button('which_chid',[info[0],info[1]]))
    print(yate.end_row()) 
    print(yate.start_row())
    print(yate.input_text("which_addr",info[2]))
    print(yate.end_row())     
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())
    obj.Close()  
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:25,代码来源:printChannels.py

示例4: ft_channels_editFirst

def ft_channels_editFirst():    
    obj = deal_mysql()
    msg = ('''SELECT ulv.channel_id,tvs.chname 
    from ulv_genchannels as ulv
    inner join tvs_channel as tvs
    on tvs.chid=ulv.channel_id order by ulv.sort_id, ulv.channel_id;''')
    
    result = obj.askdata(msg)
    headers = ["频道名称"]
    print(yate.start_response())
    print(yate.include_header("频道维护"))       
    print(yate.start_form("ft_channels_edit.py"))
    print(yate.start_table(tb_width="100%", tb_border="1px solid"))
    print(yate.tb_header(headers))  
    print(yate.start_row())
    print(yate.select('which_chid'))
    #for array in result:        
    print(yate.select_option(result))
    print(yate.end_select())
    print(yate.end_row()) 
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())   
    obj.Close()
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:25,代码来源:printChannels.py

示例5: select_sp

def select_sp():    
    
    obj = deal_mysql("uspset.ini")
    msg =  '''select id,name from u_sp'''
    results = obj.askdata(msg)
    obj.Close()
    
    headers = ["运营商名称"]
    print(yate.start_response())
  
    print(yate.include_header("首页运营"))

    print(yate.start_form("op_guidepage_arrange.py"))    
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.tb_header(headers))
    for array in results:
        print(yate.start_row())
        print(yate.checked_radio_button('which_spid',[array[0],array[1]]))
        print(yate.end_row())
    print(yate.end_table())
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())        
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:25,代码来源:printChannels.py

示例6: channels_operation

def channels_operation(sp_id):  
    chidDic  = dict() #store the checked chid from sp_id
    obj = deal_mysql()
    
    msg = ('''SELECT ulv.channel_id,tvs.chname 
    from ulv_genchannels as ulv
    inner join tvs_channel as tvs
    on tvs.chid=ulv.channel_id order by ulv.sort_id, ulv.channel_id;''')
    
    msgn = ('''SELECT chid,sp_id from ulv_opchannels where sp_id=%d''' % int(sp_id))
    
    result = obj.askdata(msg)    
    checked = obj.askdata(msgn)
    for ele in checked:
        chidDic[ele[0]] = ele[1]
    nobj = deal_mysql('uspset.ini')
    msgs = '''select name from u_sp where id=%s''' % int(sp_id)
    response = nobj.askdata(msgs)
    
    headers = ["频道名称", "频道编号"]
    print(yate.start_response())
  
    print(yate.include_header("频道运营"))

    print(yate.start_form("op_channels_generate.py"))
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    theader = ['运营商']
    print(yate.tb_header(theader))
    print(yate.start_row())
    print('<input type="radio" checked="checked" name="which_sp" value="'+(sp_id)+'"/>"'+response[0][0]+'"')
    print(yate.end_row())
    print(yate.end_table())
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.tb_header(headers))
    for array in result:
        if chidDic.get(array[0],None)==None:
            print(yate.do_operationtable(array))
        else:
            print(yate.checked_operationtable(array))
    print(yate.end_table())
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())    
    obj.Close()
    nobj.Close()
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:47,代码来源:printChannels.py

示例7: channels_publish

def channels_publish():
    cmdmsg = ("""SELECT tvs_channel.chid, tvs_channel.chname
    FROM tvs_channel
    NATURAL JOIN ulv_genaddress
    WHERE tvs_channel.`status` <> 1 AND tvs_channel.chid = ulv_genaddress.channel_id
    order by tvs_channel.chid""")
    
    conn = my_sql.connect()
    cur = conn.cursor()
    cur.execute(cmdmsg)
    result = cur.fetchall()
    
    msg = ("""select sort_id,sort_name from ulv_sort""")
    cur.execute(msg)
    sortinfo = cur.fetchall()
    conn.close()

    print(yate.start_response())
    print(yate.include_header("上线频道"))
    print("<p ><b>通过下面的复选框选择要上线的频道</b></p>")    
    print(yate.start_form("ft_channels_publish.py"))
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.start_row())
    print("<center>")   
    print(yate.select("channel_id"))
    print(yate.select_option(result))
    print(yate.end_select())  
    print('</center>')
    print(yate.end_row())
    
    print(yate.start_row())
    print("<center>")
    print(yate.select("sort_id"))
    print(yate.select_option(sortinfo))
    print(yate.end_select()) 
    print('</center>')
    print(yate.end_row())    
    
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:42,代码来源:printChannels.py

示例8: do_web_process

def do_web_process():
    #test functions for yate.py
    print(yate.start_response())
    print(yate.start_response("text/plain"))
    print(yate.start_response("application/json"))
    print(yate.include_header("Test title for my web application in python test"))
    print(yate.include_footer({'Home':'/index.html', 'Select':'/cgi-bin/select.py'}))
    print(yate.start_form("/cgi-bin/process-athlete.py"))
    #print(urllib.request.urlopen('http://192.168.0.1/test.py', urllib.parse.urlencode({'a':'c'})))
    print(urllib.parse.urlencode({'a':'c'}))
    
    the_files = ['testdata/sarah2.txt', 'testdata/james2.txt', 'testdata/mikey2.txt']
    data = put_to_store(the_files)
    for each_data in data:
        print(data[each_data].name+' '+data[each_data].dob)
    data_copy = get_from_store()
    for each_data in data_copy:
        print(data_copy[each_data].name+' '+data_copy[each_data].dob)
    #start simple http server for test
    simple_http_server_test()
    pass
开发者ID:jeffchao98,项目名称:py_test,代码行数:21,代码来源:webprocess.py

示例9: channels_collect

def channels_collect():
    start_response()    
    obj = deal_mysql()
    msg = ("""SELECT chid,chname from tvs_channel where status=0""")         
    result = obj.askdata(msg)
    #info = result.pop(0)  
    headers = ["频道信息"]   
    print(yate.include_header("新频道收录"))       
    print(yate.start_form("ft_channels_collectDone.py"))
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.tb_header(headers))       
    print(yate.start_row())   
    print(yate.select('which_chid'))               
    print(yate.select_option(result))
    print(yate.end_select())    
    print('<input type="text" name="which_addr" />')
    print(yate.end_row())      
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())
    obj.Close()  
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:22,代码来源:printChannels.py

示例10: print_operationboundary

def print_operationboundary():
    obj = deal_mysql('uspset.ini')
    msg = '''select id,name from u_sp;'''
    response = obj.askdata(msg)
    headers = ["运营商"]
    print(yate.start_response())
    print(yate.include_header("运营发布"))     
   
    print("<p ><b>点击下面的运营商名称可选择要发布的频道</b></p>")            
    print(yate.start_table(tb_width="50%", tb_border="1px solid"))
    print(yate.tb_header(headers))     
    print(yate.start_div('channel_div'))
    print(yate.start_form("op_channels_select.py"))
    for element in response:
        print('<tr><td>')        
        print(yate.radio_button("which_sp",element)) 
        print('</tr></td>')        
    print(yate.start_row())
    print(yate.end_form("确定"))
    print(yate.end_row())
    print(yate.end_table())
    print(yate.end_div())          
    obj.Close()
开发者ID:yangmeitaozi,项目名称:tvcloud,代码行数:23,代码来源:printChannels.py

示例11: print

#! /usr/local/bin/python3

import glob

import athletemodel
import yate

data_files = glob.glob("data/*.txt")
athletes = athletemodel.put_to_store(data_files)

print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("cgi-bin/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("which_athlete", athletes[each_athlete].name))
print(yate.end_form("Select"))
print(yate.include_footer({"Home": "/index.html"}))
开发者ID:easypythonlife,项目名称:HeadFirstPython,代码行数:18,代码来源:generate_list.py

示例12: print

__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"}))
开发者ID:micheng-ZJU,项目名称:python,代码行数:21,代码来源:generate_list.py

示例13: print

#! /usr/local/bin/python3

import athletelist_model  #loaded model file
import yate  #html help file
import glob   #to list the data files

data_files=glob.glob("data/*.txt")
athletes=athletelist_model.put_to_store(data_files)

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

for each_athlete in athletes:
    print(yate.radio_button("which_athlete",athletes[each_athlete].name))

print(yate.end_form("Select")) 
print(yate.include_footer({"Home": "/index.html"}))  #argument is dictiornary list
开发者ID:VidhyaApple,项目名称:study_python,代码行数:19,代码来源:athletelist_generate_list.py

示例14: print

import glob
import model
import yate

data_files = glob.glob("../data/*.txt")
img_dic = model.writeList(data_files)


print (img_dic)


print (yate.start_response())
print (yate.include_header("haha"))
print (yate.start_form("by my CGI"))
print (yate.para("from my data list"))
for item in img_dic:
    print(yate.radio_button("which_img",img_dic[item] ))
print(yate.end_form("Selec"))
print(yate.include_footer({"HOME": "/index.html"}))

开发者ID:4406arthur,项目名称:python-practice,代码行数:19,代码来源:generate.py

示例15: print

print(yate.include_header("Aprori Page for " + str(term_ascii)))


#### get expanded word from SQL or on the air if data in not in sql, render them and pass through input method to controller 3  

if sql_webModel.checkIfdataIsStore(term_ascii.decode("utf-8"),FILE_SQLITE): 
	logger.info('get the expanded query from SQLite')
	lexpandedQueries_SQL =  sql_webModel.get_expannedQueryFromStore(term_ascii.decode('utf-8'),FILE_SQLITE)
	
	#print ("<h1>" +  str(lexpandedQueries_SQL) + "<h1>")
	lexpandedQueries_SQL_ascii = [s.encode("utf-8") for s in lexpandedQueries_SQL] 
	### render expanded word results #### 
	print('<h2>' + "these are the expanded queries from eHownet" +'</h2>')
	print ('</br>')
	print(yate.u_list(lexpandedQueries_SQL_ascii))
	print(yate.start_form(NEXT_URL, form_type="POST"))
	for each_query in lexpandedQueries_SQL:
		print(yate.hidden_input('expanded_terms_array', each_query.encode("utf-8")))
	print(yate.end_form())
	print ('</br>')
	print(yate.include_footer({"Cancel, go back to Google": "/index.html"}))
	#print(yate.include_menu1({"cancel, go back to Google": "/index.html"}, str(term_ascii) ))

else: ## not processed before, do expannedQuery on the air 
	logger.info('get the expanded query from eHownet DB')
	print('<h1>' + 'get the expanded query from eHownet DB' +'</h1>')
	print('<h2>' + 'sorry, your term is not supported in ehowent cache!' +'</h2>')
	logger.info('get the expanded query from eHownet DB')
	'''
	#lexpandedQueries_ehownet = ehownet.get_allExpannedQueryFromStore(term_ascii_ascii.decode('utf-8'))
	##TODO: do expannedQuery on the air
开发者ID:amumu,项目名称:Approri-query-expansion-system,代码行数:31,代码来源:controller2.py


注:本文中的yate.start_form函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。