From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Sony.onmicrosoft.com; s=selector1-Sony-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=29iyTEeFFqo2KvJg+qkvGCWQrbAqU1aXFXKoretnugU=; b=k4vsNKB6uka1ozEflDV+yRXO19MAfEYzbsfqY71GCmZdUv6egw9+9Dawcd3JgOk2gt6mvajvC7KYNSNfldZsYyj5K+grGLl3rpCeY07VBFb/A6m5GZAdqIUUMVTH2sI1S63LF4FJwdH+gidLExuy1tDRHPemWhfrO7GSbw10atw= From: Date: Tue, 3 Apr 2018 20:22:40 +0000 Message-ID: References: <20180329000832.12268-1-guicc@profusion.mobi> <20180329000832.12268-2-guicc@profusion.mobi> <20180403031743.ua6qx6xdnmqhkpkm@guicc-arch-three> In-Reply-To: <20180403031743.ua6qx6xdnmqhkpkm@guicc-arch-three> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Fuego] [PATCH 01/16] Add fuego-release Functional test List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: guicc@profusion.mobi Cc: fuego@lists.linuxfoundation.org > -----Original Message----- > From: Guilherme Camargo >=20 > Hello, Tim. Thanks for the the review of this patch. >=20 > I'm implementing most of your comments. Please see a few comments > inline. >=20 > Also, regarding the string formatting operations - the newer method > str.format() VS the legacy version % - I think we should consider > keeping the newer method for the following reasons: >=20 > 1. Python documentation encourages the use of the new method > (str.format()) instead of the old method - as we can see here > https://docs.python.org/release/3.1.5/library/stdtypes.html#old-string- > formatting-operations >=20 > 2. There are a few advantages of using this new method for complex > string formatting, specially when a value is used multiple times in > the string as in: >=20 > ``` > 161 COMMAND_OUTPUT_PATTERN =3D re.compile( > 162 r'^{0}(.*){0}\s+{1}'.format( > 163 COMMAND_OUTPUT_DELIM, BASH_PATTERN), re.M | re.S) > ``` >=20 > or >=20 > ``` > 191 "echo '{0}${{{1}}}{0}'".format( > 192 self.COMMAND_OUTPUT_DELIM, > 193 self.OUTPUT_VARIABLE)) > ``` >=20 > Also, I checked and we're using the newer method consistently > throughout the test. >=20 > But it's your call, no problem if you still prefer using '%', please > just let me know and I can make the change if that's the case. My personal preference is to use the % format operator, and the %s-style formatting strings. I also use C, and it is a little easier on my brain to not have to remember 2 different formatting syntaxes. Please change them. Thanks, -- Tim