From d9366ba7d4b72f9e277ca7055842160dd6d32256 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Tue, 6 Feb 2018 09:35:48 -0800 Subject: mpm: Fixup for argument parsing in N310 Adding helper function to parse strings to a boolean value. We can then use that function to parse MPM's default_args, and set enable_gps and enable_fp_gpio. This replaces the usages of the Python builtin bool(), which returns True for any non-empty string. --- mpm/python/usrp_mpm/mpmutils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mpm/python/usrp_mpm/mpmutils.py') diff --git a/mpm/python/usrp_mpm/mpmutils.py b/mpm/python/usrp_mpm/mpmutils.py index 49d6cb39d..08eb54798 100644 --- a/mpm/python/usrp_mpm/mpmutils.py +++ b/mpm/python/usrp_mpm/mpmutils.py @@ -140,3 +140,5 @@ def assert_compat_number( raise RuntimeError(err_msg) return +def str2bool(value): + return value.lower() in ("yes", "true", "t", "1") -- cgit v1.2.3