26 lines
545 B
Python
26 lines
545 B
Python
from bottle import route, run, template, static_file
|
|
|
|
tpl = """
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>{{ image }}</title>
|
|
<meta http-equiv="refresh" content="30">
|
|
</head>
|
|
<body>
|
|
<img src="/results/{{ image }}" alt="My Image">
|
|
</body>
|
|
</html>
|
|
"""
|
|
|
|
@route('/<scene>/<char_name>/')
|
|
def index(scene, char_name):
|
|
image = f"{char_name}-{scene}.png"
|
|
return template(tpl, image=image)
|
|
|
|
@route('/results/<filename>')
|
|
def server_static(filename):
|
|
return static_file(filename, root='results')
|
|
|
|
run(host='0.0.0.0', port=8080)
|