Exemplo n.º 1
0
def run(proceedings, day="May 11, 2011", time="09:00"):

    instantiate = lambda c: Session(c)
    days = filter_sessions(proceedings.sessions, PROGRAM_SESSION_TYPES, lambda c: instantiate(c))

    for dsessions in days.values():
        for tsessions in dsessions.values():
            print tsessions

    return Sessions({"roomsessions": days[day][time]})
Exemplo n.º 2
0
def run_index_batch(proceedings, filename='index'):
    import sessions.templatetags.course_filters as cf
    import csv
    instantiate = lambda c: Session(c)
    days=filter_sessions(proceedings.sessions, PROGRAM_SESSION_TYPES,  lambda c : instantiate(c))
    for day,dsessions in days.iteritems():
        for time, tsessions in dsessions.iteritems():
            f = open('%s-%s-%s.csv' % (filename, day, time),'w')
            writer = csv.writer(f)
            for sesspair in cf.sort_course_rooms(tsessions):
                print type(sesspair[1]), sesspair[1]
                for sub in sesspair[1].data["submissions"]:
                    for a in sub.authors:
                        print [a.lastName, a.firstName]
                        writer.writerow([a.lastName, a.firstName])
                        pass
            
            f.close()

    # courses next
    days=filter_sessions(proceedings.sessions, COURSE,  lambda c : instantiate(c))
    for day,dsessions in days.iteritems():
        for time, tsessions in dsessions.iteritems():
            f = open('course-%s-%s.csv' % (day, time),'w')
            writer = csv.writer(f)
            for sesspair in cf.sort_course_rooms(tsessions):
                print type(sesspair[1]), sesspair[1]
                for sub in sesspair[1].data["submissions"]:
                    for a in sub.authors:
                        print [a.lastName, a.firstName]
                        writer.writerow([a.lastName, a.firstName])
                        pass
            f.close()

    # posters next ?
            
    
    return f
Exemplo n.º 3
0
def bestpapers(proc):
    instantiate = lambda c: Session(c)
    days=filter_sessions(proc.sessions, PROGRAM_SESSION_TYPES, lambda c : instantiate(c))

    print "yo"
    for day,dsessions in days.iteritems():
        for time,tsessions in dsessions.iteritems():
            for room,session in tsessions.iteritems():
                for sub in session.data["submissions"]:
                    if sub.bestPaperAward:
                        print day, time, room, "   "
                        print "BEST PAPER ", sub.title, repr(sub)
                    if sub.bestPaperNominee:
                        print day, time, room, "   "
                        print "NOMINEE ", sub.title, repr(sub)
                        pass
                pass
            pass
        pass
Exemplo n.º 4
0
def run_index(proceedings, day='May 11, 2011', time='09:00', filename='index'):
    import sessions.templatetags.course_filters as cf
    import csv
    f = open('%s-%s-%s.csv' % (filename, day, time),'w')
    writer = csv.writer(f)
    instantiate = lambda c: Session(c)
    days=filter_sessions(proceedings.sessions, PROGRAM_SESSION_TYPES,  lambda c : instantiate(c))

    for sesspair in cf.sort_course_rooms(days[day][time]):
        print type(sesspair[1]), sesspair[1]
        print sesspair[0], " ---------------> "
        for sub in sesspair[1].data["submissions"]:
            for a in sub.authors:
                print sub.title, " ::::::::::::: "
                print [a.lastName, a.firstName]
                writer.writerow([a.lastName, a.firstName])
                pass
            
    f.close()    
    return f
Exemplo n.º 5
0
def run_index(proceedings, filename="course-index"):
    import sessions.templatetags.course_filters as cf
    import csv, codecs

    f = codecs.open("%s.csv" % filename, "w", encoding="iso_8859_1", errors="ignore")
    writer = csv.writer(f)
    days = filter_sessions(proceedings.sessions, [COURSE], lambda s: Course(s))
    for day, time_courses in days.iteritems():
        for time, slot_courses in cf.sort_course_times(time_courses):
            print time, len(slot_courses)
            for room, course in cf.sort_course_rooms(slot_courses):
                if getattr(course, "submission", None) is not None:
                    for a in course.submission.authors:
                        print [a.lastName, a.firstName]
                        writer.writerow([a.lastName, a.firstName])
                        pass
                pass
            pass
        pass
    f.close()
    return f
Exemplo n.º 6
0
def Filter(proceedings,include_sessions_containing_submissions_of_types=PROGRAM_SESSION_TYPES):
    instantiate = lambda c: Session(c)
    return filter_sessions(proceedings.sessions,
                           include_sessions_containing_submissions_of_types,
                           lambda c : instantiate(c))
Exemplo n.º 7
0
def run(proceedings):
    instantiate = lambda c: Course(c)
    days = filter_sessions(proceedings.sessions, session_type="Course", apply_to_each_session=lambda c: instantiate(c))
    return Courses({"days": days})