mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +00:00
Stubbed out code for killgraphs
This commit is contained in:
parent
0f9486daa4
commit
489c3a7e39
36
website/stats.wesnoth.org/wesstats/controllers/killview.py
Normal file
36
website/stats.wesnoth.org/wesstats/controllers/killview.py
Normal file
@ -0,0 +1,36 @@
|
||||
# $Id$
|
||||
"""
|
||||
Copyright (C) 2009 by Gregory Shikhman <cornmander@cornmander.com>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
"""
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import MySQLdb
|
||||
import logging
|
||||
|
||||
import configuration
|
||||
import evaluators
|
||||
import helperlib
|
||||
|
||||
from tg import expose
|
||||
from wesstats.lib.base import BaseController
|
||||
|
||||
__all__ = ['KillGraphController']
|
||||
|
||||
log = logging.getLogger("wesstats")
|
||||
|
||||
class KillGraphController(BaseController):
|
||||
def __init__(self,url):
|
||||
self.url = url
|
||||
|
||||
@expose(template="wesstats.templates.killview")
|
||||
def default(self,**kw):
|
||||
return dict()
|
@ -117,8 +117,8 @@ class LineGraphController(BaseController):
|
||||
log.debug("SQL query:")
|
||||
log.debug(query)
|
||||
results = helperlib.scaled_query(curs,query,100,evaluators.simple_eval)
|
||||
log.debug("query result:")
|
||||
log.debug(results)
|
||||
#log.debug("query result:")
|
||||
#log.debug(results)
|
||||
data = LineGraphController.reformat_data(self,results)
|
||||
#generate JS datafields here because genshi templating can't emit JS...
|
||||
js_celldata = ""
|
||||
|
@ -26,6 +26,7 @@ from wesstats.controllers.error import ErrorController
|
||||
from wesstats.controllers.pieview import PieGraphController
|
||||
from wesstats.controllers.barview import BarGraphController
|
||||
from wesstats.controllers.lineview import LineGraphController
|
||||
from wesstats.controllers.killview import KillGraphController
|
||||
|
||||
__all__ = ['RootController']
|
||||
|
||||
@ -88,6 +89,8 @@ class RootController(BaseController):
|
||||
view = PieGraphController(url)
|
||||
elif type == "line":
|
||||
view = LineGraphController(url)
|
||||
elif type == "kill":
|
||||
view = KillGraphController(url)
|
||||
else:
|
||||
view = NotFoundController(url)
|
||||
|
||||
|
20
website/stats.wesnoth.org/wesstats/templates/killview.html
Normal file
20
website/stats.wesnoth.org/wesstats/templates/killview.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- $Id$ -->
|
||||
<!--
|
||||
Copyright (C) 2009 by Gregory Shikhman <cornmander@cornmander.com>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns:py="http://genshi.edgewall.org/" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user