Merge same holidays from different regions

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2019-12-28 14:10:40 +01:00
parent ff562b8a9e
commit 002a04db63
2 changed files with 6 additions and 3 deletions

View file

@ -62,6 +62,7 @@ def update_locales(locales, regions, years):
fh.write(" {}:\n".format(locale))
for year in years:
holidays = dict()
url = holidata(locale, year)
print(url)
try:
@ -73,7 +74,11 @@ def update_locales(locales, regions, years):
if not j['region'] or not regions or j['region'] in regions:
day = j['date'].replace("-", "_")
desc = j['description']
fh.write(" {} = {}\n".format(day, desc))
holidays[day] = desc
for date, desc in holidays.items():
fh.write(" {} = {}\n".format(date, desc))
fh.write('\n')
except HTTPError as e: