~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugcomment.py

  • Committer: Stuart Bishop
  • Date: 2011-09-28 12:49:24 UTC
  • mfrom: (9893.10.1 trivial)
  • mto: This revision was merged to the branch mainline in revision 14178.
  • Revision ID: stuart.bishop@canonical.com-20110928124924-m5a22fymqghw6c5i
Merged trivial into distinct-db-users.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
    return comments
86
86
 
87
87
 
88
 
def group_comments_with_activity(comments, activities, batch_size=None,
89
 
                                 offset=None):
 
88
def group_comments_with_activity(comments, activities):
90
89
    """Group comments and activity together for human consumption.
91
90
 
92
91
    Generates a stream of comment instances (with the activity grouped within)
116
115
    # second, when two events are tied the comment index is used to
117
116
    # disambiguate.
118
117
    events = sorted(chain(comments, activity), key=itemgetter(0, 1, 2))
119
 
    if batch_size is not None:
120
 
        # If we're limiting to a given set of results, we work on just
121
 
        # that subset of results from hereon in, which saves on
122
 
        # processing time a bit.
123
 
        if offset is None:
124
 
            offset = 0
125
 
        events = events[offset:offset+batch_size]
126
118
 
127
119
    def gen_event_windows(events):
128
120
        """Generate event windows.