Updated ics_calendar

This commit is contained in:
2025-12-08 12:06:06 +01:00
parent db9b8a73d3
commit 67b2c2edde
6 changed files with 32 additions and 29 deletions

View File

@@ -91,7 +91,7 @@ class CalendarData: # pylint: disable=R0902
"""
return self._calendar_data
def set_headers(
def headers(
self,
user_name: str,
password: str,
@@ -124,14 +124,17 @@ class CalendarData: # pylint: disable=R0902
self._headers.append(("User-agent", user_agent))
if accept_header != "":
self._headers.append(("Accept", accept_header))
return self
def set_timeout(self, connection_timeout: float):
def timeout(self, connection_timeout: float | None):
"""Set the connection timeout.
:param connection_timeout: The timeout value in seconds.
:type connection_timeout: float
"""
self.connection_timeout = connection_timeout
if connection_timeout:
self.connection_timeout = connection_timeout
return self
def _decode_data(self, data):
return data.replace("\0", "")
@@ -202,7 +205,6 @@ class CalendarData: # pylint: disable=R0902
def _get_month_year(self, url: str, month: int, year: int) -> int:
(month, url) = self._get_year_as_months(url, month)
print(f"month: {month}\n")
month_match = re.search("\\{month([-+])([0-9]+)\\}", url)
if month_match:
if month_match.group(1) == "-":