]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/__init__.py
Add headers and rearrange so things look clean.
[xonotic/xonstat.git] / xonstat / __init__.py
index 1d2e0750b5001e955e3351857af2ba198a52e93d..f1e3571b8b47413453c03e1586ee9e6c19e22a10 100644 (file)
@@ -1,6 +1,5 @@
 import sqlahelper
 from pyramid_beaker import set_cache_regions_from_settings
-from pyramid.authentication import AuthTktAuthenticationPolicy
 from pyramid.config import Configurator
 from pyramid.httpexceptions import HTTPNotFound
 from pyramid.renderers import JSONP
@@ -28,15 +27,6 @@ def main(global_config, **settings):
     # mako for templating
     config.include('pyramid_mako')
 
-    # Mozilla Persona as the login verifier. It defines default
-    # authentication and authorization policies.
-    config.include('pyramid_persona')
-
-    # override the authn policy to provide a callback
-    secret = settings.get('persona.secret', None)
-    authn_policy = AuthTktAuthenticationPolicy(secret, callback=groupfinder, hashalg='sha512')
-    config.set_authentication_policy(authn_policy)
-
     # for json-encoded responses
     config.add_renderer('jsonp', JSONP(param_name='callback'))
 
@@ -171,6 +161,24 @@ def main(global_config, **settings):
     config.add_view(view=MapIndex, route_name="map_index", attr="json", renderer="json",
                     accept="application/json")
 
+    config.add_route("map_top_scorers", "/map/{id:\d+}/topscorers")
+    config.add_view(view=MapTopScorers, route_name="map_top_scorers", attr="html",
+                    renderer="map_top_scorers.mako", accept="text/html")
+    config.add_view(view=MapTopScorers, route_name="map_top_scorers", attr="json",
+                    renderer="json", accept="application/json")
+
+    config.add_route("map_top_active", "/map/{id:\d+}/topactive")
+    config.add_view(view=MapTopPlayers, route_name="map_top_active", attr="html",
+                    renderer="map_top_active.mako", accept="text/html")
+    config.add_view(view=MapTopPlayers, route_name="map_top_active", attr="json",
+                    renderer="json", accept="application/json")
+
+    config.add_route("map_top_servers", "/map/{id:\d+}/topservers")
+    config.add_view(view=MapTopServers, route_name="map_top_servers", attr="html",
+                    renderer="map_top_servers.mako", accept="text/html")
+    config.add_view(view=MapTopServers, route_name="map_top_servers", attr="json",
+                    renderer="json", accept="application/json")
+
     config.add_route("map_info",      "/map/{id:\d+}")
     config.add_view(map_info,      route_name="map_info",      renderer="map_info.mako")