Make the template directory configurable
authorPatrick Uiterwijk <puiterwijk@redhat.com>
Fri, 10 Oct 2014 18:21:25 +0000 (20:21 +0200)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Fri, 24 Oct 2014 16:03:28 +0000 (18:03 +0200)
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
examples/ipsilon.conf
ipsilon/ipsilon
templates/install/ipsilon.conf

index d1755c2..eddde2f 100644 (file)
@@ -1,5 +1,6 @@
 [global]
 debug = True
+template_dir = "templates"
 
 log.screen = True
 base.mount = "/idp"
index 9700106..681600d 100755 (executable)
@@ -60,7 +60,11 @@ admin_config = datastore.load_config()
 for option in admin_config:
     cherrypy.config[option] = admin_config[option]
 
-templates = os.path.join(cherrypy.config['base.dir'], 'templates')
+template_dir = cherrypy.config.get('template_dir', 'templates')
+if template_dir.startswith('/'):
+    templates = template_dir
+else:
+    templates = os.path.join(cherrypy.config['base.dir'], template_dir)
 template_env = Environment(loader=FileSystemLoader(templates))
 
 if __name__ == "__main__":
index 99491db..83b9704 100644 (file)
@@ -1,5 +1,6 @@
 [global]
 debug = ${debugging}
+template_dir = "templates"
 
 log.screen = ${debugging}
 base.mount = "/${instance}"