def index(self): ids = queues.keys() listenerCount = 0 venterCount = 0 for id in ids: try: queue = queues[id] if queue[0][1].started: listenerCount += 1 if queue[1][1].started: venterCount += 1 except: pass return render('Index.mako', dict(listenerCount=listenerCount, venterCount=venterCount, userCount=(listenerCount + venterCount)))
def chat(self): type = request.params.get('type', None) if type not in (u'listener', u'venter'): return 'Invalid type.' return render('Chat.mako', dict(type=type))