ó
ĐH/\c           @` sď   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d d d g Z d	 e e  j	 f d
     YZ
 e
   Z d a d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d l m Z e e   d  d S(   s"   
Maintains the thread local hub.

i    (   t   absolute_import(   t   division(   t   print_function(   t   thread_mod_namet   get_hubt   get_hub_noargst   get_hub_if_existst   _Threadlocalc           B` s   e  Z d    Z RS(   c         C` s2   t  t |   j   d  |  _ d  |  _ d  |  _ d  S(   N(   t   superR   t   __init__t   Nonet   Hubt   loopt   hub(   t   self(    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyR	      s    		(   t   __name__t
   __module__R	   (    (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyR      s   c          C` s)   t  j }  |  d k r% t }  t  _ n  |  S(   s   Return the type of hub to use for the current thread.

    If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.
    N(   t   _threadlocalR   R
   (   t   hubtype(    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   get_hub_class(   s    	c         C` s
   |  a  d  S(   N(   R   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   set_default_hub_class2   s    c          O` s;   t  j } | d k r7 t   } | |  |   } t  _ n  | S(   sÜ  
    Return the hub for the current thread.

    If a hub does not exist in the current thread, a new one is
    created of the type returned by :func:`get_hub_class`.

    .. deprecated:: 1.3b1
       The ``*args`` and ``**kwargs`` arguments are deprecated. They were
       only used when the hub was created, and so were non-deterministic---to be
       sure they were used, *all* callers had to pass them, or they were order-dependent.
       Use ``set_hub`` instead.
    N(   R   R   R
   R   (   t   argst   kwargsR   R   (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyR   6   s
    		c          C` s5   t  j }  |  d  k r1 t   } |   }  t  _ n  |  S(   N(   R   R   R
   R   (   R   R   (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyR   I   s
    		c           C` s   t  j S(   s`   Return the hub for the current thread.

    Return ``None`` if no hub has been created yet.
    (   R   R   (    (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyR   S   s    c         C` s   |  t  _ d  S(   N(   R   R   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   set_hub[   s    c           C` s   t  j S(   N(   R   R   (    (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   get_loop^   s    c         C` s   |  t  _ d  S(   N(   R   R   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   set_loopa   s    (   t   import_c_accels   gevent.__hub_localN(   t   __doc__t
   __future__R    R   R   t   gevent._compatR   t   __all__t
   __import__t   _localR   R   R
   R   R   R   R   R   R   R   R   R   t   gevent._utilR   t   globals(    (    (    s0   lib/python2.7/site-packages/gevent/_hub_local.pyt   <module>   s(   			
			
				