Mercurial > odfcast
comparison main.py @ 6:7f546e8a6e7a
Add url mapping for TemplateConvertView
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 26 Sep 2014 15:36:30 +0200 |
parents | 4a34f72f036b |
children | 53c7a99cabae |
comparison
equal
deleted
inserted
replaced
5:f804af69b783 | 6:7f546e8a6e7a |
---|---|
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 from flask import Flask | 3 from flask import Flask |
4 | 4 |
5 from odfcast.convert import ConvertView | 5 from odfcast.convert import ConvertView, TemplateConvertView |
6 | 6 |
7 app = Flask(__name__) | 7 app = Flask(__name__) |
8 app.config.from_object('odfcast.settings') | 8 app.config.from_object('odfcast.settings') |
9 app.config.from_envvar('ODFCAST_SETTINGS', silent=True) | 9 app.config.from_envvar('ODFCAST_SETTINGS', silent=True) |
10 | 10 |
14 "convert", | 14 "convert", |
15 app.config["PY3O_UNO_DRIVER"], | 15 app.config["PY3O_UNO_DRIVER"], |
16 app.config["PY3O_UNO_SERVER_HOSTNAME"], | 16 app.config["PY3O_UNO_SERVER_HOSTNAME"], |
17 app.config["PY3O_UNO_SERVER_PORT"], | 17 app.config["PY3O_UNO_SERVER_PORT"], |
18 )) | 18 )) |
19 app.add_url_rule("/template/", | |
20 view_func=TemplateConvertView.as_view( | |
21 "template", | |
22 app.config["PY3O_UNO_DRIVER"], | |
23 app.config["PY3O_UNO_SERVER_HOSTNAME"], | |
24 app.config["PY3O_UNO_SERVER_PORT"], | |
25 )) | |
19 | 26 |
20 if __name__ == "__main__": | 27 if __name__ == "__main__": |
21 app.run() | 28 app.run() |