aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/status.py
diff options
context:
space:
mode:
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