Mercurial > babel > mirror
diff scripts/import_cldr.py @ 346:5e58ea360a5c stable-0.9.x
Merged revisions [358:360], [364:370], [373:378], [380:382] from [source:trunk].
author | cmlenz |
---|---|
date | Mon, 16 Jun 2008 12:48:43 +0000 |
parents | da97a3138239 |
children | 4eca63af0a12 |
line wrap: on
line diff
--- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -55,7 +55,7 @@ sup = parse(os.path.join(srcdir, 'supplemental', 'supplementalData.xml')) - # import global data from the supplemental files + # Import global data from the supplemental files global_data = {} territory_zones = global_data.setdefault('territory_zones', {}) @@ -69,6 +69,14 @@ for alias in elem.attrib['aliases'].split(): zone_aliases[alias] = tzid + # Import Metazone mapping + meta_zones = global_data.setdefault('meta_zones', {}) + tzsup = parse(os.path.join(srcdir, 'supplemental', 'metazoneInfo.xml')) + for elem in tzsup.findall('//timezone'): + for child in elem.findall('usesMetazone'): + if 'to' not in child.attrib: # FIXME: support old mappings + meta_zones[elem.attrib['type']] = child.attrib['mzone'] + outfile = open(os.path.join(destdir, 'global.dat'), 'wb') try: pickle.dump(global_data, outfile, 2) @@ -197,9 +205,6 @@ info.setdefault('long', {})[child.tag] = unicode(child.text) for child in elem.findall('short/*'): info.setdefault('short', {})[child.tag] = unicode(child.text) - for child in elem.findall('usesMetazone'): - if 'to' not in child.attrib: # FIXME: support old mappings - info['use_metazone'] = child.attrib['mzone'] time_zones[elem.attrib['type']] = info meta_zones = data.setdefault('meta_zones', {})