From 78f453f8b59b2c4995e2aab584f3022715a2caaf Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 8 May 2019 13:21:36 -0700 Subject: mpm: mg: Only import AD9371 API calls if not yet on Magnesium This will avoid importing API calls from the self.mykonos object onto the Magnesium class if the Magnesium class already has such a method. --- mpm/python/usrp_mpm/dboard_manager/magnesium.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mpm/python/usrp_mpm') diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index 2d2e7aa60..13e621414 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -220,7 +220,7 @@ class Magnesium(BfrfsEEPROM, DboardManagerBase): " Export a method object, including docstring " meth_obj = getattr(obj, method) def func(*args): - " Functor for storing docstring too " + " Functor for storing docstring to " return meth_obj(*args) func.__doc__ = meth_obj.__doc__ return func @@ -228,7 +228,8 @@ class Magnesium(BfrfsEEPROM, DboardManagerBase): for method in [ x for x in dir(self.mykonos) if not x.startswith("_") and \ - callable(getattr(self.mykonos, x))]: + callable(getattr(self.mykonos, x)) \ + and not hasattr(self, x)]: self.log.trace("adding {}".format(method)) setattr(self, method, export_method(myk, method)) -- cgit v1.2.3