Beispiel #1
0
def _get_events(cal_id, time_min, time_max):
    """
    Retrieve events from the Google API

    @param cal_id: str, calendar id
    @param time_min: datetime, from time
    @param time_max: datetime, to time
    @return: list(events)
    """
    params = dict(
        calendarId=cal_id,
        singleEvents=True,
        timeMin=time_min.isoformat('T') + 'Z',
        timeMax=time_max.isoformat('T') + 'Z',
        )

    return get_all_items(service.events(), params, decorator.http())
def _get_calendar_list():
    params = dict()
    return get_all_items(service.calendarList(), params, decorator.http())