Mercurial > odfcast
view main.py @ 24:e9d8a38b0e9e
Add a LICENSE file
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Mon, 29 Sep 2014 16:17:13 +0200 |
parents | 709edf15f90e |
children | 9d65de2ebe22 |
line wrap: on
line source
# -*- coding: utf-8 -*- import logging from flask import Flask app = Flask(__name__) app.config.from_object('odfcast.settings') app.config.from_envvar('ODFCAST_SETTINGS', silent=True) if app.config["DEBUG"]: logging.basicConfig(level=logging.DEBUG) from odfcast.convert import ConvertView, TemplateConvertView, MergeView, \ TemplateView app.add_url_rule("/convert/", view_func=ConvertView.as_view( "convert", app.config["PY3O_UNO_DRIVER"], app.config["PY3O_UNO_SERVER_HOSTNAME"], app.config["PY3O_UNO_SERVER_PORT"], )) app.add_url_rule("/template/", view_func=TemplateConvertView.as_view( "template", app.config["PY3O_UNO_DRIVER"], app.config["PY3O_UNO_SERVER_HOSTNAME"], app.config["PY3O_UNO_SERVER_PORT"], )) app.add_url_rule("/merge/", view_func=MergeView.as_view("merge"), ) app.add_url_rule("/", view_func=TemplateView.as_view("index", "index.html"), ) if __name__ == "__main__": app.run()