コード例 #1
0
def initChampDatabase():
    d = {}
    r=requests.get(form_urls.getRequestURL(form_urls.allChampsSuffix()),auth=('user', 'pass'))
    allChampsJ=json.loads(r.text)
    for i in range(0, len(allChampsJ["champions"])):
        d[allChampsJ["champions"][i]["id"]]=[]
    return (d)
コード例 #2
0
def testCache():
    for i in range (0,10):
        now = time.ctime(int(time.time()))
        r=requests.get(form_urls.getRequestURL(form_urls.allChampsSuffix()),auth=('user', 'pass'))
        #j=json.loads(r.text)
        print ("Time: {0} / Used Cache: {1}".format(now, r.from_cache))