ó
 m[c           @   s•   d  d l  Z  d  d l Z d  d l Z d e f d „  ƒ  YZ e Z d d d e d d d „ Z d d d e d d d „ Z d d d e d d d „ Z
 d S(	   iÿÿÿÿNt   MatplotlibDeprecationWarningc           B   s   e  Z d  Z RS(   s•  
    A class for issuing deprecation warnings for Matplotlib users.

    In light of the fact that Python builtin DeprecationWarnings are ignored
    by default as of Python 2.7 (see link below), this class was put in to
    allow for the signaling of deprecation, but via UserWarnings which are not
    ignored by default.

    https://docs.python.org/dev/whatsnew/2.7.html#the-future-for-python-2-x
    (   t   __name__t
   __module__t   __doc__(    (    (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyR       s   
t    t	   attributec         C   s   | s | r d } q d } n  d } | r7 d | } n  | i | d 6| d 6| d 6| d 6|  d	 6| } | r{ | | 7} n  | S(
   NsA   The %(name)s %(obj_type)s will be deprecated in a future version.s>   The %(name)s %(obj_type)s was deprecated in version %(since)s.R   s    Use %s instead.t   funct   namet   alternativet   obj_typet   since(    (   R
   t   messageR   R   t   pendingR	   t   addendumt
   altmessage(    (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt   _generate_deprecation_message   s"    		c         C   s5   t  |  | | | | | ƒ } t j | t d d ƒd S(   s{  
    Used to display deprecation warning in a standard way.

    Parameters
    ----------
    since : str
        The release at which this API became deprecated.

    message : str, optional
        Override the default deprecation message.  The format
        specifier `%(name)s` may be used for the name of the function,
        and `%(alternative)s` may be used in the deprecation message
        to insert the name of an alternative to the deprecated
        function.  `%(obj_type)s` may be used to insert a friendly name
        for the type of object being deprecated.

    name : str, optional
        The name of the deprecated object.

    alternative : str, optional
        An alternative function that the user may use in place of the
        deprecated function.  The deprecation warning will tell the user
        about this alternative if provided.

    pending : bool, optional
        If True, uses a PendingDeprecationWarning instead of a
        DeprecationWarning.

    obj_type : str, optional
        The object type being deprecated.

    addendum : str, optional
        Additional text appended directly to the final message.

    Examples
    --------

        Basic example::

            # To warn of the deprecation of "matplotlib.name_of_module"
            warn_deprecated('1.4.0', name='matplotlib.name_of_module',
                            obj_type='module')

    t
   stackleveli   N(   R   t   warningst   warnt   mplDeprecation(   R
   R   R   R   R   R	   R   (    (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt   warn_deprecated9   s    /c            s"   | | | | | ‡  f d † } | S(   sN  
    Decorator to mark a function or a class as deprecated.

    Parameters
    ----------
    since : str
        The release at which this API became deprecated.  This is
        required.

    message : str, optional
        Override the default deprecation message.  The format
        specifier `%(name)s` may be used for the name of the object,
        and `%(alternative)s` may be used in the deprecation message
        to insert the name of an alternative to the deprecated
        object.  `%(obj_type)s` may be used to insert a friendly name
        for the type of object being deprecated.

    name : str, optional
        The name of the deprecated object; if not provided the name
        is automatically determined from the passed in object,
        though this is useful in the case of renamed functions, where
        the new function is just assigned to the name of the
        deprecated function.  For example::

            def new_function():
                ...
            oldFunction = new_function

    alternative : str, optional
        An alternative object that the user may use in place of the
        deprecated object.  The deprecation warning will tell the user
        about this alternative if provided.

    pending : bool, optional
        If True, uses a PendingDeprecationWarning instead of a
        DeprecationWarning.

    addendum : str, optional
        Additional text appended directly to the final message.

    Examples
    --------

        Basic example::

            @deprecated('1.4.0')
            def the_function_to_deprecate():
                pass

    c            s8  | s ˆ j  } n  t ˆ t ƒ rK d } ˆ j } ˆ j ‰  ‡ f d †  } nW d } t ˆ t ƒ r„ ˆ j ‰  ˆ  j } ‡  f d †  } n ˆ ‰  ˆ  j } ‡  f d †  } t ˆ ˆ | | | | | ƒ ‰ ‡  ‡ f d †  }	 t j	 | pá d ƒ j
 d ƒ } ˆ j
 ƒ  ‰ d	 i ˆ d
 6ˆ d 6| }
 | s+|
 d 7}
 n  | |	 |
 ƒ S(   Nt   classc            s4   y | ˆ  _  Wn t t f k
 r& n X|  ˆ  _ ˆ  S(   N(   R   t   AttributeErrort	   TypeErrort   __init__(   t   wrappert   new_doc(   t   obj(    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt   finalize®   s    	t   functionc            s(   t  j ˆ  ƒ |  ƒ }  | |  _ t |  ƒ S(   N(   t	   functoolst   wrapsR   t   classmethod(   R   R   (   R   (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyR   ½   s    	c            s"   t  j ˆ  ƒ |  ƒ }  | |  _ |  S(   N(   R   R   R   (   R   R   (   R   (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyR   Å   s    	c             s#   t  j ˆ t d d ƒˆ  |  | Ž  S(   NR   i   (   R   R   R   (   t   argst   kwargs(   R   R   (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyR   Î   s    R   s   
s,   
.. deprecated:: %(since)s
    %(message)s

R
   R   s   \ (   R   t
   isinstancet   typeR   R   R    t   __func__R   t   textwrapt   dedentt   strip(   R   R   R   R   R   R   R	   t   old_docR   R   R   (   R
   (   R   R   R   s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt	   deprecate£   s4    		
			(    (   R
   R   R   R   R   R	   R   R*   (    (   R
   s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt
   deprecatedn   s    5	:(   R   R&   R   t   UserWarningR    R   t   FalseR   R   t   NoneR+   (    (    (    s;   lib/python2.7/site-packages/matplotlib/cbook/deprecation.pyt   <module>   s    3