From 9757391815e2574e0ab90ac51496c325ce6df7dc Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Wed, 18 Mar 2015 06:43:02 -0400 Subject: [PATCH] Remove the server_game_index view. This view was replaced by the game_finder view. During that time I removed the other views that implemented this functionality, but I must have missed this one! It still had an active route mapping, although no other route used it. --- xonstat/__init__.py | 6 ------ xonstat/views/server.py | 37 ------------------------------------- 2 files changed, 43 deletions(-) diff --git a/xonstat/__init__.py b/xonstat/__init__.py index 0dfe363..55cce5b 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -133,12 +133,6 @@ def main(global_config, **settings): config.add_route("server_index_json", "/servers.json") 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_json", "/server/{server_id:\d+}/games.json") - 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") diff --git a/xonstat/views/server.py b/xonstat/views/server.py index e685f96..6270ed0 100644 --- a/xonstat/views/server.py +++ b/xonstat/views/server.py @@ -144,40 +144,3 @@ def server_info_json(request): List the stored information about a given server. JSON. """ return [{'status':'not implemented'}] - - -def _server_game_index_data(request): - server_id = request.matchdict['server_id'] - current_page = request.matchdict['page'] - - try: - server = DBSession.query(Server).filter_by(server_id=server_id).one() - - games_q = DBSession.query(Game, Server, Map).\ - filter(Game.server_id == server_id).\ - filter(Game.server_id == Server.server_id).\ - filter(Game.map_id == Map.map_id).\ - order_by(Game.game_id.desc()) - - games = Page(games_q, current_page, url=page_url) - except Exception as e: - server = None - games = None - raise e - - return {'games':games, - 'server':server} - - -def server_game_index(request): - """ - List the games played on a given server. Paginated. - """ - return _server_game_index_data(request) - - -def server_game_index_json(request): - """ - List the games played on a given server. Paginated. JSON. - """ - return [{'status':'not implemented'}] -- 2.39.2