~jkakar/kanban/fix-header-links

« back to all changes in this revision

Viewing changes to kanban/launchpad.py

  • Committer: Jamu Kakar
  • Date: 2011-02-06 22:35:56 UTC
  • mfrom: (16.1.2 warning-signals)
  • Revision ID: jkakar@kakar.ca-20110206223556-d2p08upuigfoncwd
Merged warning-signals [f=713032]

Warning and danger icons are shown on bugs that have been in progress
or in the review queue for too long.  The warning icon is shown when a
bug has been in progress for more than three days or in the review
queue for more than one day.  The danger icon is shown when a bug has
been in progress for more than seven days or in the review queue for
more than three days.  Bugs related to the -o flag, that slipped in
with the last merge, have also been fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
    """Create a L{Bug} from a C{bug_task} instance loaded from Launchpad."""
188
188
    launchpad_bug = bug_task.bug
189
189
    assignee = bug_task.assignee
 
190
    in_progress_date = bug_task.date_in_progress
 
191
 
190
192
    if assignee is not None:
191
193
        assignee = assignee.name
192
194
    branch_url = None
193
195
    merge_proposal_url = None
194
196
    merge_proposal_status = None
 
197
    merge_proposal_creation_date = None
195
198
    for branch in launchpad_bug.linked_branches:
196
199
        launchpad_branch = branch.branch
197
200
        branch_url = launchpad_branch.bzr_identity
198
201
        for merge_proposal in launchpad_branch.landing_targets:
 
202
            merge_proposal_creation_date = merge_proposal.date_created
199
203
            merge_proposal_status = merge_proposal.queue_status
200
 
            merge_proposal_url = (
201
 
                "https://code.launchpad.net/~"
202
 
                + str(merge_proposal.self).split("~")[-1])
 
204
            merge_proposal_url = ("https://code.launchpad.net/~"
 
205
                                  + str(merge_proposal.self).split("~")[-1])
203
206
            break
204
207
        break
205
208
    return Bug(launchpad_bug.id, bug_task.bug_target_name, bug_task.importance,
206
 
               bug_task.status, launchpad_bug.title, assignee, branch_url,
207
 
               merge_proposal_url, merge_proposal_status, launchpad_bug.tags)
 
209
               bug_task.status, launchpad_bug.title, assignee,
 
210
               in_progress_date, branch_url, merge_proposal_url,
 
211
               merge_proposal_status, merge_proposal_creation_date,
 
212
               launchpad_bug.tags)