🎨 - Syntax improvement and compliance with the PEP 8 convention

This commit is contained in:
Florian SYLVAIN
2021-02-08 15:49:31 +01:00
parent ac7377a169
commit fe392e3ca9
2 changed files with 47 additions and 40 deletions
+7 -6
View File
@@ -1,12 +1,13 @@
from riotwatcher import LolWatcher
from private import token_riot
from private import TOKEN_RIOT
watcher = LolWatcher(token_riot)
region = 'EUW1'
WATCHER = LolWatcher(TOKEN_RIOT)
REGION = 'EUW1'
def rank_track(player):
ranked_stats = watcher.league.by_summoner(region, player['id'])
'''function that communicate with Riot API'''
ranked_stats = WATCHER.league.by_summoner(REGION, player['id'])
if not ranked_stats:
return 'Unranked cette saison.'
@@ -17,4 +18,4 @@ def rank_track(player):
elif infos['queueType'] == 'RANKED_FLEX_SR':
what_rank = 'Flexible'
liste.append([what_rank, infos['tier'], infos['rank'], infos['leaguePoints'], infos['wins'], infos['losses']])
return liste
return liste