view main.py @ 19:2f627039d2b4

Add a MergeView to merge pdfs based on PyPDF2
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 29 Sep 2014 15:59:36 +0200
parents 53c7a99cabae
children c289263e1b24
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


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)