Re: [PATCHv8 5/6] pmdinfo.py: Add tool to query binaries for hw and other support information
From: Remy Horton <hidden>
Date: 2016-06-29 15:12:58
'noon, The tool does not work for static PMD libraries (e.g. librte_pmd_i40e.a) - is this an intended limitation? DPDK doesn't to my knowledge have any coding guidelines for Python, so the comments below should be considered advisory rather than merge-blocking issues. On 17/06/2016 19:46, Neil Horman wrote: [..]
quoted hunk ↗ jump to hunk
+++ b/tools/pmdinfo.py@@ -0,0 +1,629 @@ +#!/usr/bin/python +# ------------------------------------------------------------------------- +# scripts/pmdinfo.py +# +# Utility to dump PMD_INFO_STRING support from an object file +#
No licence..?
+# ------------------------------------------------------------------------- +import os +import sys +from optparse import OptionParser +import string +import json + +# For running from development directory. It should take precedence over the +# installed pyelftools. +sys.path.insert(0, '.')
Aside from causing all the subsequent imports to have PEP8 errors, this does not looks like a good way of pulling in project-specific Python library installs. Usual method is either using virtualenv or the PYTHONPATH enviornment variable.
+from elftools import __version__ +from elftools.common.exceptions import ELFError
[..]
+from elftools.dwarf.constants import ( + DW_LNS_copy, DW_LNS_set_file, DW_LNE_define_file) +from elftools.dwarf.callframe import CIE, FDE
According to PyLint, most of these imports are unused.
+ + +class Vendor:
Old style class definition. Using modern notation it is: class Vendor(object):
+ def report(self): + print "\t%s\t%s" % (self.ID, self.name) + for subID, subdev in self.subdevices.items(): + subdev.report()
subID unused. An underscore can be used as a placeholder for these types of loops.
+ optparser.add_option("-t", "--table", dest="tblout",
+ help="output information on hw support as a hex table",PEP8: pmdinfo.py:573:80: E501 line too long (80 > 79 characters)