From 002a04db63197bd24654e07c618dd327f930c65b Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Sat, 28 Dec 2019 14:10:40 +0100 Subject: [PATCH] Merge same holidays from different regions Signed-off-by: Thomas Lauf --- doc/holidays/holidays.en-US | 2 -- doc/holidays/refresh | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/holidays/holidays.en-US b/doc/holidays/holidays.en-US index 865207b0..fb6c27fc 100644 --- a/doc/holidays/holidays.en-US +++ b/doc/holidays/holidays.en-US @@ -8,7 +8,6 @@ define holidays: 2017_01_16 = Birthday of Martin Luther King, Jr. 2017_02_20 = Washington's Birthday 2017_04_17 = Patriots' Day - 2017_04_17 = Patriots' Day 2017_05_29 = Memorial Day 2017_07_04 = Independence Day 2017_09_04 = Labor Day @@ -21,7 +20,6 @@ define holidays: 2018_01_15 = Birthday of Martin Luther King, Jr. 2018_02_19 = Washington's Birthday 2018_04_16 = Patriots' Day - 2018_04_16 = Patriots' Day 2018_05_28 = Memorial Day 2018_07_04 = Independence Day 2018_09_03 = Labor Day diff --git a/doc/holidays/refresh b/doc/holidays/refresh index db5b0564..59930dc1 100755 --- a/doc/holidays/refresh +++ b/doc/holidays/refresh @@ -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: