]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Rename damage data to weaponstats.
authorAnt Zucaro <azucaro@gmail.com>
Thu, 5 Sep 2013 16:01:31 +0000 (12:01 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Thu, 5 Sep 2013 16:01:31 +0000 (12:01 -0400)
xonstat/__init__.py
xonstat/views/__init__.py
xonstat/views/player.py

index 5b4e0929b8ff397c5b0412e400b85a0ffd28394f..e055f62e03bb6c1939bb0a29793627d3bf78114c 100644 (file)
@@ -84,8 +84,8 @@ def main(global_config, **settings):
     config.add_route("nvd3_damage", "/player/{id:\d+}/nvd3-damage")
     config.add_view(player_nvd3_damage, route_name="nvd3_damage", renderer="nvd3_damage.mako")
 
-    config.add_route("player_damage_data_v2", "/player/{id:\d+}/damage-v2")
-    config.add_view(player_damage_data_v2, route_name="player_damage_data_v2", renderer="jsonp")
+    config.add_route("player_weaponstats_data_json", "/player/{id:\d+}/weaponstats.json")
+    config.add_view(player_weaponstats_data_json, route_name="player_weaponstats_data_json", renderer="jsonp")
 
     # GAME ROUTES
     config.add_route("game_info",      "/game/{id:\d+}")
index 3c87296d9721b1afdf84201320329a621cf4fdfb..38f5275b5638b5664e3cdff4908924e7db549e68 100644 (file)
@@ -7,7 +7,7 @@ from xonstat.views.player import player_damage_json
 from xonstat.views.player import player_elo_info_text, player_elo_info_json
 from xonstat.views.player import player_hashkey_info_text, player_hashkey_info_json
 from xonstat.views.player import player_captimes, player_captimes_json
-from xonstat.views.player import player_nvd3_damage, player_damage_data_v2
+from xonstat.views.player import player_nvd3_damage, player_weaponstats_data_json
 
 from xonstat.views.game   import game_info, rank_index
 from xonstat.views.game   import game_info_json, rank_index_json
index ce43fdf6252f93b680abfc8272bad41ef4eb296a..46ccc79c9b143d6a8de681908488cd6b23d1fbeb 100644 (file)
@@ -1060,7 +1060,7 @@ def player_nvd3_damage(request):
         "limit": limit,
     }
 
-def player_damage_data_v2(request):
+def player_weaponstats_data_json(request):
     player_id = request.matchdict["id"]
     if player_id <= 2:
         player_id = -1;
@@ -1113,13 +1113,9 @@ def player_damage_data_v2(request):
                 game_id=game_id, weapon_cd=weapon_cd))
 
 
-    weapon_stats_raw = sorted(weapon_stats_raw, key=lambda x: x.game_id)
-    games        = sorted(games_to_weapons.keys())
-    weapon_stats = [ws.to_dict() for ws in weapon_stats_raw]
-
-    log.debug(games_to_weapons)
-    log.debug(weapons_used)
-    log.debug(games)
+    weapon_stats_raw = sorted(weapon_stats_raw, key              = lambda x: x.game_id)
+    games            = sorted(games_to_weapons.keys())
+    weapon_stats     = [ws.to_dict() for ws in weapon_stats_raw]
 
     return {
         "weapon_stats": weapon_stats,