diff options
author | Swapnil Negi <swapnil.negi09@gmail.com> | 2018-04-05 04:59:16 +0530 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-06 15:13:27 -0700 |
commit | 48542c39a24a32c628dc4b59efa5545b2112ea57 (patch) | |
tree | b428714d7377c4f05c2aa68b1fc8d9c91cc90eac /gr-utils/python/modtool/modtool_makexml.py | |
parent | 6e91f2ecf17db6f7ac810faf18e7ea719247d8d4 (diff) |
modtool: Pylint error fixes
Diffstat (limited to 'gr-utils/python/modtool/modtool_makexml.py')
-rw-r--r-- | gr-utils/python/modtool/modtool_makexml.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gr-utils/python/modtool/modtool_makexml.py b/gr-utils/python/modtool/modtool_makexml.py index 9d047a67bc..c45759c605 100644 --- a/gr-utils/python/modtool/modtool_makexml.py +++ b/gr-utils/python/modtool/modtool_makexml.py @@ -57,7 +57,7 @@ class ModToolMakeXML(ModTool): self._info['pattern'] = args[1] else: self._info['pattern'] = raw_input('Which blocks do you want to parse? (Regex): ') - if len(self._info['pattern']) == 0: + if not self._info['pattern'] or self._info['pattern'].isspace(): self._info['pattern'] = '.' def run(self): @@ -85,7 +85,7 @@ class ModToolMakeXML(ModTool): for f in files: if re.search(self._info['pattern'], os.path.basename(f)) is not None: files_filt.append(f) - if len(files_filt) == 0: + if not files_filt: print "None found." return files_filt @@ -113,10 +113,10 @@ class ModToolMakeXML(ModTool): file_exists = True print "Warning: Overwriting existing GRC file." grc_generator = GRCXMLGenerator( - modname=self._info['modname'], - blockname=blockname, - params=params, - iosig=iosig + modname=self._info['modname'], + blockname=blockname, + params=params, + iosig=iosig ) grc_generator.save(path_to_xml) if file_exists: @@ -145,7 +145,7 @@ class ModToolMakeXML(ModTool): 'std::vector<int>': 'int_vector', 'std::vector<float>': 'real_vector', 'std::vector<gr_complex>': 'complex_vector', - } + } if p_type in ('int',) and default_v is not None and len(default_v) > 1 and default_v[:2].lower() == '0x': return 'hex' try: @@ -172,4 +172,3 @@ class ModToolMakeXML(ModTool): raise ModToolException("Can't open some of the files necessary to parse {}.".format(fname_cc)) return (parser.read_params(), parser.read_io_signature(), blockname) - |