Skip to content

Commit

Permalink
chore: Alicn and clean up from_xml() subclassing
Browse files Browse the repository at this point in the history
  • Loading branch information
ecederstrand committed Mar 26, 2024
1 parent 32bc90a commit d2fbf1d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions exchangelib/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ class TimeZoneTransition(EWSElement, metaclass=EWSMeta):

@classmethod
def from_xml(cls, elem, account):
res = super().from_xml(elem, account)
res = super().from_xml(elem=elem, account=account)
# Some parts of EWS use '5' to mean 'last occurrence in month', others use '-1'. Let's settle on '5' because
# only '5' is accepted in requests.
if res.occurrence == -1:
Expand Down Expand Up @@ -1871,7 +1871,7 @@ class RecurringDayTransition(BaseTransition):

@classmethod
def from_xml(cls, elem, account):
res = super().from_xml(elem, account)
res = super().from_xml(elem=elem, account=account)
# See TimeZoneTransition.from_xml()
if res.occurrence == -1:
res.occurrence = 5
Expand Down Expand Up @@ -1923,10 +1923,6 @@ class TimeZoneDefinition(EWSElement):
transitions_groups = EWSElementListField(field_uri="TransitionsGroups", value_cls=TransitionsGroup)
transitions = TransitionListField(field_uri="Transitions", value_cls=BaseTransition)

@classmethod
def from_xml(cls, elem, account):
return super().from_xml(elem, account)

def _get_standard_period(self, transitions_group):
# Find the first standard period referenced from transitions_group
standard_periods_map = {p.id: p for p in self.periods if p.name == "Standard"}
Expand Down

0 comments on commit d2fbf1d

Please sign in to comment.