How to use the xandikos.icalendar.MissingProperty function in xandikos

To help you get started, we’ve selected a few xandikos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jelmer / xandikos / xandikos / icalendar.py View on Github external
def check_from_indexes(self, name, indexes):
        for child_filter in self.children:
            try:
                if not child_filter.match_indexes(
                        indexes, self.tzify):
                    return False
            except MissingProperty as e:
                logging.warning(
                    'calendar_query: Ignoring calendar object %s, due '
                    'to missing property %s', name, e.property_name)
                return False
        return True
github jelmer / xandikos / xandikos / icalendar.py View on Github external
def apply_time_range_vjournal(start, end, comp, tzify):
    dtstart = comp.get('DTSTART')
    if not dtstart:
        raise MissingProperty('DTSTART')

    if not (end > tzify(dtstart.dt)):
        return False

    if getattr(dtstart.dt, 'time', None) is not None:
        return (start <= tzify(dtstart.dt))
    else:
        return (start < (tzify(dtstart.dt) + datetime.timedelta(1)))
github jelmer / xandikos / xandikos / icalendar.py View on Github external
def apply_time_range_vevent(start, end, comp, tzify):
    dtstart = comp.get('DTSTART')
    if not dtstart:
        raise MissingProperty('DTSTART')

    if not (end > tzify(dtstart.dt)):
        return False

    dtend = comp.get('DTEND')
    if dtend:
        if tzify(dtend.dt) < tzify(dtstart.dt):
            logging.debug('Invalid DTEND < DTSTART')
        return (start < tzify(dtend.dt))

    duration = comp.get('DURATION')
    if duration:
        return (start < tzify(dtstart.dt) + duration.dt)
    if getattr(dtstart.dt, 'time', None) is not None:
        return (start <= tzify(dtstart.dt))
    else:
github jelmer / xandikos / xandikos / icalendar.py View on Github external
def __init__(self, property_name):
        super(MissingProperty, self).__init__(
            "Property %r missing" % property_name)
        self.property_name = property_name