Logo Search packages:      
Sourcecode: calendarserver version File versions  Download package

def twistedcaldav::ical::Component::getAttendeeProperty (   self,
  match 
)

Get the attendees matching a value. Works on either a VCALENDAR or on a component.

@param match: a C{list} of calendar user address strings to try and match.
@return: the string value of the Organizer property, or None

Definition at line 1031 of file ical.py.

01031                                         :
        """
        Get the attendees matching a value. Works on either a VCALENDAR or on a component.
        
        @param match: a C{list} of calendar user address strings to try and match.
        @return: the string value of the Organizer property, or None
        """
        
        # FIXME: we should really have a URL class and have it manage comparisons
        # in a sensible fashion.
        def _normalizeCUAddress(addr):
            if addr.startswith("/") or addr.startswith("http:") or addr.startswith("https:"):
                return addr.rstrip("/")
            else:
                return addr

        # Need to normalize http/https cu addresses
        test = set()
        for item in match:
            test.add(_normalizeCUAddress(item))
        
        # Extract appropriate sub-component if this is a VCALENDAR
        if self.name() == "VCALENDAR":
            for component in self.subcomponents():
                if component.name() != "VTIMEZONE":
                    return component.getAttendeeProperty(match)
        else:
            # Find the primary subcomponent
            for p in self.properties("ATTENDEE"):
                if _normalizeCUAddress(p.value()) in test:
                    return p

        return None

    def getAttendeeProperties(self, match):


Generated by  Doxygen 1.6.0   Back to index