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/.
9 propFile
= open(sys
.argv
[1], "r");
13 if not line
.startswith('#'):
14 parts
= line
.split("=", 1)
15 if len(parts
) == 2 and len(parts
[0]) > 0:
16 mappings
[parts
[0].strip()] = parts
[1].strip()
20 keys
= mappings
.keys()
23 hFile
= open(sys
.argv
[2], "w");
25 hFile
.write("// This is a generated file. Please do not edit.\n")
26 hFile
.write("// Please edit the corresponding .properties file instead.\n")
34 hFile
.write('{ "%s", "%s", (const char*)NS_INT32_TO_PTR(%d) }'
35 % (key
, mappings
[key
], len(mappings
[key
])));