def genaddress_publish():
    # channel_list
    allchannel = {}
    allcatagory = {}

    conn = my_sql.connect()
    cur = conn.cursor()

    cur.execute(
        """select live_url.chid,live_url.live_urlid,tvs_channel.chname from tvs_channel,
    live_url where tvs_channel.status=0 and live_url.status=0 and live_url.chid=tvs_channel.chid order by tvs_channel.chid"""
    )
    dic = cur.fetchall()
    apd = ""
    for each in dic:
        apd = " ".join([str(each[0]), str(each[1])])
        allchannel[apd] = each[2].encode("utf-8")
        apd = ""
        # print allchannel

        # select catagory id
        cur.execute("""select sort_id,sort_name from live_sort """)
        catagorydic = cur.fetchall()
        conn.close()

    for each in catagorydic:
        allcatagory[each[0]] = each[1].encode("utf-8")

    print(yate.start_response())
    print(yate.render_publish(urls="edit.py"))
    # print(yate.start_form("edit.py"))

    print(yate.select("mix"))
    print(yate.select_list_new(allchannel))
    print(yate.end_select())

    print(yate.select("sortid"))
    print(yate.select_list_new(allcatagory))
    print(yate.end_select())

    """
    print(yate.select('logo'))
    print(yate.select_list_n(alllogoname))
    print(yate.end_select())
    """
    # print(yate.end_form("add"))
    print(yate.submit())
Example #2
0
    allserver[eachs[0]] = eachs[1] 

cur.execute("""select live_url.live_urlid,live_url.live_path,tvs_channel.chname from 
live_url,tvs_channel where live_url.chid = tvs_channel.chid and (live_url.status is null or live_url.status=1)""")
res = cur.fetchall()
conn.close()
for eachi in res:
    allstor_path[eachi[0]] = eachi[1]

 
#print(yate.start_response())
print(yate.render_addrpublish(urls="addrpublish.py"))
#print(yate.start_form("addrpublish.py"))    

print(yate.select_addr('cid'))
print(yate.select_list_new(allchannel))
print(yate.end_select())

print(yate.select('serverip'))
print(yate.select_list_n(allserver))
print(yate.end_select())

#print(yate.select('storagepath'))
#print(yate.select_list_new(allstor_path))
#print(yate.end_select())
print(' <td align="center" class="td_bg" width="25%" height="15" id="obj"><input type=text name="storagepath" id="txtHint"></td>')


"""
print(yate.select('logo'))
print(yate.select_list_n(alllogoname))
Example #3
0
# select catagory id
cur.execute("""select sort_id,sort_name from live_sort """)
catagorydic = cur.fetchall()
conn.close()

for each in catagorydic:
    allcatagory[each[0]] = each[1].encode("utf-8")

print(yate.start_response())
print(yate.render_publish(urls="edit.py"))
# print(yate.start_form("edit.py"))


print(yate.select("mix"))
print(yate.select_list_new(allchannel))
print(yate.end_select())

print(yate.select("sortid"))
print(yate.select_list_new(allcatagory))
print(yate.end_select())


"""
print(yate.select('logo'))
print(yate.select_list_n(alllogoname))
print(yate.end_select())
"""
# print(yate.end_form("add"))
print(yate.submit())