Mercurial > odfcast > odfcast
comparison odfcast/__init__.py @ 37:5c3aba401382
Move templates and static directories to odfcast
With this change odfast can also be run from an installed module
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 16 Oct 2014 12:01:34 +0200 |
parents | 4a34f72f036b |
children | 4b78fe544b09 |
comparison
equal
deleted
inserted
replaced
36:3e83888fb8d8 | 37:5c3aba401382 |
---|---|
1 # -*- coding: utf-8 -*- | |
2 | |
3 import logging | |
4 | |
5 from flask import Flask | |
6 | |
7 app = Flask(__name__) | |
8 app.config.from_object('odfcast.settings') | |
9 app.config.from_envvar('ODFCAST_SETTINGS', silent=True) | |
10 | |
11 if app.config["DEBUG"]: | |
12 logging.basicConfig(level=logging.DEBUG) | |
13 | |
14 from odfcast.convert import ConvertView, MergeView, TemplateView | |
15 | |
16 | |
17 app.add_url_rule("/convert/", | |
18 view_func=ConvertView.as_view( | |
19 "convert", | |
20 app.config["PY3O_UNO_DRIVER"], | |
21 app.config["PY3O_UNO_SERVER_HOSTNAME"], | |
22 app.config["PY3O_UNO_SERVER_PORT"], | |
23 )) | |
24 app.add_url_rule("/merge/", | |
25 view_func=MergeView.as_view("merge"), | |
26 ) | |
27 app.add_url_rule("/", | |
28 view_func=TemplateView.as_view("index", "index.html"), | |
29 ) |