Skip to content

Commit 904fa32

Browse files
committed
FIX: rating tracker
1 parent 197eccb commit 904fa32

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ratingTracker.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def update():
4444
else:
4545
str += ';' + users[idx]
4646

47-
re = requests.get('http://codeforces.com/api/user.info?handles=' + str)
48-
for idx in range(len(users)):
49-
rating = re.json()['result'][idx]['rating']
50-
maxRating = re.json()['result'][idx]['maxRating']
51-
tree.item(children[idx], values = (users[idx], rating, maxRating), tags = (rankCol(rating)))
47+
re = requests.get('http://codeforces.com/api/user.info?handles=' + str)
48+
for idx in range(len(users)):
49+
rating = re.json()['result'][idx]['rating']
50+
maxRating = re.json()['result'][idx]['maxRating']
51+
tree.item(children[idx], values = (users[idx], rating, maxRating), tags = (rankCol(rating)))
5252

5353
for color in rk_colors:
5454
tree.tag_configure(color, foreground=color)
@@ -72,4 +72,6 @@ def update():
7272
btn_upd = ttk.Button(win, text = "update", command = update)
7373
tree.pack()
7474
btn_upd.pack()
75+
update()
76+
7577
win.mainloop()

0 commit comments

Comments
 (0)