예제 #1
0
def add_project(course, row):
    date = make_aware(parse_date(row[2]))
    date = date_str(date)
    page = '%s/project/%s' % (course, row[0])
    instructions = '/unc/%s/project/%s' % (course, row[0])
    title = row[6] if row[6:] else 'None'
    return create_project(course, row[0], title, page, date, instructions)
예제 #2
0
def export_lessons(course):
    with open(lessons_csv(course), 'w') as f:
        for x in Lesson.list(course):
            text = ','.join([
                course,
                str(x.lesson), x.topic,
                str(x.week),
                date_str(x.date), x.reading
            ])
            f.write("%s\n" % text)
예제 #3
0
def task_history(insight):
    return 'Documents/info/history/%s' % date_str(insight.date).replace(
        '-', '/')
예제 #4
0
def print_projects():
    for course in ['bacs200', 'bacs350']:
        print("\n%s" % c)
        for p in Project.list(course):
            print("    [%d] %s - due %s - %s" %
                  (p.pk, p.title, date_str(p.due), p.page))
예제 #5
0
def export_projects(course):
    with open(project_csv(course), 'w') as f:
        for project in Project.list(course):
            f.write("%s,%s,%s,%s,%s\n" % (course, project.num, project.title,
                                          project.page, date_str(project.due)))
예제 #6
0
 def assigned(a):
     return dict(title="Reading - %s" % a.reading,
                 due=date_str(a.date),
                 state='Not Completed')
예제 #7
0
 def assigned(a):
     link = '<a href="/unc/%s/project/%02d">Project #%s</a>' % (
         a.project.course.name, a.project.num, a.project.title)
     return dict(title=link, due=date_str(a.due), state=a.state)
예제 #8
0
def export_skills(course):
    with open(skills_csv(course), 'w') as f:
        for x in Skill.list(course):
            text = ','.join([course, str(x.num), x.topic, date_str(x.due), x.images])
            f.write("%s\n" % text)