[PATCH phosphor-settingsd 1/2] parser: pprint settings_file.py

Adriana Kobylak anoo at us.ibm.com
Tue Apr 19 07:03:36 AEST 2016


Looks good.


"openbmc" <openbmc-bounces+anoo=us.ibm.com at lists.ozlabs.org> wrote on 
04/01/2016 05:00:53 PM:

> From: OpenBMC Patches <openbmc-patches at stwcx.xyz>
> To: openbmc at lists.ozlabs.org
> Date: 04/01/2016 05:01 PM
> Subject: [PATCH phosphor-settingsd 1/2] parser: pprint settings_file.py
> Sent by: "openbmc" <openbmc-bounces+anoo=us.ibm.com at lists.ozlabs.org>
> 
> From: Patrick Williams <patrick at stwcx.xyz>
> 
> Use pprint for settings map instead of just casting to string.  This
> makes the output of the tool better for git-diff because it is sorted
> and multiple lines.
> 
> Signed-off-by: Patrick Williams <patrick at stwcx.xyz>
> ---
>  settings_parser.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/settings_parser.py b/settings_parser.py
> index 46bb474..9e74f91 100755
> --- a/settings_parser.py
> +++ b/settings_parser.py
> @@ -5,6 +5,7 @@
>  # adding dependencies to additional modules like yaml
> 
>  import yaml
> +import pprint
> 
>  SETTINGS_FILE = 'settings.yaml'
>  OUTPUT_FILE = 'settings_file.py'
> @@ -16,5 +17,5 @@ with open(SETTINGS_FILE) as s:
>  with open(OUTPUT_FILE, 'w') as f:
>      f.write(FILE_HEADER)
>      f.write('\n')
> -    f.write('SETTINGS=')
> -    f.write(str(data))
> +    f.write('SETTINGS=\\\n')
> +    pprint.pprint(data, stream=f)
> -- 
> 2.7.1
> 
> 
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160418/3fa7fa20/attachment.html>


More information about the openbmc mailing list