src/pyams_utils/wsgi.py
changeset 72 9049384a2bd4
parent 1 3f89629b9e54
child 292 b338586588ad
equal deleted inserted replaced
71:01d01045a2b7 72:9049384a2bd4
    20 
    20 
    21 
    21 
    22 def wsgi_environ_cache(*names):
    22 def wsgi_environ_cache(*names):
    23     """Wrap a function/method to cache its result for call into request.environ
    23     """Wrap a function/method to cache its result for call into request.environ
    24 
    24 
    25     :param list[string] names: keys to cache into environ, the len(names) must
    25     :param [string...] names: keys to cache into environ; len(names) must
    26     be equal to the result's length or scalar
    26         be equal to the result's length or scalar
    27     :return:
       
    28     """
    27     """
    29     def decorator(fn):
    28     def decorator(fn):
    30         def function_wrapper(self, request):
    29         def function_wrapper(self, request):
    31             scalar = len(names) == 1
    30             scalar = len(names) == 1
    32             try:
    31             try: