]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Dummy json views
authornyov <nyov@nexnode.net>
Tue, 5 Jun 2012 18:22:36 +0000 (20:22 +0200)
committernyov <nyov@nexnode.net>
Tue, 5 Jun 2012 18:22:36 +0000 (20:22 +0200)
xonstat/views/game.py
xonstat/views/main.py
xonstat/views/map.py
xonstat/views/player.py
xonstat/views/search.py
xonstat/views/server.py

index 70bbd58c862325959f10761ac359fea1a76e95f2..6147c5fed1d44d9b4bac3b16c4e9124e1503dbcb 100644 (file)
@@ -31,7 +31,7 @@ def _game_index_data(request):
                 order_by(PlayerGameStat.rank).\
                 order_by(PlayerGameStat.score).all()
 
-    return {'games':games, 
+    return {'games':games,
             'pgstats':pgstats}
 
 
@@ -44,6 +44,15 @@ def game_index(request):
     return _game_index_data(request)
 
 
+def game_index_json(request):
+    """
+    Provides a list of current games, with the associated game stats.
+    These games are ordered by game_id, with the most current ones first.
+    Paginated. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _game_info_data(request):
     game_id = request.matchdict['id']
     try:
@@ -103,6 +112,13 @@ def game_info(request):
     return _game_info_data(request)
 
 
+def game_info_json(request):
+    """
+    List the game stats (scoreboard) for a particular game. Paginated. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _rank_index_data(request):
     if request.params.has_key('page'):
         current_page = request.params['page']
@@ -131,3 +147,10 @@ def rank_index(request):
     Provide a list of gametype ranks, paginated.
     """
     return _rank_index_data(request)
+
+
+def rank_index_json(request):
+    """
+    Provide a list of gametype ranks, paginated. JSON.
+    """
+    return [{'status':'not implemented'}]
index 5a8bad4be70aead377dbf2d384af734b831fb4e1..05496e93913e6669fc4f5b4493da576669628dbc 100644 (file)
@@ -133,3 +133,10 @@ def main_index(request):
         mainindex_data['recent_games'].append(('-', '-', '-', '-'))
 
     return mainindex_data
+
+
+def main_index_json(request):
+    """
+    JSON output of the main page information.
+    """
+    return [{'status':'not implemented'}]
index df641222c1680a3e265984efaa76a100021acfcc..a74a220644f6b7b39c1a4b50722b531e7536b835 100644 (file)
@@ -30,7 +30,7 @@ def _map_index_data(request):
 
 def map_index(request):
     """
-    Provides a list of all the current maps. 
+    Provides a list of all the current maps.
     """
     return _map_index_data(request)
 
@@ -39,7 +39,7 @@ def map_index_json(request):
     """
     Provides a JSON-serialized list of all the current maps. 
     """
-    view_data =  _map_index_data(request)
+    view_data = _map_index_data(request)
 
     maps = [m.to_dict() for m in view_data['maps']]
 
@@ -146,3 +146,10 @@ def map_info(request):
         mapinfo_data['top_servers'].append(('-', '-', '-'))
 
     return mapinfo_data
+
+
+def map_info_json(request):
+    """
+    List the information stored about a given map. JSON.
+    """
+    return [{'status':'not implemented'}]
index 02e3cd3360a9b5437f29c470e0f03d615ae0b2c5..c130dbc57a30872f3d198b396a18b05e5a7b1698 100644 (file)
@@ -45,6 +45,13 @@ def player_index(request):
     return _player_index_data(request)
 
 
+def player_index_json(request):
+    """
+    Provides a list of all the current players. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _get_games_played(player_id):
     """
     Provides a breakdown by gametype of the games played by player_id.
@@ -224,6 +231,13 @@ def player_info(request):
     return _player_info_data(request)
 
 
+def player_info_json(request):
+    """
+    Provides detailed information on a specific player. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _player_game_index_data(request):
     player_id = request.matchdict['player_id']
 
@@ -267,6 +281,15 @@ def player_game_index(request):
     return _player_game_index_data(request)
 
 
+def player_game_index_json(request):
+    """
+    Provides an index of the games in which a particular
+    player was involved. This is ordered by game_id, with
+    the most recent game_ids first. Paginated. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _player_accuracy_data(request):
     player_id = request.matchdict['id']
     allowed_weapons = ['nex', 'rifle', 'shotgun', 'uzi', 'minstanex']
@@ -304,6 +327,13 @@ def _player_accuracy_data(request):
             }
 
 
+def player_accuracy(request):
+    """
+    Provides the accuracy for the given weapon. (JSON only)
+    """
+    return _player_accuracy_data(request)
+
+
 def player_accuracy_json(request):
     """
     Provides a JSON response representing the accuracy for the given weapon.
index 2a791f331004b81131e302ab7b704a5a626ac03f..13700b6ebfe95cb59218a00b50eb2585573a9327 100644 (file)
@@ -149,3 +149,7 @@ def _search_data(request):
 
 def search(request):
     return _search_data(request)
+
+
+def search_json(request):
+    return [{'status':'not implemented'}]
index 93e5fecc49b3300756c8b84a848a0f3c2b69166d..b2d7c6df442b7cbdd7fb5b3c0294b00c38dc9aa3 100644 (file)
@@ -37,6 +37,13 @@ def server_index(request):
     return _server_index_data(request)
 
 
+def server_index_json(request):
+    """
+    Provides a list of all the current servers. JSON.
+    """
+    return [{'status':'not implemented'}]
+
+
 def _server_info_data(request):
     server_id = request.matchdict['id']
 
@@ -142,6 +149,13 @@ def server_info(request):
     return serverinfo_data
 
 
+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']
@@ -170,3 +184,10 @@ 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'}]