galaxy.webapps package

Galaxy webapps root package – this is a namespace package.

Subpackages

Submodules

galaxy.webapps.util module

exception galaxy.webapps.util.MiddlewareWrapUnsupported[source]

Bases: Exception

galaxy.webapps.util.build_template_error_formatters()[source]

Build a list of template error formatters for WebError. When an error occurs, WebError pass the exception to each function in this list until one returns a value, which will be displayed on the error page.

galaxy.webapps.util.wrap_if_allowed_or_fail(app, stack, wrap, name=None, args=None, kwargs=None)[source]

Wrap the application with the given method if the application stack allows for it.

Arguments are the same as for wrap_if_allowed().

Raises py:class:MiddlewareWrapUnsupported if the stack does not allow the middleware.

galaxy.webapps.util.wrap_if_allowed(app, stack, wrap, name=None, args=None, kwargs=None)[source]

Wrap the application with the given method if the application stack allows for it.

Parameters:
  • app (galaxy.webapps.base.webapp.WebApplication subclass) – application to wrap

  • stack (galaxy.web_stack.ApplicationStack subclass) – instance of application stack implementing allowed_middleware() method

  • wrap (types.FunctionType or types.LambdaType) – function to wrap application with

  • name (str) – alternative wrap function name for logging purposes (wrap.__name__ if None)

  • args (list) – arguments to pass to wrap (not including app itself)

  • kwargs (dict) – keyword arguments to pass to wrap

Returns app unmodified if the stack does not allow the middleware.