]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Cleanup and remove dumb comments. segmented-elos
authorAnt Zucaro <azucaro@gmail.com>
Sun, 30 Apr 2017 13:12:08 +0000 (09:12 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 30 Apr 2017 13:12:08 +0000 (09:12 -0400)
xonstat/views/main.py

index af6ae9bb30207917949203ba0663c62036abf733..0c21f5a0e6b51e4b3e9022fa97f721c9b23c6780 100644 (file)
@@ -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):