Fix merge conflict, change indentation a bit.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 16 Jun 2012 15:41:48 +0000 (11:41 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 16 Jun 2012 15:41:48 +0000 (11:41 -0400)
1  2 
xonstat/__init__.py
xonstat/views/__init__.py
xonstat/views/player.py

index 3160b7583c2cba36fd2ab88e5b4168ddd952d36d,00a4bec1676ad017305cbdd892acb80bd8960a3a..e7bfba387aeb46b69998a113cf85ded34a0c93a3
@@@ -38,32 -42,45 +42,49 @@@ def main(global_config, **settings)
  
      config.add_route("player_accuracy",      "/player/{id:\d+}/accuracy")
      config.add_route("player_accuracy_json", "/player/{id:\d+}/accuracy.json")
-     config.add_view(player_accuracy_json, route_name="player_accuracy",      renderer="json")
-     config.add_view(player_accuracy_json, route_name="player_accuracy_json", renderer="json")
+     config.add_view(player_accuracy_json, route_name="player_accuracy",      renderer="jsonp")
+     config.add_view(player_accuracy_json, route_name="player_accuracy_json", renderer="jsonp")
+     config.add_route("player_index",      "/players")
+     config.add_route("player_index_json", "/players.json")
+     config.add_view(player_index,      route_name="player_index",      renderer="player_index.mako")
+     config.add_view(player_index_json, route_name="player_index_json", renderer="jsonp")
  
 +    config.add_route("player_damage", "/player/{id:\d+}/damage")
 +    config.add_view(player_damage_json, route_name="player_damage",
 +        renderer="json")
 +
      # GAME ROUTES
-     config.add_route("game_index", "/games")
-     config.add_view(game_index, route_name="game_index", renderer="game_index.mako")
+     config.add_route("game_index",      "/games")
+     config.add_route("game_index_json", "/games.json")
+     config.add_view(game_index,      route_name="game_index",      renderer="game_index.mako")
+     config.add_view(game_index_json, route_name="game_index_json", renderer="jsonp")
  
-     config.add_route("game_info", "/game/{id:\d+}")
-     config.add_view(game_info, route_name="game_info", renderer="game_info.mako")
+     config.add_route("game_info",      "/game/{id:\d+}")
+     config.add_route("game_info_json", "/game/{id:\d+}.json")
+     config.add_view(game_info,      route_name="game_info",      renderer="game_info.mako")
+     config.add_view(game_info_json, route_name="game_info_json", renderer="jsonp")
  
-     config.add_route("rank_index", "/ranks/{game_type_cd:ctf|dm|tdm|duel}")
-     config.add_view(rank_index, route_name="rank_index", renderer="rank_index.mako")
+     config.add_route("rank_index",      "/ranks/{game_type_cd:ctf|dm|tdm|duel}")
+     config.add_route("rank_index_json", "/ranks/{game_type_cd:ctf|dm|tdm|duel}.json")
+     config.add_view(rank_index,      route_name="rank_index",      renderer="rank_index.mako")
+     config.add_view(rank_index_json, route_name="rank_index_json", renderer="jsonp")
  
      # SERVER ROUTES
-     config.add_route("server_index", "/servers")
-     config.add_view(server_index, route_name="server_index", renderer="server_index.mako")
+     config.add_route("server_index",      "/servers")
+     config.add_route("server_index_json", "/servers.json")
+     config.add_view(server_index,      route_name="server_index",      renderer="server_index.mako")
+     config.add_view(server_index_json, route_name="server_index_json", renderer="jsonp")
  
-     config.add_route("server_game_index", "/server/{server_id:\d+}/games/page/{page:\d+}")
-     config.add_view(server_game_index, route_name="server_game_index", renderer="server_game_index.mako")
+     config.add_route("server_game_index",      "/server/{server_id:\d+}/games/page/{page:\d+}")
+     config.add_route("server_game_index_json", "/server/{server_id:\d+}/games.json")
+     config.add_view(server_game_index,      route_name="server_game_index",      renderer="server_game_index.mako")
+     config.add_view(server_game_index_json, route_name="server_game_index_json", renderer="jsonp")
  
-     config.add_route("server_info", "/server/{id:\d+}")
-     config.add_view(server_info, route_name="server_info", renderer="server_info.mako")
+     config.add_route("server_info",      "/server/{id:\d+}")
+     config.add_route("server_info_json", "/server/{id:\d+}.json")
+     config.add_view(server_info,      route_name="server_info",      renderer="server_info.mako")
+     config.add_view(server_info_json, route_name="server_info_json", renderer="jsonp")
  
      # MAP ROUTES
      config.add_route("map_index",      "/maps")
index 525d2f9d353357a1edf22b543962e4aa33866c07,2d50a19699f1e46956c08bafa291fc970959dbfc..f42c7855ec5b245ac92788e67ea27a994d410d18
@@@ -1,8 -1,12 +1,21 @@@
  from xonstat.views.submission import stats_submit
 -from xonstat.views.player import player_index,      player_info,      player_game_index,      player_accuracy
 -from xonstat.views.player import player_index_json, player_info_json, player_game_index_json, player_accuracy_json
 -from xonstat.views.game   import game_index,      game_info,      rank_index
 +from xonstat.views.player import player_index, player_info, player_game_index
- from xonstat.views.player import player_accuracy_json, player_damage_json
- from xonstat.views.game import game_index, game_info, rank_index
- from xonstat.views.map import map_info, map_index, map_index_json
++from xonstat.views.player import player_accuracy
++from xonstat.views.player import player_index_json, player_info_json,
++from xonstat.views.player import player_game_index_json, player_accuracy_json
++from xonstat.views.player import player_damage_json
++
++from xonstat.views.game   import game_index, game_info, rank_index
+ from xonstat.views.game   import game_index_json, game_info_json, rank_index_json
 -from xonstat.views.map    import map_info,      map_index
++
++from xonstat.views.map    import map_info, map_index
+ from xonstat.views.map    import map_info_json, map_index_json
 -from xonstat.views.server import server_info,      server_game_index,      server_index
 -from xonstat.views.server import server_info_json, server_game_index_json, server_index_json
++
 +from xonstat.views.server import server_info, server_game_index, server_index
++from xonstat.views.server import server_info_json, server_game_index_json
++from xonstat.views.server import server_index_json
++
  from xonstat.views.search import search_q, search
- from xonstat.views.main import main_index
+ from xonstat.views.search import search_json
++
+ from xonstat.views.main   import main_index
Simple merge