Bug 1618620 - Convert props2arrays.py to py3; r=firefox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D64622

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Shal 2020-02-28 00:28:24 +00:00
Родитель 43842108f2
Коммит bdf30a6e22
2 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -77,7 +77,7 @@ prefixes = (
for prefix in prefixes:
input_file = prefix + '.properties'
header = prefix + '.properties.h'
GeneratedFile(header, script='props2arrays.py', inputs=[input_file], py2=True)
GeneratedFile(header, script='props2arrays.py', inputs=[input_file])
if CONFIG['ENABLE_TESTS']:
DIRS += ['tests/gtest']

Просмотреть файл

@ -15,11 +15,10 @@ def main(header, propFile):
mappings[parts[0].strip()] = parts[1].strip()
keys = mappings.keys()
keys.sort()
header.write("// This is a generated file. Please do not edit.\n")
header.write("// Please edit the corresponding .properties file instead.\n")
entries = ['{ "%s", "%s", %d }'
% (key, mappings[key], len(mappings[key])) for key in keys]
% (key, mappings[key], len(mappings[key])) for key in sorted(keys)]
header.write(',\n'.join(entries) + '\n')