| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/ |
Upload File : |
o
;j� � @ s* d dl Z G dd� de�ZG dd� d�ZdS )� Nc @ s e Zd ZdZdd� ZdS )�
ClassPropertyzX
Use a classmethod as a property
http://stackoverflow.com/a/1383402/1258307
c C s | j �d |�� S �N)�fget�__get__)�self�cls�owner� r �B/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/ctx.pyr
s zClassProperty.__get__N)�__name__�
__module__�__qualname__�__doc__r r r r r
r s r c @ sN e Zd ZdZe�� Zi e_dd� Ze e
dd� ��Zdd� Zdd � Z
d
d� ZdS )
�RequestContexta�
A context manager that saves some per-thread state globally.
Intended for use with Tornado's StackContext.
https://gist.github.com/simon-weber/7755289
Simply import this class into any module and access the current request handler by this
class's class method property 'current'. If it returns None, there's no active request.
.. code:: python
from raas.utils.ctx import RequestContext
current_request_handler = RequestContext.current
c C s
|| _ d S r )�_current_request)r �current_requestr r r
�__init__ s
zRequestContext.__init__c C s t | jd�si S | jjS )Nr )�hasattr�_stater )r r r r
�current s zRequestContext.currentc C s | j j| _| j| j j_d S r )� __class__r �
_prev_requestr r r �r r r r
� __enter__'