def _handle_BYWEEKDAY(self, rrkwargs, name, value, **kwargs):
        """
        Two ways to specify this: +1MO or MO(+1)
        """
        l = []
        for wday in value.split(','):
            if '(' in wday:
                # If it's of the form TH(+1), etc.
                splt = wday.split('(')
                w = splt[0]
                n = int(splt[1][:-1])
            elif len(wday):
                # If it's of the form +1MO
                for i in range(len(wday)):
                    if wday[i] not in '+-0123456789':
                        break
                n = wday[:i] or None
                w = wday[i:]
                if n:
                    n = int(n)
            else:
                raise ValueError("Invalid (empty) BYDAY specification.")

            l.append(weekdays[self._weekday_map[w]](n))
        rrkwargs["byweekday"] = l
def _handle_BYWEEKDAY(self, rrkwargs, name, value, **kwargs):
        """
        Two ways to specify this: +1MO or MO(+1)
        """
        l = []
        for wday in value.split(','):
            if '(' in wday:
                # If it's of the form TH(+1), etc.
                splt = wday.split('(')
                w = splt[0]
                n = int(splt[1][:-1])
            elif len(wday):
                # If it's of the form +1MO
                for i in range(len(wday)):
                    if wday[i] not in '+-0123456789':
                        break
                n = wday[:i] or None
                w = wday[i:]
                if n:
                    n = int(n)
            else:
                raise ValueError("Invalid (empty) BYDAY specification.")

            l.append(weekdays[self._weekday_map[w]](n))
        rrkwargs["byweekday"] = l
def _handle_BYWEEKDAY ( self , rrkwargs , name , value , * * kwargs ) : l = [ ] for wday in value . split ( ',' ) : if '(' in wday : # If it's of the form TH(+1), etc. splt = wday . split ( '(' ) w = splt [ 0 ] n = int ( splt [ 1 ] [ : - 1 ] ) elif len ( wday ) : # If it's of the form +1MO for i in range ( len ( wday ) ) : if wday [ i ] not in '+-0123456789' : break n = wday [ : i ] or None w = wday [ i : ] if n : n = int ( n ) else : raise ValueError ( "Invalid (empty) BYDAY specification." ) l . append ( weekdays [ self . _weekday_map [ w ] ] ( n ) ) rrkwargs [ "byweekday" ] = l
Two ways to specify this: +1MO or MO(+1)
Two ways to specify this : + 1MO or MO ( + 1 )