From 647f6e2476a582a2f038ef18f15e249bcf38da91 Mon Sep 17 00:00:00 2001 From: Developer Anonymous Date: Wed, 28 Aug 2024 23:23:30 +0200 Subject: [PATCH] Remove ScheduledEventRecurrenceRule.from_str and related --- discord/scheduled_event.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py index 15f8874d7..5763e209a 100644 --- a/discord/scheduled_event.py +++ b/discord/scheduled_event.py @@ -24,7 +24,6 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations -import re from datetime import datetime, date from typing import ( TYPE_CHECKING, @@ -77,15 +76,6 @@ __all__ = ( ) # fmt: on -_RFC5545_PATTERN = re.compile( - r"""^DTSTART:(?P(?P\d{8)(T(?P\d{6}Z)?)?)(;TZID=(?P[A-Za-z0-9/_-]+))?;RRULE: -FREQ=(?PDAILY|WEEKLY|MONTHLY|YEARLY)(;INTERVAL=(?P\d+))?(;COUNT=(?P\d+)|;UNTIL=(?P -\d{8}T\d{6}Z))?(;BYDAY=(?P(MO|TU|WE|TH|FR|SA|SU)(,(MO|TU|WE|TH|FR|SA|SU))*))?(;BYMONTHDAY(?P(-?\d{1,2 -})(,-?\d{1,2})*))?(;BYYEARDAY=(?P(-?\d{1,3})(,-?\d{1,3})*))?(;BYWEEKNO=(?P(-?\d{1,2})(,-?\d{1,2})*) -)?(;BYMONTH=(?P\d{1,2}(,\d{1,2})*))?(;BYSETPOS=(?P(-?\d+)(,-?\d+)*))?(;WKST=(?P(SU|MO|TU|WE|TH| -FR|SA)))?$ -""" -) class _NWeekday(NamedTuple): week: Literal[1, 2, 3, 4, 5] @@ -349,25 +339,6 @@ class ScheduledEventRecurrenceRule: # TODO: finish this impl return self - @classmethod - def from_str(cls, string: str, /) -> Self: - """Constructs a recurrence rule from a RFC5545 rrule string, - - Parameters - ---------- - string: :class:`str` - The string to construct the recurrence rule from. - - Returns - ------- - :class:`.ScheduledEventRecurrenceRule` - The recurrence rule. - """ - - match = _RFC5545_PATTERN.match(string) - - # TODO: finish this impl - class ScheduledEvent(Hashable): """Represents a scheduled event in a guild.