Bug 1890689 remove DynamicResampler::mSetBufferDuration r=pehrsons
[gecko.git] / intl / locale / props2arrays.py
blob0572cb1c5f26e1d73d4afd2b7f95eb05fa4134d4
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):
7 mappings = {}
9 with open(propFile, "r") as f:
10 for line in f:
11 line = line.strip()
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")
22 entries = [
23 '{ "%s", "%s", %d }' % (key, mappings[key], len(mappings[key]))
24 for key in sorted(keys)
26 header.write(",\n".join(entries) + "\n")