๓
ะH/\c           @` s=  d  Z  d d l m Z m Z m Z d d l m Z d d l m Z d e	 f d     YZ
 e
   Z
 d e d d e d
  Z d   Z d e	 f d     YZ d e	 f d     YZ d   Z y4 d d l m Z d d l m Z d d l m Z Wn9 e k
 r&d e	 f d     YZ d   Z d   Z n Xe Z e Z e Z d S(   s2   
internal gevent utilities, not for external use.
i    (   t   print_functiont   absolute_importt   division(   t   update_wrapper(   t	   iteritemst   _NONEc           B` s   e  Z d  Z d Z d   Z RS(   sภ   
    A special object you must never pass to any gevent API.
    Used as a marker object for keyword arguments that cannot have the
    builtin None (because that might be a valid value).
    c         C` s   d S(   Ns   <default value>(    (   t   self(    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   __repr__   s    (    (   t   __name__t
   __module__t   __doc__t	   __slots__R   (    (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR      s   t   __implements__t   __all__t   __imports__c         ` s้   | r> | r%   f d   | D } qM   f d   | D } n t    j  } g  } xp | D]h \ }	 }
 |
 t k rx qZ n  |	 | k r qZ n  |	 j d  rซ |	 | k rซ qZ n  |
 | |	 <| j |	  qZ W| rๅ d | k rๅ | d =qๅ n  | S(   sา  
    Copy attributes defined in ``source.__dict__`` to the dictionary
    in globs (which should be the caller's :func:`globals`).

    Names that start with ``__`` are ignored (unless they are in
    *dunder_names_to_keep*). Anything found in *names_to_ignore* is
    also ignored.

    If *only_names* is given, only those attributes will be
    considered. In this case, *ignore_missing_names* says whether or
    not to raise an :exc:`AttributeError` if one of those names can't
    be found.

    If *cleanup_globs* has a true value, then common things imported but
    not used at runtime are removed, including this function.

    Returns a list of the names copied; this should be assigned to ``__imports__``.
    c         3` s'   |  ] } | t    | t  f Vq d  S(   N(   t   getattrR   (   t   .0t   k(   t   source(    s+   lib/python2.7/site-packages/gevent/_util.pys	   <genexpr>5   s    c         3` s$   |  ] } | t    |  f Vq d  S(   N(   R   (   R   R   (   R   (    s+   lib/python2.7/site-packages/gevent/_util.pys	   <genexpr>7   s    t   __t   copy_globals(   R   t   __dict__R   t
   startswitht   append(   R   t   globst
   only_namest   ignore_missing_namest   names_to_ignoret   dunder_names_to_keept   cleanup_globst   itemst   copiedt   keyt   value(    (   R   s+   lib/python2.7/site-packages/gevent/_util.pyR      s&    
c         C` sพ   |  j  d  } | s" | | k r& d Sd d l m } | r@ d Sd d l } d d l } | j   $ | j d t  | j |  } Wd QX|  j	   |  j
 | j  d |  k rบ |  d =n  d S(   sM   
    Import the C-accelerator for the __name__
    and copy its globals.
    R   Ni    (   t   PURE_PYTHONt   ignoret   import_c_accel(   t   gett   gevent._compatR"   t	   importlibt   warningst   catch_warningst   simplefiltert   ImportWarningt   import_modulet   cleart   updateR   (   R   t   cnamet   nameR"   R'   R(   t   mod(    (    s+   lib/python2.7/site-packages/gevent/_util.pyR$   L   s    
t   Lazyc           B` s    e  Z d  Z d   Z d   Z RS(   sึ   
    A non-data descriptor used just like @property. The
    difference is the function value is assigned to the instance
    dict the first time it is accessed and then the function is never
    called agoin.
    c         C` s#   | | j  f |  _ t |  |  d  S(   N(   R   t   dataR   (   R   t   func(    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   __init__|   s    c         C` s<   | d  k r |  S|  j \ } } | |  } | | j | <| S(   N(   t   NoneR3   R   (   R   t   instt   class_R4   R0   R!   (    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   __get__   s    (   R   R	   R
   R5   R9   (    (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR2   u   s   	t   readpropertyc           B` s    e  Z d  Z d   Z d   Z RS(   sฤ   
    A non-data descriptor like @property. The difference is that
    when the property is assigned to, it is cached in the instance
    and the function is not called on that instance again.
    c         C` s   | |  _  t |  |  d  S(   N(   R4   R   (   R   R4   (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR5      s    	c         C` s   | d  k r |  S|  j |  S(   N(   R6   R4   (   R   R7   R8   (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR9      s    (   R   R	   R
   R5   R9   (    (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR:      s   	c          C` s"   d d l  }  |  j d |  j    S(   sA   
    Returns the current time as a string in RFC3339 format.
    i    Ns   %Y-%m-%dT%H:%M:%SZ(   t   timet   strftimet   gmtime(   R;   (    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   gmctime   s    (   t	   Interface(   t   implementer(   t	   AttributeR?   c           B` s   e  Z RS(    (   R   R	   (    (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR?   ฆ   s   c         C` s   d   } | S(   Nc         S` s   |  S(   N(    (   t   c(    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   decฉ   s    (    (   t   _ifaceRC   (    (    s+   lib/python2.7/site-packages/gevent/_util.pyR@   จ   s    	c         C` s   |  S(   N(    (   t   s(    (    s+   lib/python2.7/site-packages/gevent/_util.pyRA   ญ   s    N(    (   R   R   R   (   R
   t
   __future__R    R   R   t	   functoolsR   R&   R   t   objectR   R6   t   Falset   TrueR   R$   R2   R:   R>   t   zope.interfaceR?   R@   RA   t   ImportError(    (    (    s+   lib/python2.7/site-packages/gevent/_util.pyt   <module>   s2   	,	)		