Пример #1
0
def list_times(service):
    """
    Lists the times from the selected calendar in ascending order.
    :param service: a google 'service' object
    :return: busy is a sorted list of busy times and free is a sorted list of
    free times for the selected calendar(s)
    """
    app.logger.debug('Entering list_times')

    events = get_events(service)
    busy = get_busy_times(events)

    return busy
Пример #2
0
def list_times(service):
    """
    Lists the times from the selected calendar in ascending order.
    :param service: a google 'service' object
    :return: busy is a sorted list of busy times and free is a sorted list of
    free times for the selected calendar(s)
    """
    app.logger.debug('Entering list_times')

    print('begin {}'.format(flask.session['begin_date']))
    print('end {}'.format(flask.session['end_date']))

    events = get_events(service)
    busy = get_busy_times(events)
    free = get_free_times(busy, flask.session["begin_date"],
                          flask.session['end_date'])

    return busy, free
Пример #3
0
def list_times(service):
    """
    Lists the times from the selected calendar in ascending order.
    :param service: a google 'service' object
    :return: busy is a sorted list of busy times and free is a sorted list of
    free times for the selected calendar(s)
    """
    app.logger.debug("Entering list_times")

    events = get_events(service)

    busy = get_busy_times(events)
    add_times_db(busy)

    if flask.session["main-page"] == "add-times.html":
        busy_dict = get_times_db()
        busy = get_busy_times(busy_dict)

    free = get_free_times(busy, flask.session["begin_date"], flask.session["end_date"])

    return busy, free