From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] cpu_layout.py: adjust output format to align Date: Thu, 29 May 2014 09:22:49 +0200 Message-ID: <2140757.fj3Ic02JMu@xps13> References: <1401344699-7432-1-git-send-email-zhaoshenglong@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Shannon Zhao Return-path: In-Reply-To: <1401344699-7432-1-git-send-email-zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Shannon, I feel this version is better but it's really complicated to read. > +max_processor_len=len(str(len(cores)*len(sockets)*2-1)) > +max_core_map_len = max_processor_len*2+4 > +if max_core_map_len < 12: > + max_core_map_len = 12 This line is not indented as the other ones. > +max_core_id_len=len(str(max(cores))) > + > +print " ".ljust(max_core_id_len+5), > for s in sockets: > - print "\tSocket %s" % s, > + print "Socket %s" % str(s).ljust(max_core_map_len-7), > print "" > +print " ".ljust(max_core_id_len+5), Could you replace all these numbers by something meaningful and easier to understand? Example: 5 can be replaced by len('Core ') Other comment: please add spaces around operators (= + - *). Thanks -- Thomas