Updated ics_calendar
This commit is contained in:
@@ -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) == "-":
|
||||
|
||||
Reference in New Issue
Block a user