diff options
author | W. Trevor King <wking@drexel.edu> | 2009-06-25 09:10:04 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-06-25 09:10:04 -0400 |
commit | ea62dd57fa0ea41a164c02129cb0e70a3298bc9f (patch) | |
tree | 2b1ce8fe4300564cda6909f882111332b56a7add /becommands/tag.py | |
parent | d61b9a76a1ffc9daec72456aa4549bf3e3093f29 (diff) | |
download | bugseverywhere-ea62dd57fa0ea41a164c02129cb0e70a3298bc9f.tar.gz |
Added `be depend'.
This closes bug 7ec2c071-9630-42b0-b08a-9854616f9144. BE is now bug
free ;). At least until the next commit :p.
Writing depend.py turned up a few style points in tag.py which I also
fixed.
Diffstat (limited to 'becommands/tag.py')
-rw-r--r-- | becommands/tag.py | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/becommands/tag.py b/becommands/tag.py index 8697464..2394284 100644 --- a/becommands/tag.py +++ b/becommands/tag.py @@ -27,14 +27,14 @@ def execute(args, test=False): >>> print a.extra_strings [] >>> execute(["a", "GUI"], test=True) - Tagging bug a: + Tags for a: GUI >>> bd._clear_bugs() # resync our copy of bug >>> a = bd.bug_from_shortname("a") >>> print a.extra_strings ['TAG:GUI'] >>> execute(["a", "later"], test=True) - Tagging bug a: + Tags for a: GUI later >>> execute(["a"], test=True) @@ -45,7 +45,7 @@ def execute(args, test=False): GUI later >>> execute(["a", "Alphabetically first"], test=True) - Tagging bug a: + Tags for a: Alphabetically first GUI later @@ -58,16 +58,14 @@ def execute(args, test=False): [] >>> a.save() >>> execute(["a"], test=True) - Tags for a: >>> bd._clear_bugs() # resync our copy of bug >>> a = bd.bug_from_shortname("a") >>> print a.extra_strings [] >>> execute(["a", "Alphabetically first"], test=True) - Tagging bug a: + Tags for a: Alphabetically first >>> execute(["--remove", "a", "Alphabetically first"], test=True) - Tags for a: """ parser = get_parser() options, args = parser.parse_args(args) @@ -94,32 +92,25 @@ def execute(args, test=False): print '\n'.join(tags) return bug = bd.bug_from_shortname(args[0]) - - new_tag = None if len(args) == 2: given_tag = args[1] - tags = bug.extra_strings + estrs = bug.extra_strings tag_string = "TAG:%s" % given_tag if options.remove == True: - tags.remove(tag_string) + estrs.remove(tag_string) else: # add the tag - new_tag = given_tag - tags.append(tag_string) - bug.extra_strings = tags # reassign to notice change - - bug.save() + estrs.append(tag_string) + bug.extra_strings = estrs # reassign to notice change + bug.save() tags = [] for estr in bug.extra_strings: if estr.startswith("TAG:"): tags.append(estr[4:]) - if new_tag == None: + if len(tags) > 0: print "Tags for %s:" % bug.uuid - else: - print "Tagging bug %s:" % bug.uuid - for tag in tags: - print tag + print '\n'.join(tags) def get_parser(): parser = cmdutil.CmdOptionParser("be tag BUG-ID [TAG]\nor: be tag --list") @@ -132,6 +123,9 @@ def get_parser(): longhelp=""" If TAG is given, add TAG to BUG-ID. If it is not specified, just print the tags for BUG-ID. + +To search for bugs with a particular tag, try + $ be list --extra-strings TAG:<your-tag> """ def help(): |