view main.py @ 7:c04edbd52967

Allow castclient to do template variable substition via a json file
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 26 Sep 2014 15:36:58 +0200
parents 7f546e8a6e7a
children 53c7a99cabae
line wrap: on
line source
# -*- coding: utf-8 -*-

from flask import Flask

from odfcast.convert import ConvertView, TemplateConvertView

app = Flask(__name__)
app.config.from_object('odfcast.settings')
app.config.from_envvar('ODFCAST_SETTINGS', silent=True)


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"],
                 ))

if __name__ == "__main__":
    app.run()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)