summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFelix Schwarz <felix.schwarz@oss.schwarz.eu>2020-05-05 21:32:52 +0000
committerAarni Koskela <akx@iki.fi>2020-05-10 21:01:39 +0300
commit2a826bb1ad9996a1c1e2d3e86a493d01d7f12c09 (patch)
tree254665967190293580c39f2dd3fb576a4e261ce6 /scripts
parent7bdaa28a55e8d8228d5434effa4b1473ab7b3669 (diff)
downloadbabel-2a826bb1ad9996a1c1e2d3e86a493d01d7f12c09.tar.gz
simplify iteration code in "import_cldr.py"
As Miro HronĨok pointed out we don't need ".iter()" in the script.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/import_cldr.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py
index 2ed3af9..7ea6481 100755
--- a/scripts/import_cldr.py
+++ b/scripts/import_cldr.py
@@ -598,7 +598,7 @@ def parse_calendar_months(data, calendar):
for width in ctxt.findall('monthWidth'):
width_type = width.attrib['type']
widths = ctxts.setdefault(width_type, {})
- for elem in width.iter():
+ for elem in width:
if elem.tag == 'month':
_import_type_text(widths, elem, int(elem.attrib['type']))
elif elem.tag == 'alias':
@@ -616,7 +616,7 @@ def parse_calendar_days(data, calendar):
for width in ctxt.findall('dayWidth'):
width_type = width.attrib['type']
widths = ctxts.setdefault(width_type, {})
- for elem in width.iter():
+ for elem in width:
if elem.tag == 'day':
_import_type_text(widths, elem, weekdays[elem.attrib['type']])
elif elem.tag == 'alias':
@@ -634,7 +634,7 @@ def parse_calendar_quarters(data, calendar):
for width in ctxt.findall('quarterWidth'):
width_type = width.attrib['type']
widths = ctxts.setdefault(width_type, {})
- for elem in width.iter():
+ for elem in width:
if elem.tag == 'quarter':
_import_type_text(widths, elem, int(elem.attrib['type']))
elif elem.tag == 'alias':
@@ -649,7 +649,7 @@ def parse_calendar_eras(data, calendar):
for width in calendar.findall('eras/*'):
width_type = NAME_MAP[width.tag]
widths = eras.setdefault(width_type, {})
- for elem in width.iter():
+ for elem in width:
if elem.tag == 'era':
_import_type_text(widths, elem, type=int(elem.attrib.get('type')))
elif elem.tag == 'alias':
@@ -676,7 +676,7 @@ def parse_calendar_periods(data, calendar):
def parse_calendar_date_formats(data, calendar):
date_formats = data.setdefault('date_formats', {})
for format in calendar.findall('dateFormats'):
- for elem in format.iter():
+ for elem in format:
if elem.tag == 'dateFormatLength':
type = elem.attrib.get('type')
if _should_skip_elem(elem, type, date_formats):
@@ -696,7 +696,7 @@ def parse_calendar_date_formats(data, calendar):
def parse_calendar_time_formats(data, calendar):
time_formats = data.setdefault('time_formats', {})
for format in calendar.findall('timeFormats'):
- for elem in format.iter():
+ for elem in format:
if elem.tag == 'timeFormatLength':
type = elem.attrib.get('type')
if _should_skip_elem(elem, type, time_formats):
@@ -717,7 +717,7 @@ def parse_calendar_datetime_skeletons(data, calendar):
datetime_formats = data.setdefault('datetime_formats', {})
datetime_skeletons = data.setdefault('datetime_skeletons', {})
for format in calendar.findall('dateTimeFormats'):
- for elem in format.iter():
+ for elem in format:
if elem.tag == 'dateTimeFormatLength':
type = elem.attrib.get('type')
if _should_skip_elem(elem, type, datetime_formats):