def index(room): pytz.timezone("Europe/Madrid") naive = dt.datetime.now().replace(minute=50) # Next session returns a generator, we're only interested in N talks, # so we use itertools.islice to get those n talks. room_talks = islice(talks.next_session(room, dt.datetime(2015, 7, 21, 9, 30)), 3) other_rooms = [r for r in cf.room_names if r != room] other_talks = [] for r in other_rooms: other_talks = chain(talks.next_session(r, dt.datetime(2015, 7, 21, 9, 30)), other_talks) return render_template('index.html', timestamp=naive, next_talk=next(room_talks), talks=room_talks, track=other_talks)
def index(): my_track = ["Google Room"] pytz.timezone("Europe/Madrid") naive = dt.datetime.now().replace(minute=50) gtalks = talks.next_session("Google Room", dt.datetime(2015, 7, 21, 9, 30), 3) other_talks = [] actual = dict() for r in cf.room_names: if r not in my_track: t = talks.next_session(r, dt.datetime(2015, 7, 21, 9, 30), 1) if t != None: actual["track_title"] = r actual["time"] = t["start_time"] actual["talk"] = t["title"] actual["speaker"] = t["speaker"] other_talks.append(actual) print(dt.datetime.now().replace(minute=0)) return render_template("index.html", timestamp=naive, next_talk=gtalks[0], talks=gtalks[1:3], track=other_talks)
def index(room): pytz.timezone("Europe/Madrid") naive = dt.datetime.now().replace(minute=50) # Next session returns a generator, we're only interested in N talks, # so we use itertools.islice to get those n talks. room_talks = islice( talks.next_session(room, dt.datetime(2015, 7, 21, 9, 30)), 3) other_rooms = [r for r in cf.room_names if r != room] other_talks = [] for r in other_rooms: other_talks = chain( talks.next_session(r, dt.datetime(2015, 7, 21, 9, 30)), other_talks) return render_template('index.html', timestamp=naive, next_talk=next(room_talks), talks=room_talks, track=other_talks)