Ejemplo n.º 1
0
def index():
    # example_data is to show how to use params in index.html jinja2 template
    example_data = {
        'key1': 'keykey1',
        'value2': 'valval2',
        'list': ['something3', 'something4', 'something5']
    }
    return respond('index.html', params={'data': example_data})
Ejemplo n.º 2
0
def index():
    rick_roll = RickRoll()
    rick_roll.ip = request.environ.get('REMOTE_ADDR')
    rick_roll.put()
    rick_rolls_list = get_rick_rolls_list()
    return respond('rick_rolls.html',
                   params={
                       'count': len(rick_rolls_list),
                       'data': rick_rolls_list
                   })
Ejemplo n.º 3
0
def view_game(game_id):
    game = game_parser.get_game(game_id)
    datedict = game_parser.extract_date(game_id)

    return respond(
        'view-game.html',
        {
            'home': game['home']['name'],
            'away': game['away']['name'],
            'day': datedict['day'],
            'month': datedict['month'],
            'year': datedict['year'],
            'game_data': game,
            'game_id': game_id
        }
    )
Ejemplo n.º 4
0
def home(games=None):
    today = bottle.request.forms.get('date')
    if today is not None:
        year, month, day = today.split('-')
    else:
        today = datetime.now(pytz.utc)
        tz = 'US/Pacific'
        today = today.astimezone(pytz.timezone(tz))
        day = str(today.day).zfill(2)
        month = str(today.month).zfill(2)
        year = today.year

    return respond(
        'index.html',
        {
            'games': game_parser.list_games({'day': day, 'year': year, 'month': month}),
            'day': day,
            'month': month,
            'year': year
        }
    )
Ejemplo n.º 5
0
def error404(code):
    return respond('404.html')
Ejemplo n.º 6
0
def error403(code):
    return respond('403.html')
Ejemplo n.º 7
0
def test_index_doesnt_crash_without_params():
    resp = respond('index.html', {})
    assert_true('bootstrap' in resp)
Ejemplo n.º 8
0
def error404(code):
    return respond('404.html')
Ejemplo n.º 9
0
def error403(code):
    return respond('403.html')
Ejemplo n.º 10
0
def index():
    # example_data is to show how to use params in index.html jinja2 template
    example_data = {'key1': 'keykey1', 'value2': 'valval2',
                    'list': ['something3', 'something4', 'something5']}
    return respond('index.html', params={'data': example_data})
Ejemplo n.º 11
0
def get_beer():
    beer_list = get_beer_list()
    return respond('beer.html', params={'data': beer_list})