From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [PATCHv8 5/6] pmdinfo.py: Add tool to query binaries for hw and other support information Date: Wed, 29 Jun 2016 16:12:21 +0100 Message-ID: <54616833-c0cc-8e93-c9de-1580f264c57e@intel.com> References: <1465494421-6210-1-git-send-email-nhorman@tuxdriver.com> <1466189185-21952-1-git-send-email-nhorman@tuxdriver.com> <1466189185-21952-6-git-send-email-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Richardson , Thomas Monjalon , Stephen Hemminger , Panu Matilainen To: Neil Horman , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 63C3E2BBA for ; Wed, 29 Jun 2016 17:12:58 +0200 (CEST) In-Reply-To: <1466189185-21952-6-git-send-email-nhorman@tuxdriver.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" '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: [..] > +++ 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)