Example #1
0
def calendar_long_name():
    return CalendarSyncResponse([], [
        Calendar(
            name=
            'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris_!',
            uid='long_calendar_uid',
            read_only=True)
    ])
Example #2
0
def calendar_response():
    return CalendarSyncResponse([], [
        Calendar(name='Important Meetings',
                 uid='first_calendar_uid',
                 read_only=False),
        Calendar(name='Nefarious Schemes',
                 uid='second_calendar_uid',
                 read_only=False),
    ])
Example #3
0
def calendar_response_with_update():
    return CalendarSyncResponse(
        [],
        [
            Calendar(
                name="Super Important Meetings",
                uid="first_calendar_uid",
                read_only=False,
            )
        ],
    )
Example #4
0
def calendar_response():
    return CalendarSyncResponse(
        [],
        [
            Calendar(name="Important Meetings",
                     uid="first_calendar_uid",
                     read_only=False),
            Calendar(name="Nefarious Schemes",
                     uid="second_calendar_uid",
                     read_only=False),
        ],
    )
Example #5
0
    def sync_calendars(self):
        """ Fetches data for the user's calendars.
        Returns
        -------
        CalendarSyncResponse
        """

        deletes = []
        updates = []
        items = self._get_raw_calendars()
        for item in items:
            if item.get('deleted'):
                deletes.append(item['id'])
            else:
                updates.append(parse_calendar_response(item))

        return CalendarSyncResponse(deletes, updates)
Example #6
0
    def sync_calendars(self):
        """ Fetches data for the user's calendars.
        Returns
        -------
        CalendarSyncResponse
        """

        deletes = []
        updates = []
        items = self._get_raw_calendars()
        for item in items:
            if item.get("deleted"):
                deletes.append(item["id"])
            else:
                cal = parse_calendar_response(item)
                self.calendars_table[item["id"]] = cal.read_only
                updates.append(cal)

        return CalendarSyncResponse(deletes, updates)
Example #7
0
def calendar_response_with_update():
    return CalendarSyncResponse([], [
        Calendar(name='Super Important Meetings',
                 uid='first_calendar_uid',
                 read_only=False)
    ])