diff main.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 9d65de2ebe22
children dcf870775c26
line wrap: on
line diff
--- a/main.py	Thu Oct 16 11:49:47 2014 +0200
+++ b/main.py	Thu Oct 16 12:01:34 2014 +0200
@@ -1,32 +1,4 @@
 # -*- 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, 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("/merge/",
-                 view_func=MergeView.as_view("merge"),
-                 )
-app.add_url_rule("/",
-                 view_func=TemplateView.as_view("index", "index.html"),
-                 )
-
-
 if __name__ == "__main__":
+    from odfcast import app
     app.run()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)