1
"""Decorator internal utilities"""
3
from pylons.controllers import WSGIController
5
def get_pylons(decorator_args):
6
"""Return the `pylons` object: either the :mod`~pylons` module or
7
the :attr:`~WSGIController._py_object` equivalent, searching a
8
decorator's *args for the latter
10
:attr:`~WSGIController._py_object` is more efficient as it provides
11
direct access to the Pylons global variables.
14
controller = decorator_args[0]
15
if isinstance(controller, WSGIController):
16
return controller._py_object