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

def twistedcaldav::ical::Component::getTriggerDetails (   self  ) 

Return the trigger information for the specified alarm component.
@param component: the Component whose start should be returned.
@return: ta tuple consisting of:
    trigger : the 'native' trigger value (either datetime.date or datetime.timedelta)
    related : either True (for START) or False (for END)
    repeat : an integer for the REPEAT count
    duration: the repeat duration if present, otherwise None

Definition at line 592 of file ical.py.

00592                                :
        """
        Return the trigger information for the specified alarm component.
        @param component: the Component whose start should be returned.
        @return: ta tuple consisting of:
            trigger : the 'native' trigger value (either datetime.date or datetime.timedelta)
            related : either True (for START) or False (for END)
            repeat : an integer for the REPEAT count
            duration: the repeat duration if present, otherwise None
        """
        assert self.name() == "VALARM", "Component is not a VAlARM: %r" % (self,)
        
        # The trigger value
        trigger = self.propertyNativeValue("TRIGGER")
        if trigger is None:
            raise ValueError("VALARM has no TRIGGER property: %r" % (self,))
        
        # The related parameter
        triggerProperty = self.getProperty("TRIGGER")
        if "RELATED" in triggerProperty.params():
            related = (triggerProperty.params()["RELATED"][0] == "START")
        else:
            related = True
        
        # Repeat property
        repeat = self.propertyNativeValue("REPEAT")
        if repeat is None: repeat = 0
        else: repeat = int(repeat)
        
        # Duration property
        duration = self.propertyNativeValue("DURATION")

        if repeat > 0 and duration is None:
            raise ValueError("VALARM has invalid REPEAT/DURATIOn properties: %r" % (self,))

        return (trigger, related, repeat, duration)
 
    def getRRuleSet(self, addRDate = False):


Generated by  Doxygen 1.6.0   Back to index