def queue_update(): json_queue = QueueManager.get_json_queue() logging.info("sending notifications") subs = memcache.get(SUBSCRIBERS_KEY) msg = json.dumps({'type': 'queue', 'data': json_queue, 'active_tas': LabTA.update_active_tas()}) for s in subs: channel.send_message(s, msg)
def queue_update(): json_queue = QueueManager.get_json_queue() logging.info("sending notifications") subs = memcache.get(SUBSCRIBERS_KEY) msg = json.dumps({ 'type': 'queue', 'data': json_queue, 'active_tas': LabTA.update_active_tas() }) for s in subs: channel.send_message(s, msg)
def get(self): user = users.get_current_user() json_queue = QueueManager.get_json_queue() token = channel.create_channel(user.email()) if is_ta(user.email()): logging.info("{} is a TA".format(user.email())) template_values = {'logout_url': users.create_logout_url('/'), 'schedule_url': "http://labta.cs.princeton.edu", 'is_ta': is_ta(user.email()), 'curr_user': user.email(), 'token': token, 'queue': base64.b64encode(json_queue), 'active_tas': LabTA.update_active_tas()} template = JINJA_ENVIRONMENT.get_template('templates/HelpQueue.html') self.response.write(template.render(template_values))
def get(self): user = users.get_current_user() json_queue = QueueManager.get_json_queue() token = channel.create_channel(user.email()) if is_ta(user.email()): logging.info("{} is a TA".format(user.email())) template_values = { 'logout_url': users.create_logout_url('/'), 'schedule_url': "http://labta.cs.princeton.edu/schedule.html", 'is_ta': is_ta(user.email()), 'curr_user': user.email(), 'token': token, 'queue': base64.b64encode(json_queue), 'active_tas': LabTA.update_active_tas() } template = JINJA_ENVIRONMENT.get_template('templates/HelpQueue.html') self.response.write(template.render(template_values))