summaryrefslogtreecommitdiff
path: root/gr-wxgui/src/python/forms/converters.py
diff options
context:
space:
mode:
authorJosh Blum2009-09-14 22:27:50 -0700
committerJosh Blum2009-09-14 22:27:50 -0700
commit880a6ea7447978a2973422ac7abad6d99d7c1f56 (patch)
treee1d32c1bf584dc743821092f1b680cd233afba3c /gr-wxgui/src/python/forms/converters.py
parentae3c009666f2bba0e10e054b0747d8f82a29515f (diff)
downloadgnuradio-880a6ea7447978a2973422ac7abad6d99d7c1f56.tar.gz
gnuradio-880a6ea7447978a2973422ac7abad6d99d7c1f56.tar.bz2
gnuradio-880a6ea7447978a2973422ac7abad6d99d7c1f56.zip
fixed bool converter in forms to work with non bool options
Diffstat (limited to 'gr-wxgui/src/python/forms/converters.py')
-rw-r--r--gr-wxgui/src/python/forms/converters.py6
1 files changed, 4 insertions, 2 deletions
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):
"""