diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2018-02-06 09:35:48 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-07 17:21:43 +0100 |
commit | d9366ba7d4b72f9e277ca7055842160dd6d32256 (patch) | |
tree | 4fb06516797e9fc82fbe740457729068a3a46c54 /mpm/python/usrp_mpm/mpmutils.py | |
parent | 31f9d3dce799ce86c903dd3e377d3f4038086ef7 (diff) | |
download | uhd-d9366ba7d4b72f9e277ca7055842160dd6d32256.tar.gz uhd-d9366ba7d4b72f9e277ca7055842160dd6d32256.tar.bz2 uhd-d9366ba7d4b72f9e277ca7055842160dd6d32256.zip |
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.
Diffstat (limited to 'mpm/python/usrp_mpm/mpmutils.py')
-rw-r--r-- | mpm/python/usrp_mpm/mpmutils.py | 2 |
1 files changed, 2 insertions, 0 deletions
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") |