From: Oleg Romanyshyn Date: Fri, 22 Apr 2005 15:44:12 +0000 (+0000) Subject: Added new status - "in-progress" X-Git-Tag: 1.0.0~301^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4c567ef59a85ce345ce76268aafc4a5ff9c66e62;p=be.git Added new status - "in-progress" --- diff --git a/be b/be index 6341729..b7ca726 100755 --- a/be +++ b/be @@ -11,6 +11,7 @@ import becommands.set_root import becommands.new import becommands.close import becommands.open +import becommands.inprogress __doc__ = """Bugs Everywhere - Distributed bug tracking Supported becommands diff --git a/becommands/inprogress.py b/becommands/inprogress.py new file mode 100644 index 0000000..968551e --- /dev/null +++ b/becommands/inprogress.py @@ -0,0 +1,19 @@ +"""Close a bug""" +from libbe import cmdutil +def execute(args): + """ + >>> from libbe import tests + >>> import os + >>> dir = tests.simple_bug_dir() + >>> os.chdir(dir.dir) + >>> dir.get_bug("a").status + 'open' + >>> execute(("a",)) + >>> dir.get_bug("a").status + 'in-progress' + >>> tests.clean_up() + """ + assert(len(args) == 1) + bug = cmdutil.get_bug(args[0]) + bug.status = "in-progress" + bug.save() diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 16c1544..7c02ff3 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -148,7 +148,7 @@ for i in range(len(severity_levels)): severity_value[severity_levels[i]] = i class Bug(object): - status = checked_property("status", (None, "open", "closed")) + status = checked_property("status", (None, "open", "closed", "in-progress")) severity = checked_property("severity", (None, "wishlist", "minor", "serious", "critical", "fatal")) @@ -176,7 +176,7 @@ class Bug(object): return os.path.join(self.path, self.uuid, file) def _get_active(self): - return self.status == "open" + return self.status in ("open", "in-progress") active = property(_get_active)