Module Expr Str ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListComp AttributeLoad NameLoad attr comprehension NameStore Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
Tweens are lightweight middleware using webob.

A tween is a function that takes a :class:`morepath.Request` and returns
a :class:`morepath.Response`. A tween factory is a function that given
an application instance and tween constructs another tween that wraps it.

Used by :meth:`morepath.App.tween_factory`.

See also :class:`morepath.directive.TweenRegistry`
 toposort toposorted Info publish publish TweenRegistry N/A object N/A N/A Registry for tweens.
     __init__ N/A N/A self N/A N/A N/A N/A self _tween_infos N/A N/A register_tween_factory N/A N/A self tween_factory over under N/A N/A N/A Register a tween factory.

        :param tween_factory: a function that constructs a tween given
          a :class:`morepath.App` instance and a function that takes a
          :class:`morepath.Request` argument and returns a
          :class:`morepath.Response` (or a :class:`webob.response.Response`).
        :over: this tween factory wraps the tween created by the ``over``
          factory (possibly indirectly).
        :under: the ``under`` factory wraps the tween created by this one
          (possibly indirectly).
         N/A N/A N/A N/A self _tween_infos append N/A Info tween_factory over under N/A sorted_tween_factories N/A N/A self N/A N/A N/A Sort tween factories topologically by over and under.

        :return: a sorted list of tween infos.
         N/A N/A N/A info key N/A info N/A toposorted N/A self _tween_infos N/A wrap N/A N/A self app N/A N/A N/A Wrap app with tweens.

        This wraps :func:`morepath.publish.publish` with tweens.

        :param app: an instance of :class:`morepath.App`.
        :return: the application wrapped with tweens. This is a function
          that takes request and returns a a response.
         N/A result publish N/A tween_factory N/A reversed N/A N/A self sorted_tween_factories N/A N/A result N/A tween_factory app result N/A result N/A N/A