import flask
import pbc_client
import dataclasses
HTML_INDEX = """
Hello from Flask
{% for notamon in notamons %}
{{ notamon.nickname }}
{{ notamon.species_name }}
{% endfor %}
"""
@dataclasses.dataclass(frozen=True)
class Notamon:
image_src: str
effect_css: str
nickname: str
species_name: str
app = flask.Flask(__name__)
TEST_NOTAMON = Notamon(
image_src = 'https://img.pokemondb.net/sprites/ruby-sapphire/normal/mudkip.png',
effect_css = '',
nickname = 'Dude',
species_name = 'Mudkip',
)
@app.route("/")
def hello_world():
notamons = [TEST_NOTAMON for i in range(100)]
return flask.render_template_string(HTML_INDEX, notamons = notamons)