diff options
author | Aaron Bentley <aaron.bentley@utoronto.ca> | 2005-03-19 07:53:03 +0000 |
---|---|---|
committer | Aaron Bentley <aaron.bentley@utoronto.ca> | 2005-03-19 07:53:03 +0000 |
commit | da5664e08b87e5ff479bd79e72ba9685f9cd7a4d (patch) | |
tree | 179d505d40ad5e1feb28cfe8336e360e17bcd85e /becommands | |
parent | 92826d47239312d7ed3cbc6638be44c6e84ca8a3 (diff) | |
download | bugseverywhere-da5664e08b87e5ff479bd79e72ba9685f9cd7a4d.tar.gz |
Implemented current target setting
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/list.py | 24 | ||||
-rw-r--r-- | becommands/set.py | 31 |
2 files changed, 51 insertions, 4 deletions
diff --git a/becommands/list.py b/becommands/list.py index 0b27a25..d92ebac 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -4,6 +4,7 @@ import os 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: @@ -11,16 +12,31 @@ def execute(args): 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: @@ -35,6 +51,12 @@ def execute(args): 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") diff --git a/becommands/set.py b/becommands/set.py index 956a95e..547e4a9 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -1,11 +1,36 @@ """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". +""" |