%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/utils/ |
| Current File : //proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/utils/ctx.pyc |
�
���^c @� s^ d d l m Z m Z m Z m Z d d l Z d e f d � � YZ d e f d � � YZ d S( i ( t absolute_importt with_statementt print_functiont unicode_literalsNt
ClassPropertyc B� s e Z d Z d � Z RS( uX
Use a classmethod as a property
http://stackoverflow.com/a/1383402/1258307
c C� s | j j d | � � S( N( t fgett __get__t None( t selft clst owner( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyR
s ( t __name__t
__module__t __doc__R ( ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyR s t RequestContextc B� s\ e Z d Z e j � Z i e _ d � Z e e d � � � Z
d � Z d � Z d � Z
RS( u�
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( N( t _current_request( R t current_request( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt __init__ s c C� s t | j d � s i S| j j S( Nu current_request( t hasattrt _stateR ( R ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt current# s c C� s% | j j | _ | j | j j _ d S( N( t __class__R t
_prev_requestR R R ( R ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt __enter__* s c G� s | j | j j _ | ` t S( N( R R R R t False( R t exc( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt __exit__. s c C� s | S( N( ( R ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt __call__3 s ( R R R
t threadingt localR R R R t classmethodR R R R ( ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyR s
(
t
__future__R R R R R t propertyR t objectR ( ( ( s2 /usr/lib/python2.7/site-packages/salt/utils/ctx.pyt <module> s "