feat: add X-WR-CALNAME,X-WR-CALDESC to icalendar (#133)

增加订阅日历名称、描述

Co-authored-by: NateScarlet <NateScarlet@Gmail.com>
This commit is contained in:
北门清燕 2021-11-04 11:34:32 +08:00 committed by GitHub
parent 26d4722348
commit 38a1d46900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,8 @@ def _iter_date_ranges(days: Sequence[dict]) -> Iterator[Tuple[dict, dict]]:
def generate_ics(days: Sequence[dict], filename: Text) -> None: def generate_ics(days: Sequence[dict], filename: Text) -> None:
"""Generate ics from days.""" """Generate ics from days."""
cal = Calendar() cal = Calendar()
cal.add("X-WR-CALNAME", "中国法定节假日")
cal.add("X-WR-CALDESC", "中国法定节假日数据,自动每日抓取国务院公告。")
cal.add("VERSION", "2.0") cal.add("VERSION", "2.0")
cal.add("METHOD", "PUBLISH") cal.add("METHOD", "PUBLISH")
cal.add("CLASS", "PUBLIC") cal.add("CLASS", "PUBLIC")