From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 38FD05932 for ; Thu, 29 May 2014 09:23:30 +0200 (CEST) Received: by mail-wg0-f51.google.com with SMTP id x13so12366023wgg.10 for ; Thu, 29 May 2014 00:23:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=BXw322MJciWwE3kpO2R1Hw1RR4TxzLvK6euE0+0k7Fw=; b=T65a/XWrTyMpVhCPBHvmol+UsFv8p4yNGKwQFTuEaOZ2YD3bwuGcTCr49R0lFajuWU hDYheMhhhvTxC9HiTIMPqP7a4/fKcmx58Aan44Gi1dVkj9BMXje2imIsr+ahhaoORdpL yE6T8dGWs+j8FqBLrmezthzf1IZ1igLpDR2vc40bmvlV8fFQciziMfYCTLpprWNAVrTa ZxdYzyRL3oTVOTwJoTSm+PDrw2b6fzt1l8FJlqepgreEIHz0xCxkWCxyTzIts6szyNXG 3UrfXI4uA7zZC2vAViYq+LqP6kp7QOnyuEuZthxGj5eD6AbQjnNPxuKKlAYU+jtW3nL1 WW0g== X-Gm-Message-State: ALoCoQkVwiaCgeLGE2eM+hMajXcNedjzD4hU0GRvkQi2e9Dky7/fldeCeaS8aV2vrPOZJkA3//Hw X-Received: by 10.180.183.131 with SMTP id em3mr56204563wic.56.1401348220444; Thu, 29 May 2014 00:23:40 -0700 (PDT) Received: from xps13.localnet (15.21.90.92.rev.sfr.net. [92.90.21.15]) by mx.google.com with ESMTPSA id rw4sm49516097wjb.44.2014.05.29.00.23.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 May 2014 00:23:39 -0700 (PDT) From: Thomas Monjalon To: Shannon Zhao Date: Thu, 29 May 2014 09:22:49 +0200 Message-ID: <2140757.fj3Ic02JMu@xps13> Organization: 6WIND User-Agent: KMail/4.13 (Linux/3.14.4-1-ARCH; KDE/4.13.0; x86_64; ; ) In-Reply-To: <1401344699-7432-1-git-send-email-zhaoshenglong@huawei.com> References: <1401344699-7432-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] cpu_layout.py: adjust output format to align X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 07:23:30 -0000 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