aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/status.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-12-04 11:32:57 -0500
committerW. Trevor King <wking@drexel.edu>2008-12-04 11:32:57 -0500
commitb5b8d7214b24338ba5c97287810a4a67e61c3c06 (patch)
tree132ba457d113eaaf03111523429dda82aabd863c /becommands/status.py
parent1449bf7d1a42d187c30ed72074b2c45b5131d6bc (diff)
downloadbugseverywhere-b5b8d7214b24338ba5c97287810a4a67e61c3c06.tar.gz
Per-tree status levels working.
Diffstat (limited to 'becommands/status.py')
-rw-r--r--becommands/status.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/becommands/status.py b/becommands/status.py
index 5ff824e..b781a2a 100644
--- a/becommands/status.py
+++ b/becommands/status.py
@@ -15,8 +15,7 @@
# 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, bugdir
-from libbe.bug import status_values, status_description
+from libbe import cmdutil, bugdir, bug
__desc__ = __doc__
def execute(args, test=False):
@@ -56,7 +55,9 @@ def get_parser():
parser = cmdutil.CmdOptionParser("be status BUG-ID [STATUS]")
return parser
-longhelp=["""
+
+def help():
+ longhelp=["""
Show or change a bug's severity level.
If no severity is specified, the current value is printed. If a severity level
@@ -64,12 +65,14 @@ is specified, it will be assigned to the bug.
Severity levels are:
"""]
-longest_status_len = max([len(s) for s in status_values])
-for status in status_values :
- description = status_description[status]
- s = "%*s : %s\n" % (longest_status_len, status, description)
- longhelp.append(s)
-longhelp = ''.join(longhelp)
-
-def help():
+ try: # See if there are any per-tree status configurations
+ bd = bugdir.BugDir(from_disk=True, manipulate_encodings=False)
+ except bugdir.NoBugDir, e:
+ pass # No tree, just show the defaults
+ longest_status_len = max([len(s) for s in bug.status_values])
+ for status in bug.status_values :
+ description = bug.status_description[status]
+ s = "%*s : %s\n" % (longest_status_len, status, description)
+ longhelp.append(s)
+ longhelp = ''.join(longhelp)
return get_parser().help_str() + longhelp