

def makeLines(self, diff, lines_to_add, comment_lists):
    lines = []
    for (old, new) in lines_to_add:
        context = self.makeContext(diff, old[0], new[0])
        lines.append(SideDiffLine(self.app, context, old, new, callback=self.onSelect))
        key = ('old-%s-%s' % (old[0], diff.oldname))
        old_list = comment_lists.pop(key, [])
        key = ('new-%s-%s' % (new[0], diff.newname))
        new_list = comment_lists.pop(key, [])
        while (old_list or new_list):
            old_comment_key = new_comment_key = None
            old_comment = new_comment = ''
            if old_list:
                (old_comment_key, old_comment) = old_list.pop(0)
            if new_list:
                (new_comment_key, new_comment) = new_list.pop(0)
            lines.append(SideDiffComment(context, old_comment, new_comment))
        key = ('olddraft-%s-%s' % (old[0], diff.oldname))
        old_list = comment_lists.pop(key, [])
        key = ('newdraft-%s-%s' % (new[0], diff.newname))
        new_list = comment_lists.pop(key, [])
        while (old_list or new_list):
            old_comment_key = new_comment_key = None
            old_comment = new_comment = ''
            if old_list:
                (old_comment_key, old_comment) = old_list.pop(0)
            if new_list:
                (new_comment_key, new_comment) = new_list.pop(0)
            lines.append(SideDiffCommentEdit(self.app, context, old_comment_key, new_comment_key, old_comment, new_comment))
    return lines

dataset/ETHPy150Open openstack/gertty/gertty/view/side_diff.py SideDiffView.makeLines/original