# HG changeset patch # User Björn Ricks # Date 1411992175 -7200 # Node ID f4920ab1d27cb7e8285e8ebf6830f5308cc2d557 # Parent d2fb4862adb82676150a03674bbfe9ebb7eba230 Add basic html interface for convert This allow testing the code via the browser diff -r d2fb4862adb8 -r f4920ab1d27c odfcast/convert.py --- a/odfcast/convert.py Fri Sep 26 20:18:35 2014 +0200 +++ b/odfcast/convert.py Mon Sep 29 14:02:55 2014 +0200 @@ -2,7 +2,7 @@ import tempfile -from flask import request, Response, json +from flask import request, Response, json, render_template from flask.views import MethodView from py3o.template import Template @@ -45,6 +45,9 @@ mimetype = self.get_mimetype_for_format(fformat) return Response(outfile, mimetype=mimetype) + def get(self): + return render_template("convert.html") + def save_form_file(self, infile): outfile = tempfile.NamedTemporaryFile() infile.save(outfile.name) diff -r d2fb4862adb8 -r f4920ab1d27c templates/base.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/base.html Mon Sep 29 14:02:55 2014 +0200 @@ -0,0 +1,11 @@ + + + + {% block title %}odfcast{% endblock %} + + +
+ {% block content %}{% endblock %} +
+ + diff -r d2fb4862adb8 -r f4920ab1d27c templates/convert.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/convert.html Mon Sep 29 14:02:55 2014 +0200 @@ -0,0 +1,15 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+ + +
+
+ + +
+ +
+{% endblock %}