You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/tools/locale_convert.py

22 lines
395 B
Python

#!/usr/bin/env python
import sys, json, re
f = open(sys.argv[1])
output = {}
for line in f:
if not line.startswith("#"):
data = re.search("(.+?[^\\\]);(.+)", line)
if data is not None:
key = data.group(1).replace("\;", ";").strip()
val = data.group(2).replace("\;", ";").strip()
output[key] = {
"message": val,
"description": ""
}
print json.dumps(output)