Ejemplo n.º 1
0
def gdoc(key):
    """
    Get a Google doc and parse for use in template.
    """
    context = make_context()
    file_path = 'data/%s.html' % key
    get_document(key, file_path)
    context.update(make_gdoc_context(key))
    os.remove(file_path)
    return render_template('cards/gdoc.html', **context)
Ejemplo n.º 2
0
def gdoc(key):
    """
    Get a Google doc and parse for use in template.
    """
    context = make_context()
    file_path = 'data/%s.html' % key
    get_document(key, file_path)
    context.update(make_gdoc_context(key))
    os.remove(file_path)
    return render_template('cards/gdoc.html', **context)
Ejemplo n.º 3
0
def title():
    context = make_context()

    context.update(make_gdoc_context('title'))

    context['slug'] = 'title'
    context['template'] = 'title'
    context['route'] = '/title/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL
    return render_template('cards/title.html', **context)
Ejemplo n.º 4
0
def title():
    context = make_context()

    context.update(make_gdoc_context('title'))

    context['slug'] = 'title'
    context['template'] = 'title'
    context['route'] = '/title/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL
    return render_template('cards/title.html', **context)
Ejemplo n.º 5
0
def what_happened():
    context = make_context()

    context.update(make_gdoc_context('what_happened'))

    context['slug'] = 'what-happened'
    context['template'] = 'link-roundup'
    context['route'] = '/what-happened/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/link-roundup.html', **context)
Ejemplo n.º 6
0
def get_caught_up():
    context = make_context()

    context.update(make_gdoc_context('get_caught_up'))

    context['slug'] = 'get-caught-up'
    context['template'] = 'link-roundup'
    context['route'] = '/get-caught-up/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/link-roundup.html', **context)
Ejemplo n.º 7
0
def what_happened():
    context = make_context()

    context.update(make_gdoc_context('what_happened'))

    context['slug'] = 'what-happened'
    context['template'] = 'link-roundup'
    context['route'] = '/what-happened/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/link-roundup.html', **context)
Ejemplo n.º 8
0
def get_caught_up():
    context = make_context()

    context.update(make_gdoc_context('get_caught_up'))

    context['slug'] = 'get-caught-up'
    context['template'] = 'link-roundup'
    context['route'] = '/get-caught-up/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/link-roundup.html', **context)
Ejemplo n.º 9
0
def podcast():
    """
    Render the podcast card
    """
    context = make_context()

    context.update(make_gdoc_context('podcast'))

    context['slug'] = 'podcast'
    context['template'] = 'podcast'

    return render_template('cards/podcast.html', **context)
Ejemplo n.º 10
0
def podcast():
    """
    Render the podcast card
    """
    context = make_context()

    context.update(make_gdoc_context('podcast'))

    context['slug'] = 'podcast'
    context['template'] = 'podcast'

    return render_template('cards/podcast.html', **context)
Ejemplo n.º 11
0
def live_audio():
    context = make_context()

    live_audio_state = context['COPY']['meta']['live_audio']['value']
    context.update(make_gdoc_context('live_audio'))

    pointer = m3u8.load(app_config.LIVESTREAM_POINTER_FILE)
    context['live_audio_url'] = pointer.segments[0].uri

    if live_audio_state == 'live':
        context['live'] = True
    else:
        context['live'] = False

    context['slug'] = 'live-audio'
    context['template'] = 'live-audio'
    context['route'] = '/live-audio/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/live-audio.html', **context)
Ejemplo n.º 12
0
def live_audio():
    context = make_context()

    live_audio_state = context['COPY']['meta']['live_audio']['value']
    context.update(make_gdoc_context('live_audio'))

    pointer = m3u8.load(app_config.LIVESTREAM_POINTER_FILE)
    context['live_audio_url'] = pointer.segments[0].uri

    if live_audio_state == 'live':
        context['live'] = True
    else:
        context['live'] = False

    context['slug'] = 'live-audio'
    context['template'] = 'live-audio'
    context['route'] = '/live-audio/'
    context['refresh_rate'] = app_config.LOAD_DOCS_INTERVAL

    return render_template('cards/live-audio.html', **context)