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