From 7729c7f383817599fa3fe75f01addd8afb49a984 Mon Sep 17 00:00:00 2001 From: Robert Lehmann Date: Fri, 26 Nov 2010 09:48:43 +0100 Subject: [PATCH] Add `mine' sorting criteria showing bugs assigned to yourself first. --- libbe/bug.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libbe/bug.py b/libbe/bug.py index 5361e4a..d0914b4 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -799,6 +799,12 @@ cmp_extra_strings = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "extra_strings" # chronological rankings (newer < older) cmp_time = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "time", invert=True) +def cmp_mine(bug_1, bug_2): + user_id = libbe.ui.util.user.get_user_id(bug_1.storage) + mine_1 = bug_1.assigned != user_id + mine_2 = bug_2.assigned != user_id + return cmp(mine_1, mine_2) + def cmp_comments(bug_1, bug_2): """ Compare two bugs' comments lists. Doesn't load any new comments, -- 2.26.2