From 880a6ea7447978a2973422ac7abad6d99d7c1f56 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 14 Sep 2009 22:27:50 -0700 Subject: fixed bool converter in forms to work with non bool options --- gr-wxgui/src/python/forms/converters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gr-wxgui') diff --git a/gr-wxgui/src/python/forms/converters.py b/gr-wxgui/src/python/forms/converters.py index 3cc13466a..db14d2752 100644 --- a/gr-wxgui/src/python/forms/converters.py +++ b/gr-wxgui/src/python/forms/converters.py @@ -72,12 +72,14 @@ class bool_converter(abstract_converter): self._true = true self._false = false def external_to_internal(self, v): - return bool(v) + if v == self._true: return True + if v == self._false: return False + raise Exception, 'Value "%s" is not a possible option.'%v def internal_to_external(self, v): if v: return self._true else: return self._false def help(self): - return "Value must be cast-able to type bool." + return "Value must be in (%s, %s)."%(self._true, self._false) class eval_converter(abstract_converter): """ -- cgit