def sprint_timeline(bugs, sprint):
 timeline = []
 history = get_history(bugs, sprint)
 for (when, bug, who, removed, added) in history:
  reason = 'NO COMMENT'
  for comment in bug.get('comments', []):
   if ((comment['time'] == when) and (comment['creator'] == who)):
    reason = comment['text']
    break
  timeline.append((when, bug['id'], who, removed, added, reason))
 timeline.sort(key=(lambda item: item[0]))
 for mem in timeline:
  print ('%s: %s: %s' % (mem[0], mem[1], mem[2]))
  print ('    %s -> %s' % ((mem[3] if mem[3] else 'unassigned'), mem[4]))
  print wrap(mem[5])
  print ''

def sprint_timeline ( bugs , sprint ) : timeline = [ ] history = get_history ( bugs , sprint ) for ( when , bug , who , removed , added ) in history : reason = 'NO COMMENT' for comment in bug . get ( 'comments' , [ ] ) : if ( ( comment [ 'time' ] == when ) and ( comment [ 'creator' ] == who ) ) : reason = comment [ 'text' ] break timeline . append ( ( when , bug [ 'id' ] , who , removed , added , reason ) ) timeline . sort ( key = ( lambda item : item [ 0 ] ) ) for mem in timeline : print ( '%s: %s: %s' % ( mem [ 0 ] , mem [ 1 ] , mem [ 2 ] ) ) print ( '    %s -> %s' % ( ( mem [ 3 ] if mem [ 3 ] else 'unassigned' ) , mem [ 4 ] ) ) print wrap ( mem [ 5 ] ) print ''
print timeline block .