Files
syn-chat-bot/.venv/lib/python3.9/site-packages/recurring_ical_events/examples.py
Hyungi Ahn c2257d3a86 fix: 포트 충돌 회피 — note_bridge 8098, intent_service 8099
Jellyfin(8096), OrbStack(8097) 포트 충돌으로 변경.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:53:55 +09:00

30 lines
749 B
Python

"""Functionality for smaller examples."""
import icalendar
from recurring_ical_events.constants import CALENDARS
def example_calendar(name: str = "") -> icalendar.Calendar:
"""Return an example calendar.
Args:
name (str): The name of the example file.
Returns:
icalendar.cal.Calendar: The parsed calendar example.
"""
if not name.endswith(".ics"):
name += ".ics"
path = CALENDARS / name
try:
return icalendar.Calendar.from_ical(path.read_bytes())
except FileNotFoundError:
raise ValueError( # noqa: B904
f"File {name!r} not found. "
f"Use one of {', '.join(p.name for p in CALENDARS.glob('*.ics'))!r}."
)
__all__ = ["example_calendar"]