Stubbed out code for killgraphs

This commit is contained in:
Gregory Shikhman 2009-07-03 22:06:04 +00:00
parent 0f9486daa4
commit 489c3a7e39
4 changed files with 61 additions and 2 deletions

View 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()

View File

@ -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 = ""

View File

@ -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)

View 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>