diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-24 18:29:16 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-24 18:29:16 -0500 |
commit | a711ecf10df62e30d83c1941065404c53fecd35b (patch) | |
tree | 4111ef606fa52dc7f21ca3eb357ff83fae74fe1e /becommands/target.py | |
parent | c5d7551e6a6e98bb6da7c7d11360224edfda2f14 (diff) | |
parent | 2c3f6c066ceb03ae3579dff029bf01f0b62c1f82 (diff) | |
download | bugseverywhere-a711ecf10df62e30d83c1941065404c53fecd35b.tar.gz |
Merge from W. Trevor King's tree.
Diffstat (limited to 'becommands/target.py')
-rw-r--r-- | becommands/target.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/becommands/target.py b/becommands/target.py index 4b015b4..dce100f 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -15,16 +15,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Show or change a bug's target for fixing""" -from libbe import bugdir -from libbe import cmdutil +from libbe import cmdutil, bugdir __desc__ = __doc__ def execute(args): """ - >>> from libbe import tests >>> import os - >>> dir = tests.simple_bug_dir() - >>> os.chdir(dir.dir) + >>> bd = bugdir.simple_bug_dir() + >>> os.chdir(bd.root) >>> execute(["a"]) No target assigned. >>> execute(["a", "tomorrow"]) @@ -33,14 +31,14 @@ def execute(args): >>> execute(["a", "none"]) >>> execute(["a"]) No target assigned. - >>> tests.clean_up() """ options, args = get_parser().parse_args(args) assert(len(args) in (0, 1, 2)) if len(args) == 0: print help() return - bug = cmdutil.get_bug(args[0]) + bd = bugdir.BugDir(from_disk=True) + bug = bd.bug_from_shortname(args[0]) if len(args) == 1: if bug.target is None: print "No target assigned." @@ -51,16 +49,16 @@ def execute(args): bug.target = None else: bug.target = args[1] - bug.save() + bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be target bug-id [target]") + parser = cmdutil.CmdOptionParser("be target BUG-ID [TARGET]") return parser longhelp=""" Show or change a bug's target for fixing. -If no target is specified, the current value is printed. If a target +If no target is specified, the current value is printed. If a target is specified, it will be assigned to the bug. Targets are freeform; any text may be specified. They will generally be |