X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/raven/utils
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
raven
/
utils
/
??
..
??
__init__.py
(3.14 KB)
??
__pycache__
??
basic.py
(2.39 KB)
??
compat.py
(5.54 KB)
??
conf.py
(2.29 KB)
??
encoding.py
(3.23 KB)
??
http.py
(1.95 KB)
??
imports.py
(404 B)
??
json.py
(2.91 KB)
??
serializer
??
ssl_match_hostname.py
(3.51 KB)
??
stacks.py
(9.8 KB)
??
testutils.py
(697 B)
??
transaction.py
(1.06 KB)
??
urlparse.py
(476 B)
??
wsgi.py
(3.64 KB)
Editing: transaction.py
from __future__ import absolute_import from threading import local class TransactionContext(object): def __init__(self, stack, context): self.stack = stack self.context = context def __enter__(self): self.stack.push(self.context) return self def __exit__(self, *exc_info): self.stack.pop(self.context) class TransactionStack(local): def __init__(self): self.stack = [] def __len__(self): return len(self.stack) def __iter__(self): return iter(self.stack) def __call__(self, context): return TransactionContext(self, context) def clear(self): self.stack = [] def peek(self): try: return self.stack[-1] except IndexError: return None def push(self, context): self.stack.append(context) return context def pop(self, context=None): if context is None: return self.stack.pop() while self.stack: if self.stack.pop() is context: return context
Upload File
Create Folder