Convenience functions for callable hooks
[mediagoblin.git] / mediagoblin / app.py
index 10fbf4a3e055bccfc6fce6a32f5dc636a646aee4..bb6be4d4204366d8243ccb0a954a7db4e1604f7d 100644 (file)
@@ -21,7 +21,7 @@ from mediagoblin.routing import get_url_map
 from mediagoblin.tools.routing import endpoint_to_controller
 
 from werkzeug.wrappers import Request
-from werkzeug.exceptions import HTTPException, NotFound
+from werkzeug.exceptions import HTTPException
 from werkzeug.routing import RequestRedirect
 
 from mediagoblin import meddleware, __version__
@@ -253,4 +253,7 @@ def paste_app_factory(global_config, **app_config):
 
     mgoblin_app = MediaGoblinApp(mediagoblin_config)
 
+    for callable_hook in PluginManager().get_hook_callables('wrap_wsgi'):
+        mgoblin_app = callable_hook(mgoblin_app)
+
     return mgoblin_app