[Fuego] [PATCH 01/16] Add fuego-release Functional test

Guilherme Camargo guicc at profusion.mobi
Tue Apr 3 22:09:34 UTC 2018


On Tue, Apr 3, 2018 at 5:22 PM, <Tim.Bird at sony.com> wrote:

>
>
> > -----Original Message-----
> > From: Guilherme Camargo
> >
> > Hello, Tim. Thanks for the the review of this patch.
> >
> > I'm implementing most of your comments. Please see a few comments
> > inline.
> >
> > 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:
> >
> >    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
> >
> >    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:
> >
> >    ```
> >    161 COMMAND_OUTPUT_PATTERN = re.compile(
> >    162     r'^{0}(.*){0}\s+{1}'.format(
> >    163         COMMAND_OUTPUT_DELIM, BASH_PATTERN), re.M | re.S)
> >    ```
> >
> >    or
> >
> >    ```
> >    191             "echo '{0}${{{1}}}{0}'".format(
> >    192                 self.COMMAND_OUTPUT_DELIM,
> >    193                 self.OUTPUT_VARIABLE))
> >    ```
> >
> >    Also, I checked and we're using the newer method consistently
> >    throughout the test.
> >
> > 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
>
>
> Ok. Just sent a patch fixing that. Thanks.​


​--
Guilherme​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/fuego/attachments/20180403/dcadc7f1/attachment.html>


More information about the Fuego mailing list