From: Ant Zucaro Date: Sun, 30 Apr 2017 13:12:08 +0000 (-0400) Subject: Cleanup and remove dumb comments. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fsegmented-elos;p=xonotic%2Fxonstat.git Cleanup and remove dumb comments. --- diff --git a/xonstat/views/main.py b/xonstat/views/main.py index af6ae9b..0c21f5a 100644 --- a/xonstat/views/main.py +++ b/xonstat/views/main.py @@ -172,36 +172,30 @@ def _main_index_data(request): leaderboard_count = 10 recent_games_count = 20 - # summary statistics for the tagline stat_line = get_summary_stats("all") day_stat_line = get_summary_stats("day") ranks = [get_ranks(gt) for gt in RANKED_GAME_TYPES if get_ranks(gt)] - right_now = datetime.utcnow() - back_then = datetime.utcnow() - timedelta(days=leaderboard_lifetime) - - # top players by playing time - top_players = get_top_players_by_time(10) + top_players = get_top_players_by_time(leaderboard_count) - # top servers by number of games - top_servers = get_top_servers_by_games(10) + top_servers = get_top_servers_by_games(leaderboard_count) - # top maps by total times played - top_maps = get_top_maps_by_games(10) + top_maps = get_top_maps_by_games(leaderboard_count) - # recent games played in descending order + back_then = datetime.utcnow() - timedelta(days=leaderboard_lifetime) rgs = recent_games_q(cutoff=back_then).limit(recent_games_count).all() recent_games = [RecentGame(row) for row in rgs] - return {'top_players':top_players, - 'top_servers':top_servers, - 'top_maps':top_maps, - 'recent_games':recent_games, - 'ranks':ranks, - 'stat_line':stat_line, - 'day_stat_line':day_stat_line, - } + return { + 'top_players': top_players, + 'top_servers': top_servers, + 'top_maps': top_maps, + 'recent_games': recent_games, + 'ranks': ranks, + 'stat_line': stat_line, + 'day_stat_line': day_stat_line, + } def main_index(request):