def project(project_id): current_user = flask_helper.safe_session("user_id") project_list = _get_filtered_projects() project_found = find_project(project_list, str(project_id)) if project_found == None: return redirect(url_for("overview")) project_id = str(project_id) burndown = Burndown(project_id, localdata.getBurndownStates(project_id)) labels = burndown_labels(burndown) possible_states = config.states("tracker") return render_template("project.html", project=project_found, labels=labels, states=possible_states)
import sys, os from os.path import abspath, dirname, join sys.path.append(abspath(join(dirname(__file__),'libs'))) #change current working director so the data is found and place in the correct directory. os.chdir(abspath(join(dirname(__file__)))) from api import tracker from api import localdata from classes.project import Project, ProjectList, Burndown, addState, burndown_tojson, projectlist_tojson, find_project from classes.story import Story, StoryList from classes.user import User, UserList, userlist_tojson import config localdata.saveProjectsXML(tracker.getProjects()) project_list = ProjectList(localdata.getProjectsXML()) for project in project_list: test_stories = tracker.getStories(project.id) localdata.saveStoriesXML(test_stories, str(project.id)) for project in project_list: burndown = Burndown(project.id, localdata.getBurndownStates(project.id)) test_stories = StoryList([localdata.getStoriesXML(project.id)]) burndown = addState(burndown, test_stories) localdata.saveBurndownStates(burndown.states, project.id)
def labels(project_id): project_id = str(project_id) burndown = Burndown(project_id, localdata.getBurndownStates(project_id)) labels = burndown_labels(burndown) return labels_tojson(labels)
def project_json(project_id): project_id = str(project_id) return burndown_tojson(Burndown(project_id, localdata.getBurndownStates(project_id)))