# HG changeset patch # User Teemu Piippo # Date 1497104451 -10800 # Node ID e18ad36fbbf52c5e6305591fa5cd23744e6dab89 # Parent 843c6ee340e72d6b3f124e8334320b669318f1cc Lisätty favicon, korjattu tr()-funktio joka ei olettunut suomen kieleen (vaan kääntämättömään) diff -r 843c6ee340e7 -r e18ad36fbbf5 service.py --- a/service.py Sat Jun 10 17:00:53 2017 +0300 +++ b/service.py Sat Jun 10 17:20:51 2017 +0300 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -from flask import Flask, render_template, abort +from flask import Flask, render_template, abort, send_from_directory from datetime import datetime, date, time, timedelta from os import path, listdir from configparser import ConfigParser @@ -42,7 +42,7 @@ if request.args.get(language_name) is not None: return language_name else: - return None + return 'fi' @app.route('/pysäkki/') def pysäkkiaikataulu(tunniste): @@ -114,6 +114,10 @@ yö = yö(datetime.combine(tänään(), time()) + ajovuoro.reitti[-1].saapumisaika), ) +@app.route('/static/') +def static_file(path): + return send_from_directory(path.join('static', path)) + if __name__ == '__main__': from argparse import ArgumentParser parser = ArgumentParser() diff -r 843c6ee340e7 -r e18ad36fbbf5 static/favicon.png Binary file static/favicon.png has changed diff -r 843c6ee340e7 -r e18ad36fbbf5 templates/ajovuoro-suppea.html --- a/templates/ajovuoro-suppea.html Sat Jun 10 17:00:53 2017 +0300 +++ b/templates/ajovuoro-suppea.html Sat Jun 10 17:20:51 2017 +0300 @@ -1,5 +1,6 @@ +