1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 def main(header
, propFile
):
9 with
open(propFile
, "r") as f
:
12 if not line
.startswith("#"):
13 parts
= line
.split("=", 1)
14 if len(parts
) == 2 and len(parts
[0]) > 0:
15 mappings
[parts
[0].strip()] = parts
[1].strip()
17 keys
= mappings
.keys()
19 header
.write("// This is a generated file. Please do not edit.\n")
20 header
.write("// Please edit the corresponding .properties file instead.\n")
23 '{ "%s", "%s", %d }' % (key
, mappings
[key
], len(mappings
[key
]))
24 for key
in sorted(keys
)
26 header
.write(",\n".join(entries
) + "\n")