aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/status.py
diff options
context:
space:
mode:
Diffstat (limited to 'becommands/status.py')
-rw-r--r--becommands/status.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/becommands/status.py b/becommands/status.py
index 5559e59..de171f5 100644
--- a/becommands/status.py
+++ b/becommands/status.py
@@ -15,16 +15,15 @@
# 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 status"""
-from libbe import cmdutil
+from libbe import cmdutil, bugdir
from libbe.bug import status_values, status_description
__desc__ = __doc__
def execute(args):
"""
- >>> from libbe import bugdir
>>> import os
- >>> dir = bugdir.simple_bug_dir()
- >>> os.chdir(dir.dir)
+ >>> bd = bugdir.simple_bug_dir()
+ >>> os.chdir(bd.root)
>>> execute(["a"])
open
>>> execute(["a", "closed"])
@@ -35,11 +34,11 @@ def execute(args):
UserError: Invalid status: none
"""
options, args = get_parser().parse_args(args)
- assert(len(args) in (0, 1, 2))
- if len(args) == 0:
+ if len(args) not in (1,2):
print help()
return
- bug = cmdutil.get_bug(args[0])
+ bd = bugdir.BugDir(loadNow=True)
+ bug = bd.bug_from_shortname(args[0])
if len(args) == 1:
print bug.status
elif len(args) == 2:
@@ -49,7 +48,7 @@ def execute(args):
if e.name != "status":
raise
raise cmdutil.UserError ("Invalid status: %s" % e.value)
- bug.save()
+ bd.save()
def get_parser():
parser = cmdutil.CmdOptionParser("be status bug-id [status]")