Commit 9077eb18 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Merge extension config into app config.

parent e4dbe7fd
......@@ -52,6 +52,9 @@ class AbstractExtension(object):
"""
raise NotImplementedError
def config(self):
return {}
def add_controller(self, controller):
"""
Mount a CherryPy controller using the extension name for path.
......@@ -294,9 +297,14 @@ class Server(object):
logger.info("load extensions")
self._load_extensions()
script_name = vispa.url.dynamic('/', encoding='utf-8')
logger.info("mount app")
self.__application = cherrypy.tree.mount(self.controller, script_name,
self.__default_mount_config)
app_config = self.__default_mount_config
# merge extension config into app config
for extension in self._extensions.values():
app_config["/extensions/" + extension.name()] = extension.config()
self.__application = cherrypy.tree.mount(self.controller, script_name, app_config)
if os.path.isfile(cherrypy_conf):
self.__application.merge(cherrypy_conf)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment