Mercurial > babel > old > mirror
comparison scripts/import_cldr.py @ 24:6c2c9fc7d787
Implemented babel.numbers.format_percent
author | jonas |
---|---|
date | Thu, 31 May 2007 19:52:57 +0000 |
parents | aa33ad077d24 |
children | 695884591af6 |
comparison
equal
deleted
inserted
replaced
23:f828705c3bce | 24:6c2c9fc7d787 |
---|---|
267 | 267 |
268 percent_formats = data.setdefault('percent_formats', {}) | 268 percent_formats = data.setdefault('percent_formats', {}) |
269 for elem in tree.findall('//percentFormats/percentFormatLength'): | 269 for elem in tree.findall('//percentFormats/percentFormatLength'): |
270 if 'draft' in elem.attrib and elem.attrib.get('type') in percent_formats: | 270 if 'draft' in elem.attrib and elem.attrib.get('type') in percent_formats: |
271 continue | 271 continue |
272 percent_formats[elem.attrib.get('type')] = unicode(elem.findtext('percentFormat/pattern')) | 272 percent_formats[elem.attrib.get('type')] = numbers.parse_pattern(unicode(elem.findtext('percentFormat/pattern'))) |
273 | 273 |
274 currencies = data.setdefault('currencies', {}) | 274 currencies = data.setdefault('currencies', {}) |
275 for elem in tree.findall('//currencies/currency'): | 275 for elem in tree.findall('//currencies/currency'): |
276 currencies[elem.attrib['type']] = { | 276 currencies[elem.attrib['type']] = { |
277 'display_name': unicode(elem.findtext('displayName')), | 277 'display_name': unicode(elem.findtext('displayName')), |