Beispiel #1
0
def get_view_days(path):
    fs = FolderSorter(path)
    days = fs.get_sorted_list()
    view_days = []
    total = 0
    total_ready = 0
    for day in days:
        view_day = {'total':0}
        view_day['total_ready'] = 0
        view_day['boards'] = []
        for board in day:
            bh = BoardHandler(path + os.sep + board)
            b = {}
            b['image'] = bh.get_preview()
            b['path'] = path + os.sep + board
            view_day['boards'].append(b)
            dur =  bh.get_duration()
            view_day['total'] += dur
            total += dur
            if bh.is_ready(): 
                view_day['total_ready'] += dur
                total_ready += dur
        view_days.append(view_day)

    return view_days, total, total_ready