aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-24 20:55:24 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-24 20:55:24 -0500
commitcb18ea54f783ed37a39fc12561329b398830d656 (patch)
treebf8366f0b899e847872937dc243b80d001d23a69 /becommands
parent2c3f6c066ceb03ae3579dff029bf01f0b62c1f82 (diff)
downloadbugseverywhere-cb18ea54f783ed37a39fc12561329b398830d656.tar.gz
Added invalid-value checking to becommands/set.py.
Kindof a cludgy check, but there's currently no simpler way to find valid entries for a given setting name (that I can think of).
Diffstat (limited to 'becommands')
-rw-r--r--becommands/set.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/becommands/set.py b/becommands/set.py
index 287ceb4..0085f0f 100644
--- a/becommands/set.py
+++ b/becommands/set.py
@@ -46,7 +46,17 @@ def execute(args):
print bd.settings.get(args[0])
else:
if args[1] != "none":
+ old_setting = bd.settings[args[0]]
bd.settings[args[0]] = args[1]
+
+ # attempt to get the new value
+ bd.save()
+ try:
+ bd.load()
+ except bugdir.InvalidValue, e:
+ bd.settings[args[0]] = old_setting
+ bd.save()
+ raise cmdutil.UserError(e)
else:
del bd.settings[args[0]]
bd.save()