Organized list by who the bugs are assigned to
authorAaron Bentley <abentley@panoramicfeedback.com>
Fri, 18 Mar 2005 14:02:01 +0000 (14:02 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Fri, 18 Mar 2005 14:02:01 +0000 (14:02 +0000)
.be/bugs/0ca2d112-b5bb-4df1-8ac0-e46db6cdd442/values
.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values [new file with mode: 0644]
.be/bugs/9daa72ee-0721-4f68-99ee-f06fec0b340e/values [new file with mode: 0644]
becommands/list.py
libbe/cmdutil.py

index 365ed26dd120c67059b9508849192891225c338b..4602e290186fe0dc58eb10e2af11062048160cb8 100644 (file)
@@ -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 (file)
index 0000000..9485ae7
--- /dev/null
@@ -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 (file)
index 0000000..b2c2b0a
--- /dev/null
@@ -0,0 +1,35 @@
+
+
+
+assigned=abentley
+
+
+
+
+
+
+creator=abentley
+
+
+
+
+
+
+severity=minor
+
+
+
+
+
+
+status=open
+
+
+
+
+
+
+summary=Organize list by whether it's assigned to the current target
+
+
+
index d4b9142658175e519e845497dffee3b37d20ea83..e89195b606f020abde61191ce58ca4eb2f23bf08 100644 (file)
@@ -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")
index 78b75719d3ecb9a7dba24da9166643fbd95683b1..ab0e8bee91bbca3369d822c56ff1a20cd4d6f65a 100644 (file)
@@ -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