import MySQLdb import feedutils import sql if __name__ == '__main__': print 'Content-Type: text/plain\r' print '\r' sys.stdout.flush() cursor = feedutils.GetCursor() showusers = ['mikalstill'] form = cgi.FieldStorage() if form.has_key('reviewers'): showusers = feedutils.ResolveGroupMembers(cursor, form['reviewers'].value) # Fetch the last seven days of results to start off with initial_size = 30 one_day = datetime.timedelta(days=1) last_timestamp = datetime.datetime(1970, 1, 1) feedutils.SendGroups(cursor) feedutils.SendReviewers(cursor, '__total__', initial_size) feedutils.SendPacket({'type': 'users-present', 'payload': showusers}) for username in showusers: day = datetime.datetime.now() day = datetime.datetime(day.year, day.month, day.day) day -= one_day * (initial_size - 1) timestamp = sql.FormatSqlValue('timestamp', day)
import feedutils import sql if __name__ == '__main__': print 'Content-Type: text/plain\r' print '\r' sys.stdout.flush() cursor = feedutils.GetCursor() form = cgi.FieldStorage() initial_size = 30 if form.has_key('reviewers'): showusers = feedutils.ResolveGroupMembers(cursor, form['reviewers'].value, 'bugprogresssummary', initial_size) else: showusers = ['mikalstill'] if form.has_key('project'): project = form['project'].value else: project = '__total__' last_time = feedutils.GetInitial('bugprogress', showusers, project, initial_size) feedutils.GetUpdates('bugprogress', showusers, project, last_time)