コード例 #1
0
ファイル: app.py プロジェクト: MattyO/trackerCharts
def login():
    if request.method == "GET":
        return render_template("login.html")

    username = request.form["username"]
    user_token = tracker.get_auth_token(request.form["username"], request.form["password"])

    project_list = ProjectList(tracker.getProjects(user_token))
    project_ids = list_ids(project_list)
    localdata.cache_data(username, project_ids)

    session["user_id"] = username

    return redirect(url_for("overview"))
コード例 #2
0
ファイル: update.py プロジェクト: MattyO/trackerCharts
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)