示例#1
0
文件: suivi.py 项目: yuooo/followork
def followork():
    welcome()
    s = sys.stdin.readline().strip()
    if s.startswith("-l"):
        for f in os.listdir("currentGoals/"):
            if f.endswith(".txt"):
                print (os.path.splitext(f)[0])
        print
        print "Which project would you like to choose?"
        s = sys.stdin.readline().strip()
    goal = Goal(s)
    actions()
    s1 = ""
    while s1 != "quit":
        s1 = sys.stdin.readline().strip()
        if s1 == "add":
            v = int(input())
            goal.add(v)
            print "Value added"
            print
        elif s1 == "addo":
            d, v = sys.stdin.readline().split()
            goal.add_otherDay(d, int(v))
            print "Value added"
            print
        elif s1 == "show":
            goal.statistics()
            goal.plot()
        elif s1 == "firstDay":
            d = sys.stdin.readline().strip()
            goal.set_firsday(d)
            print "Date set."
            print