aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/severity.py
diff options
context:
space:
mode:
Diffstat (limited to 'becommands/severity.py')
-rw-r--r--becommands/severity.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/becommands/severity.py b/becommands/severity.py
index 7b7ee29..92f31e8 100644
--- a/becommands/severity.py
+++ b/becommands/severity.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 severity level"""
-from libbe import cmdutil, bugdir
-from libbe.bug import severity_values, severity_description
+from libbe import cmdutil, bugdir, bug
__desc__ = __doc__
def execute(args, test=False):
@@ -56,7 +55,8 @@ def get_parser():
parser = cmdutil.CmdOptionParser("be severity BUG-ID [SEVERITY]")
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,13 +64,14 @@ is specified, it will be assigned to the bug.
Severity levels are:
"""]
-longest_severity_len = max([len(s) for s in severity_values])
-for severity in severity_values :
- description = severity_description[severity]
- s = "%*s : %s\n" % (longest_severity_len, severity, description)
- longhelp.append(s)
-longhelp = ''.join(longhelp)
-
-
-def help():
+ try:
+ bd = bugdir.BugDir(from_disk=True, manipulate_encodings=False)
+ except bugdir.NoBugDir, e:
+ pass
+ longest_severity_len = max([len(s) for s in bug.severity_values])
+ for severity in bug.severity_values :
+ description = bug.severity_description[severity]
+ s = "%*s : %s\n" % (longest_severity_len, severity, description)
+ longhelp.append(s)
+ longhelp = ''.join(longhelp)
return get_parser().help_str() + longhelp