aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-18 14:02:01 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-18 14:02:01 +0000
commit90e118fac5cfb345e10487039a375c8af5835ddf (patch)
tree8df25957b04e1a4dda7f81bbed2301c53bafb8b7
parente0f027bc4d96afda56dcbf2ce3998a5bc9d88ff9 (diff)
downloadbugseverywhere-90e118fac5cfb345e10487039a375c8af5835ddf.tar.gz
Organized list by who the bugs are assigned to
-rw-r--r--.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values2
-rw-r--r--.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values35
-rw-r--r--.be/bugs/9daa72ee-0721-4f68-99ee-f06fec0b340e/values35
-rw-r--r--becommands/list.py24
-rw-r--r--libbe/cmdutil.py9
5 files changed, 102 insertions, 3 deletions
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