diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-07-02 15:19:34 +0200 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2020-07-09 00:39:11 -0700 |
commit | a252a2f3d8ff70b9628d097dfcd99ac9935dbe33 (patch) | |
tree | 84a856302ddc056314bf0d4f393f30569421d1fc /mpm | |
parent | f2f8ca056e04d4c021814c93706a24039821d8b6 (diff) | |
download | uhd-a252a2f3d8ff70b9628d097dfcd99ac9935dbe33.tar.gz uhd-a252a2f3d8ff70b9628d097dfcd99ac9935dbe33.tar.bz2 uhd-a252a2f3d8ff70b9628d097dfcd99ac9935dbe33.zip |
mpm: Fix various Pylint issues
No functional changes. Fixes for things that PyLint complains about, but
are safe to change anyway, as well as a minor improvement to a docstring
that referenced non-existant args.
This touches files that are mpm.conf-related.
Diffstat (limited to 'mpm')
-rwxr-xr-x | mpm/python/usrp_hwd.py | 4 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/e320_periphs.py | 1 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n3xx.py | 7 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/prefs.py | 6 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_udp.py | 4 |
5 files changed, 9 insertions, 13 deletions
diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py index d971cc5fc..f79932231 100755 --- a/mpm/python/usrp_hwd.py +++ b/mpm/python/usrp_hwd.py @@ -174,7 +174,7 @@ def main(): log_default_delta=args.verbose-args.quiet ).getChild('main') version_string = mpm.__version__ - if len(mpm.__githash__): + if mpm.__githash__: version_string += "-g" + mpm.__githash__ log.info("Launching USRP/MPM, version: %s", version_string) if args.init_only: @@ -189,4 +189,4 @@ def main(): return spawn_processes(log, args) if __name__ == '__main__': - exit(not main()) + sys.exit(not main()) diff --git a/mpm/python/usrp_mpm/periph_manager/e320_periphs.py b/mpm/python/usrp_mpm/periph_manager/e320_periphs.py index 626ee602a..0bda54775 100644 --- a/mpm/python/usrp_mpm/periph_manager/e320_periphs.py +++ b/mpm/python/usrp_mpm/periph_manager/e320_periphs.py @@ -353,4 +353,3 @@ class MboardRegsControl(MboardRegsCommon): else: self.log.trace("RX RF PLL locked") return locked - diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index b87edfac0..ea6274af8 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -192,9 +192,6 @@ class n3xx(ZynqComponents, PeriphManagerBase): Lists device tree overlays that need to be applied before this class can be used. List of strings. Are applied in order. - - eeprom_md -- Dictionary of info read out from the mboard EEPROM - device_args -- Arbitrary dictionary of info, typically user-defined """ # In the N3xx case, we name the dtbo file the same as the product. # N310 -> n310.dtbo, N300 -> n300.dtbo and so on. @@ -584,8 +581,8 @@ class n3xx(ZynqComponents, PeriphManagerBase): def set_time_source(self, time_source): " Set a time source " clock_source = self._clock_source - assert clock_source != None - assert time_source != None + assert clock_source is not None + assert time_source is not None if (clock_source, time_source) not in self.valid_sync_sources: if time_source == 'sfp0': clock_source = 'internal' diff --git a/mpm/python/usrp_mpm/prefs.py b/mpm/python/usrp_mpm/prefs.py index 0e9d636b2..55b6d803d 100644 --- a/mpm/python/usrp_mpm/prefs.py +++ b/mpm/python/usrp_mpm/prefs.py @@ -8,7 +8,6 @@ MPM preferences management """ import configparser -from builtins import object from usrp_mpm.mpmlog import TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL # Store the global preferences object @@ -19,6 +18,9 @@ MPM_DEFAULT_CONFFILE_PATH = '/etc/uhd/mpm.conf' MPM_DEFAULT_LOG_LEVEL = 'info' MPM_DEFAULT_LOG_BUF_SIZE = 100 # Number of log records to buf +# ConfigParser has too many parents for PyLint's liking, but we don't control +# that, so disable that warning +# pylint: disable=too-many-ancestors class _MPMPrefs(configparser.ConfigParser): """ Container for MPM preferences. @@ -83,6 +85,7 @@ class _MPMPrefs(configparser.ConfigParser): because the logger isn't ready yet. """ return self._errors +# pylint: enable=too-many-ancestors def get_prefs(): """ @@ -92,4 +95,3 @@ def get_prefs(): if _PREFS is None: _PREFS = _MPMPrefs() return _PREFS - diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index d6f8a47a7..f77e2ce41 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -8,14 +8,13 @@ UDP Transport manager """ -from builtins import object from six import iteritems, itervalues from usrp_mpm.ethdispatch import EthDispatcherCtrl from usrp_mpm.sys_utils import net DEFAULT_BRIDGE_MODE = False -class XportMgrUDP(object): +class XportMgrUDP: """ Transport manager for UDP connections """ @@ -153,7 +152,6 @@ class XportMgrUDP(object): def deinit(self): " Clean up after a session terminates " - pass def get_xport_info(self): """ |