Beispiel #1
0
def makeBarsForAllGraph(todos):
    openTodos = parser.groupByProj(parser.filter(todos, doneOn=None))
    closedTodos = parser.groupByProj([todo for todo in todos if todo.doneOn])
    bars = {}
    for k in openTodos.keys():
	bars[k] = [len(openTodos[k]), len(closedTodos.get(k, []))]
    for k in closedTodos.keys():
	if not k in openTodos:
	    bars[k] = [0, len(closedTodos[k])]	
    bars = list(bars.iteritems())
    bars.sort(lambda x, y:sum(x[1]).__cmp__(sum(y[1])))
    bars.reverse()
    return bars[:10]
Beispiel #2
0
def makeOpenProjGraph(writer, todos):
    openTodos = parser.groupByProj(parser.filter(todos, doneOn=None))
    openSegments = {}
    for k, v in openTodos.iteritems():
	openSegments[k] = [len(v),]
    openSegments = list(openSegments.iteritems())
    openSegments.sort()
    writeStylesheetPI(writer)
    writer(ET.tostring(segmentedBarGraph(openSegments,
                                         width=calcBarGraphWidth(len(openTodos)))))
Beispiel #3
0
def calcOpenProjWidth(todos):
    return calcBarGraphWidth(len(parser.groupByProj(parser.filter(todos, doneOn=None))))