Example #1
0
    def GET(self, graph):
	web.header('Content-Type', 'image/svg+xml')
	session =  web.ctx.environ['beaker.session']
        if graph in ['OpenProj', 'AllProj', 'OpenContext']:
            if not multiuser:
                todos = getSingleuserTodos()
            else:
                todos = session['todos']
            getattr(svg, 'make%sGraph' % graph)(web.output, todos)
	elif graph == 'Time':
            if not multiuser:
                openFile, doneFile, reportFile = parser.findTodoFiles()
                report = parser.parseReport(open(reportFile))
            else:
                report = session['report']
	    svg.makeTimeGraph(web.output, report)
	else:
	    print '''<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
Example #2
0
def getSingleuserTodos():
    openFile, doneFile, reportFile = parser.findTodoFiles()
    return parser.makeTodos(open(openFile)) + parser.makeTodos(open(doneFile))