From: Aaron Bentley Date: Fri, 18 Mar 2005 14:02:01 +0000 (+0000) Subject: Organized list by who the bugs are assigned to X-Git-Tag: 1.0.0~343 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=90e118fac5cfb345e10487039a375c8af5835ddf;p=be.git Organized list by who the bugs are assigned to --- diff --git a/.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values b/.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values index 365ed26..4602e29 100644 --- a/.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values +++ b/.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values @@ -15,7 +15,7 @@ severity=minor -status=open +status=closed diff --git a/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values new file mode 100644 index 0000000..9485ae7 --- /dev/null +++ b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values @@ -0,0 +1,35 @@ + + + +assigned=abentley + + + + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Per-tree configuration: default-assigneed? + + + diff --git a/.be/bugs/9daa72ee-0721-4f68-99ee-f06fec0b340e/values b/.be/bugs/9daa72ee-0721-4f68-99ee-f06fec0b340e/values new file mode 100644 index 0000000..b2c2b0a --- /dev/null +++ b/.be/bugs/9daa72ee-0721-4f68-99ee-f06fec0b340e/values @@ -0,0 +1,35 @@ + + + +assigned=abentley + + + + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Organize list by whether it's assigned to the current target + + + diff --git a/becommands/list.py b/becommands/list.py index d4b9142..e89195b 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -1,5 +1,5 @@ """List bugs""" -from libbe import bugdir, cmdutil +from libbe import bugdir, cmdutil, names import os def execute(args): active = True @@ -15,5 +15,25 @@ def execute(args): bugs = [b for b in all_bugs if filter(b) ] if len(bugs) == 0: print "No matching bugs found" + current_id = names.creator() + + my_bugs = [] + other_bugs = [] + unassigned_bugs = [] for bug in bugs: - print cmdutil.bug_summary(bug, all_bugs) + if bug.assigned == current_id: + my_bugs.append(bug) + elif bug.assigned is None: + unassigned_bugs.append(bug) + else: + other_bugs.append(bug) + + def list_bugs(cur_bugs, title): + if len(cur_bugs) > 0: + print cmdutil.underlined(title) + for bug in cur_bugs: + print cmdutil.bug_summary(bug, all_bugs) + + list_bugs(my_bugs, "Bugs assigned to you") + list_bugs(unassigned_bugs, "Unassigned bugs") + list_bugs(other_bugs, "Bugs assigned to others") diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index 78b7571..ab0e8be 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -81,6 +81,15 @@ def execute(cmd, args): def help(cmd, args): return get_command(cmd).help() +def underlined(instring): + """Produces a version of a string that is underlined with '=' + + >>> underlined("Underlined String") + 'Underlined String\\n=================' + """ + + return "%s\n%s" % (instring, "="*len(instring)) + def _test(): import doctest import sys