1 # Copyright (C) 2005 Aaron Bentley and Panometrics, Inc.
2 # <abentley@panoramicfeedback.com>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 """Show or change a bug's severity level"""
18 from libbe import bugdir
19 from libbe import cmdutil
24 >>> from libbe import tests
26 >>> dir = tests.simple_bug_dir()
30 >>> execute(["a", "wishlist"])
33 >>> execute(["a", "none"])
34 Traceback (most recent call last):
35 UserError: Invalid severity level: none
38 options, args = get_parser().parse_args(args)
39 assert(len(args) in (0, 1, 2))
43 bug = cmdutil.get_bug(args[0])
48 bug.severity = args[1]
49 except bugdir.InvalidValue, e:
50 if e.name != "severity":
52 raise cmdutil.UserError ("Invalid severity level: %s" % e.value)
56 parser = cmdutil.CmdOptionParser("be severity bug-id [severity]")
60 Show or change a bug's severity level.
62 If no severity is specified, the current value is printed. If a severity level
63 is specified, it will be assigned to the bug.
66 wishlist: A feature that could improve usefulness, but not a bug.
67 minor: The standard bug level.
68 serious: A bug that requires workarounds.
69 critical: A bug that prevents some features from working at all.
70 fatal: A bug that makes the package unusable.
74 return get_parser().help_str() + longhelp