mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Merge same holidays from different regions
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
ff562b8a9e
commit
002a04db63
2 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue