From: Ant Zucaro Date: Thu, 5 Sep 2013 16:01:31 +0000 (-0400) Subject: Rename damage data to weaponstats. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ffcd77bdf4d07456f131fba866bab9f80cfd15e;p=xonotic%2Fxonstat.git Rename damage data to weaponstats. --- diff --git a/xonstat/__init__.py b/xonstat/__init__.py index 5b4e092..e055f62 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -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+}") diff --git a/xonstat/views/__init__.py b/xonstat/views/__init__.py index 3c87296..38f5275 100644 --- a/xonstat/views/__init__.py +++ b/xonstat/views/__init__.py @@ -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 diff --git a/xonstat/views/player.py b/xonstat/views/player.py index ce43fdf..46ccc79 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -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,