ó
Ýēk^c           @` s   d  d l  m Z m Z m Z d  d l m Z d  d l m Z d  d l Z d  d l	 Z	 e e
  Z d   Z d   Z e d  Z d d  Z d S(	   i    (   t   absolute_importt   divisiont   print_function(   t	   isbuiltin(   t	   getLoggerNc         ` sV   t     rI   f d   }   j | _   j | _ | j j   j  n	 t    | S(   s   This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emmitted
    when the function is used.c          ` sR   t  j d t  t  j d j   j  d t d d t  j d t    |  |   S(   Nt   alwayss   Call to deprecated {0}.t   categoryt
   stackleveli   t   default(   t   warningst   simplefiltert   DeprecationWarningt   warnt   formatt   __name__(   t   argst   kwargs(   t   func(    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   new_func   s    (   t   callableR   t   __doc__t   __dict__t   updatet   NotImplementedError(   R   R   (    (   R   s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt
   deprecated   s    	c         C` s@   t  j d t  t  j d j |   d t t  j d t  d  S(   NR   s    Import of deprecated module {0}.R   R   (   R	   R
   t   ImportWarningR   R   (   t   module_name(    (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   deprecated_import    s    c         C` s`   | r t  |   n  d d l m } | |   } x* | j D] } t t | |   | | <q9 Wd S(   s   
    Usage:
        import_and_wrap_deprecated('conda.common.connection', locals())
        # looks for conda.common.connection.__all__
    i    (   t   import_moduleN(   R   t	   importlibR   t   __all__R   t   getattr(   R   t   module_dictt   warn_importR   t   modulet   attr(    (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   import_and_wrap_deprecated'   s    c         C` sī   d   } t  |   t   } xn | p( | D]` } | j d  rD q) n  t | |  r| t | |  r| t | |  | | <q) | j |  q) W| t j |  | pĢ d  t j |  <d S(   s_   
    Usage:
        deprecate_module_with_proxy(__name__, locals())  # at bottom of module
    c         ` s&   d t  f    f d     Y} |   S(   s<   Return a wrapped object that warns about deprecated accessest   Wrapperc           ` s,   e  Z    f d    Z    f d   Z RS(   c         ` s9     d  k s |   k r, t j d |  n  t  |  S(   Ns   Property %s is deprecated(   t   NoneR	   R   R   (   t   selfR#   (   t   deprR"   (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   __getattr__?   s    c         ` s<     d  k s |   k r, t j d |  n  t  | |  S(   Ns   Property %s is deprecated(   R&   R	   R   t   setattr(   R'   R#   t   value(   R(   R"   (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   __setattr__E   s    (   R   t
   __module__R)   R,   (    (   R(   R"   (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyR%   >   s   (   t   object(   R"   R(   R%   (    (   R(   R"   s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   _ModuleProxy;   s    t   _N(
   R   t   sett
   startswithR   R   R   t   addt   syst   modulesR&   (   R   R    t   deprecated_attributesR/   t   deprst   key(    (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   deprecate_module_with_proxy6   s    	
	!(   t
   __future__R    R   R   t   inspectR   t   loggingR   R4   R	   R   t   logR   R   t   TrueR$   R&   R9   (    (    (    s?   lib/python2.7/site-packages/conda/_vendor/auxlib/deprecation.pyt   <module>   s   		