def acquire_context(self):
        """
        Inspect the stack to acquire the current context used,
        to render the placeholder. I'm really sorry for this,
        but if you have a better way, you are welcome !
        """
        frame = None
        request = None

        try:
            for f in inspect.stack()[1:]:
                frame = f[0]
                args, varargs, keywords, alocals = inspect.getargvalues(frame)
                if not request and 'request' in args:
                    request = alocals['request']
                if 'context' in args:
                    return alocals['context']
        finally:
            del frame

        return RequestContext(request)
def acquire_context ( self ) : frame = None request = None try : for f in inspect . stack ( ) [ 1 : ] : frame = f [ 0 ] args , varargs , keywords , alocals = inspect . getargvalues ( frame ) if not request and 'request' in args : request = alocals [ 'request' ] if 'context' in args : return alocals [ 'context' ] finally : del frame return RequestContext ( request )
Inspect the stack to acquire the current context used,
        to render the placeholder. I'm really sorry for this,
        but if you have a better way, you are welcome !