Exemple #1
0
    def open(self, *args, **kwargs):
        if self.context_preserved:
            _request_ctx_stack.pop()
            self.context_preserved = False

        kwargs.setdefault('environ_overrides', {})['inyoka._preserve_context'] = \
            self.preserve_context
        old = _request_ctx_stack.top
        try:
            return Client.open(self, *args, **kwargs)
        finally:
            self.context_preserved = _request_ctx_stack.top is not old
Exemple #2
0
    def open(self, *args, **kwargs):
        if self.context_preserved:
            _request_ctx_stack.pop()
            self.context_preserved = False

        kwargs.setdefault('environ_overrides', {})['inyoka._preserve_context'] = \
            self.preserve_context
        old = _request_ctx_stack.top
        try:
            return Client.open(self, *args, **kwargs)
        finally:
            self.context_preserved = _request_ctx_stack.top is not old
Exemple #3
0
 def __exit__(self, exc_type, exc_value, tb):
     self.preserve_context = False
     if self.context_preserved:
         _request_ctx_stack.pop()
Exemple #4
0
 def pop(self):
     """Pops the request context."""
     _request_ctx_stack.pop()
Exemple #5
0
 def __exit__(self, exc_type, exc_value, tb):
     self.preserve_context = False
     if self.context_preserved:
         _request_ctx_stack.pop()