def get_live(request, uid="1000", uname="guest"): # html = get_template('live.html') token = request.GET.get("token", "token") token = urllib2.quote(token.encode("utf8")) # result_list = findLiveRoom() page_result = {"userid": uid, "username": uname, "token": token, "domain": live_domain} page_result["live_level1"] = handlers.findLiveRoom("ky", uid) page_result["live_level5"] = handlers.findLiveRoom("lx", uid) page_result["live_level6"] = handlers.findLiveRoom("qt", uid) page_result["live_level4"] = handlers.findLiveRoom("jy", uid) page_result["today_live"] = handlers.findTodayLive() # live_name = result_list[0]['courseName'] return render_to_response("live.html", page_result)
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ import datetime from bizs import handlers from time import time import json t1 = datetime.datetime.now() list_r = handlers.findLiveRoom("jy",10423) for item in list_r: print item list_r = handlers.findLiveRoom("ky",10423) for item in list_r: print item list_r = handlers.findLiveRoom("lx",10423) for item in list_r: print item['adminUser']['avatar'] list_r = handlers.findLiveRoom("qt",10423) for item in list_r: print item t2 = datetime.datetime.now() print (t2-t1).microseconds/1000 t = time() page_result = {}