def execute(args):
active = True
severity = ("minor", "serious", "critical", "fatal")
+ tree = cmdutil.bug_tree()
def filter(bug):
if active is not None:
if bug.active != active:
if bug.severity not in severity:
return False
return True
- all_bugs = list(cmdutil.bug_tree().list())
+ all_bugs = list(tree.list())
bugs = [b for b in all_bugs if filter(b) ]
if len(bugs) == 0:
print "No matching bugs found"
current_id = names.creator()
+ my_target_bugs = []
+ other_target_bugs = []
+ unassigned_target_bugs = []
my_bugs = []
other_bugs = []
unassigned_bugs = []
for bug in bugs:
+ if tree.target is not None and bug.target != tree.target:
+ continue
+ if bug.assigned == current_id:
+ my_target_bugs.append(bug)
+ elif bug.assigned is None:
+ unassigned_target_bugs.append(bug)
+ else:
+ other_target_bugs.append(bug)
+
+ for bug in bugs:
+ if tree.target is not None and bug.target == tree.target:
+ continue
if bug.assigned == current_id:
my_bugs.append(bug)
elif bug.assigned is None:
for bug in cur_bugs:
print cmdutil.bug_summary(bug, all_bugs)
+ list_bugs(my_target_bugs,
+ "Bugs assigned to you for target %s" % tree.target)
+ list_bugs(unassigned_target_bugs,
+ "Unassigned bugs for target %s" % tree.target)
+ list_bugs(other_target_bugs,
+ "Bugs assigned to others for target %s" % tree.target)
list_bugs(my_bugs, "Bugs assigned to you")
list_bugs(unassigned_bugs, "Unassigned bugs")
list_bugs(other_bugs, "Bugs assigned to others")
"""Change tree settings"""
from libbe import cmdutil
def execute(args):
- assert len(args) in (1, 2)
+ assert len(args) in (0, 1, 2)
tree = cmdutil.bug_tree()
- if len(args) == 1:
+ if len(args) == 0:
+ keys = tree.settings.keys()
+ keys.sort()
+ for key in keys:
+ print "%16s: %s" % (key, tree.settings[key])
+ elif len(args) == 1:
print tree.settings.get(args[0])
else:
- tree.settings[args[0]] = args[1]
+ if args[1] != "none":
+ tree.settings[args[0]] = args[1]
+ else:
+ del tree.settings[args[0]]
tree.save_settings()
+def help():
+ return """be set [name] [value]
+
+Show or change per-tree settings.
+
+If name and value are supplied, the name is set to a new value.
+If no value is specified, the current value is printed.
+If no arguments are provided, all names and values are listed.
+
+Interesting settings are:
+rcs_name
+ The name of the revision control system. "Arch" and "None" are supported.
+target
+ The current development goal
+
+To unset a setting, set it to "none".
+"""