Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
import traceback
from collections import OrderedDict

Expand All @@ -8,6 +9,8 @@

app = Flask(__name__)

COMMIT = os.environ.get("HEROKU_BUILD_COMMIT", "")

mf2py.Parser.user_agent = "python.microformats.io (mf2py/" + mf2py.__version__ + ") Mozilla/5.0 Chrome/29.0.1547.57 Safari/537.36"
mf2py.Parser.dict_class = OrderedDict

Expand Down Expand Up @@ -50,7 +53,11 @@ def fetch_mf2(url):
response.headers["Content-Type"] = "application/json"
return response

return render_template("index.jinja2", mf2py_version=mf2py.__version__)
return render_template(
"index.jinja2",
mf2py_version=mf2py.__version__,
commit=COMMIT,
)
except BaseException as e:
traceback.print_exc()
return jsonify(error="%s: %s" % (type(e).__name__, e)), 400
Expand Down
1 change: 1 addition & 0 deletions templates/index.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
</li>
</ul>
</footer>
{% if commit %}<!-- commit: {{ commit }} -->{% endif %}

</main>
</body>
Expand Down