§
    cÌc™6  ã                   óª   — d Z g d¢ZddlZddlma ddlZdZd„ Zd„ Zd„ Zd	„ Z	d
„ Z
d„ Zd„ Zd„ Zd„ Z G d„ de¦  «        Z	 dd„Zd„ Zd„ Zdd„Zdd„ZdS )zESymbol versioning

The methods here allow for api symbol versioning.
)Údeprecated_functionÚdeprecated_inÚdeprecated_listÚdeprecated_methodÚDEPRECATED_PARAMETERÚdeprecated_passedÚset_warning_methodÚwarné    N©r	   zA deprecated parameter marker.c                 ó0   — dt          j        | ¦  «        z  S )z�Generate a message that something was deprecated in a release.

    >>> deprecated_in((1, 4, 0))
    '%s was deprecated in version 1.4.0.'
    z!%%s was deprecated in version %s.)ÚbreezyÚ_format_version_tuple)Úversion_tuples    ú:/usr/lib/python3/dist-packages/breezy/symbol_versioning.pyr   r   +   s   € ð 0ÝÔ*¨=Ñ9Ô9ñ:ð ;ó    c                 ó
   — | a dS )z‚Set the warning method to be used by this module.

    It should take a message and a warning category as warnings.warn does.
    Nr   )Úmethods    r   r   r   5   s   € ð €D€D€Dr   c                 óZ  — t          | dd¦  «        �;d                     | j        j        j        | j        j        j        | j        ¦  «        }n[t          | dd¦  «        �*d| j        vr!d                     | j        | j        ¦  «        }n d                     | j        | j        ¦  «        }||z  S )ao  Generate an automatic deprecation string for a_callable.

    :param a_callable: The callable to substitute into deprecation_version.
    :param deprecation_version: A deprecation format warning string. This
        should have a single %s operator in it. a_callable will be turned into
        a nice python symbol and then substituted into deprecation_version.
    Ú__self__Nú{}.{}.{}Ú__qualname__ú<ú{}.{})ÚgetattrÚformatr   Ú	__class__Ú
__module__Ú__name__r   )Ú
a_callableÚdeprecation_versionÚsymbols      r   Údeprecation_stringr"   D   s¶   € õ ˆz˜: tÑ,Ô,Ð8Ø×"Ò" :Ô#6Ô#@Ô#KØ)Ô2Ô<ÔEØ)Ô2ñ4ô 4ˆˆõ 
�˜^¨TÑ	2Ô	2Ð	>À3ÈjÔNeÐCeÐCeØ—’ 
Ô 5Ø&Ô3ñ5ô 5ˆˆð —’ 
Ô 5Ø&Ô/ñ1ô 1ˆà Ñ'Ð'r   c                 ó   ‡ — ˆ fd„}|S )z=Decorate a function so that use of it will trigger a warning.c                 ó:   •‡ — ˆ ˆfd„}t          ‰ ‰d|¦  «         |S )ú<This is the function python calls to perform the decoration.c                  ó–   •— ddl m} |                     dd¦  «         t          t	          ‰‰¦  «        t
          d¬¦  «          ‰| i |¤ŽS )zThis is the decorated function.é   ©Útraceé   zDeprecated function calledé   ©Ú
stacklevel)Ú r)   Úmutter_callsiter	   r"   ÚDeprecationWarning)ÚargsÚkwargsr)   Úcallabler    s      €€r   Údecorated_functionzKdeprecated_function.<locals>.function_decorator.<locals>.decorated_function_   sk   ø€ àÐÐÐÐÐØ×!Ò! !Ð%AÑBÔBÐBÝÕ# HÐ.AÑBÔBÝ#°ð3ñ 3ô 3ð 3à�8˜TÐ, VÐ,Ð,Ð,r   Úfunction©Ú_populate_decorated)r3   r4   r    s   ` €r   Úfunction_decoratorz/deprecated_function.<locals>.function_decorator\   sF   øø€ ð	-ð 	-ð 	-ð 	-ð 	-ð 	-õ 	˜HÐ&9¸:Ø.ñ	0ô 	0ð 	0à!Ð!r   © )r    r8   s   ` r   r   r   Y   s$   ø€ ð"ð "ð "ð "ð "ð Ðr   c                 ó   ‡ — ˆ fd„}|S )zêDecorate a method so that use of it will trigger a warning.

    To deprecate a static or class method, use

        @staticmethod
        @deprecated_function
        def ...

    To deprecate an entire class, decorate __init__.
    c                 ó:   •‡ — ˆ ˆfd„}t          ‰ ‰d|¦  «         |S )r%   c                 óT  •— ddl m} ‰j        dk    r+d                     | j        j        | j        j        ¦  «        }n0d                     | j        j        | j        j        ‰j        ¦  «        }|                     dd¦  «         t          ‰|z  t          d¬	¦  «          ‰| g|¢R i |¤ŽS )
zThis is the decorated method.r'   r(   Ú__init__r   r   r*   zDeprecated method calledr+   r,   )	r.   r)   r   r   r   r   r/   r	   r0   )Úselfr1   r2   r)   r!   r3   r    s        €€r   Údecorated_methodzEdeprecated_method.<locals>.method_decorator.<locals>.decorated_method{   sÓ   ø€ àÐÐÐÐÐØÔ  JÒ.Ð.Ø Ÿš¨¬Ô(AØ$(¤NÔ$;ñ&ô &��ð $×*Ò*¨4¬>Ô+DØ'+¤~Ô'>Ø'/Ô'8ñ)ô )�ð ×!Ò! !Ð%?Ñ@Ô@Ð@ÝÐ$ØñÝ+¸ð;ñ ;ô ;ð ;à�8˜DÐ2 4Ð2Ð2Ð2¨6Ð2Ð2Ð2r   r   r6   )r3   r?   r    s   ` €r   Úmethod_decoratorz+deprecated_method.<locals>.method_decoratorx   sF   øø€ ð	3ð 	3ð 	3ð 	3ð 	3ð 	3õ  	˜HÐ&9¸8Ø,ñ	.ô 	.ð 	.àÐr   r9   )r    r@   s   ` r   r   r   l   s$   ø€ ð ð  ð  ð  ð  ð, Ðr   c                 ó   — | t           uS )z(Return True if parameter_value was used.)r   )Úparameter_values    r   r   r   ‘   s   € ð  Õ"6Ð6Ð6r   c                 ó€  — | j         r| j                              d¦  «        }ng }t          |¦  «        dk    r|d|z   z  |_         d S t          |¦  «        dk    r | j         dz   dz   |d|z   z  z   dz   |_         d S t          |d         ¦  «        }| j         }|dd|z  z   z  }||d|z   z  z  }|dd|z  z   z  }||_         d S )Nú
r
   zThis r'   éÿÿÿÿú )Ú__doc__ÚsplitÚlen)r3   r    ÚlabelÚdecorated_callableÚdocstring_linesÚspacesÚnew_docs          r   Ú_decorate_docstringrO   ¤   s  € àÔð Ø"Ô*×0Ò0°Ñ6Ô6ˆˆàˆÝ
ˆ?ÑÔ˜qÒ Ð Ø%8¸GÀe¹OÑ%LÐÔ"Ð"Ð"Ý	ˆ_Ñ	Ô	 Ò	"Ð	"àÔ˜tÑ# dÑ*Ø 7¨U¡?Ñ3ñ4Ø6:ñ;ð 	Ô"Ð"Ð"õ �_ RÔ(Ñ)Ô)ˆØÔ"ˆØ�4˜# ™,Ñ&Ñ&ˆØÐ&¨'°E©/Ñ:Ñ:ˆØ�4˜# ™,Ñ&Ñ&ˆØ%,ÐÔ"Ð"Ð"r   c                 óh   — t          | |||¦  «         | j        |_        | j        |_        d|_        dS )zMPopulate attributes like __name__ and __doc__ on the decorated callable.
    TN)rO   r   r   Úis_deprecated)r3   r    rJ   rK   s       r   r7   r7   ¹   sG   € õ ˜Ð"5°uØ*ñ,ô ,ð ,à$,Ô$7ÐÔ!Ø"*Ô"3ÐÔØ'+ÐÔ$Ð$Ð$r   c                 ó   ‡ — ˆ fd„}|S )z?Returns a closure that emits a warning and calls the superclassc                 ó¼   •— d                      | j        ¦  «        }| j        |fz  }| j        r|d| j        z   z  }t	          |t
          d¬¦  «          ‰| g|¢R i |¤ŽS )Nzaccess to {}rF   r+   r,   )r   Ú_variable_nameÚ_deprecation_versionÚ_advicer	   r0   )Údep_dictr1   r2   ÚmsgÚwrapped_methods       €r   Úcbz%_dict_deprecation_wrapper.<locals>.cbÆ   s{   ø€ Ø×#Ò# HÔ$;Ñ<Ô<ˆØÔ+¨s¨fÑ4ˆØÔð 	*Ø�3˜Ô)Ñ)Ñ)ˆCÝˆSÕ$°Ð3Ñ3Ô3Ð3Øˆ~˜hÐ8¨Ð8Ð8Ð8°Ð8Ð8Ð8r   r9   )rY   rZ   s   ` r   Ú_dict_deprecation_wrapperr[   Ä   s#   ø€ ð9ð 9ð 9ð 9ð 9ð €Ir   c                   óÜ   — e Zd ZdZdZd„ Z eej        ¦  «        Z eej	        ¦  «        Z	 eej
        ¦  «        Z
 eej        ¦  «        Z eej        ¦  «        Z eej        ¦  «        ZdS )ÚDeprecatedDictz1A dictionary that complains when read or written.Tc                 óf   — || _         || _        || _        t                               | |¦  «         dS )a�  Create a dict that warns when read or modified.

        :param deprecation_version: string for the warning format to raise,
            typically from deprecated_in()
        :param initial_value: The contents of the dict
        :param variable_name: This allows better warnings to be printed
        :param advice: String of advice on what callers should do instead
            of using this variable.
        N)rU   rT   rV   Údictr=   )r>   r    Úvariable_nameÚinitial_valueÚadvices        r   r=   zDeprecatedDict.__init__Õ   s5   € ð %8ˆÔ!Ø+ˆÔØˆŒÝ�Š�d˜MÑ*Ô*Ð*Ð*Ð*r   N)r   r   r   rG   rQ   r=   r[   r_   Ú__len__Ú__getitem__Ú__setitem__Ú__delitem__ÚkeysÚ__contains__r9   r   r   r]   r]   Ð   sš   € € € € € Ø;Ð;à€Mð+ð +ð +ð, (Ð'¨¬Ñ5Ô5€GØ+Ð+¨DÔ,<Ñ=Ô=€KØ+Ð+¨DÔ,<Ñ=Ô=€KØ+Ð+¨DÔ,<Ñ=Ô=€KØ$Ð$ T¤YÑ/Ô/€DØ,Ð,¨TÔ->Ñ?Ô?€L€L€Lr   r]   c                 ó’   ‡‡— d                      ‰¦  «        }| |fz  Š|r‰d|z   z  Š G ˆˆfd„dt          ¦  «        } ||¦  «        S )aP  Create a list that warns when modified

    :param deprecation_version: string for the warning format to raise,
        typically from deprecated_in()
    :param initial_value: The contents of the list
    :param variable_name: This allows better warnings to be printed
    :param extra: Extra info to print when printing a warning
    zModifying {}rF   c                   óf   •— e Zd Zej        ” z   ZdZˆ fd„Zˆfd„Zˆfd„Zˆfd„Z	ˆfd„Z
d	ˆfd„	ZdS )
ú(deprecated_list.<locals>._DeprecatedListTc                 óJ   •— t          ‰t          d¬¦  «          || g|¢R i |¤ŽS )Né   r,   )r	   r0   )r>   Úfuncr1   r2   rX   s       €r   Ú_warn_deprecatedz9deprecated_list.<locals>._DeprecatedList._warn_deprecated  s9   ø€ Ý�Õ(°QÐ7Ñ7Ô7Ð7Ø�4˜Ð.˜tÐ.Ð.Ð. vÐ.Ð.Ð.r   c                 ón   •— d                      ‰¦  «         |                      t          j        |¦  «        S )Nzappending to {} is deprecated)r   ro   ÚlistÚappend)r>   Úobjr`   s     €r   rr   z/deprecated_list.<locals>._DeprecatedList.append  s/   ø€ Ø/×6Ò6°}ÑEÔEÐEØ×(Ò(­¬°cÑ:Ô:Ð:r   c                 óp   •— d                      ‰¦  «         |                      t          j        ||¦  «        S )Nzinserting to {} is deprecated)r   ro   rq   Úinsert)r>   Úindexrs   r`   s      €r   ru   z/deprecated_list.<locals>._DeprecatedList.insert  s1   ø€ Ø/×6Ò6°}ÑEÔEÐEØ×(Ò(­¬°e¸SÑAÔAÐAr   c                 ón   •— d                      ‰¦  «         |                      t          j        |¦  «        S )Nzextending {} is deprecated)r   ro   rq   Úextend)r>   Úiterabler`   s     €r   rx   z/deprecated_list.<locals>._DeprecatedList.extend  s/   ø€ Ø,×3Ò3°MÑBÔBÐBØ×(Ò(­¬°hÑ?Ô?Ð?r   c                 ón   •— d                      ‰¦  «         |                      t          j        |¦  «        S )Nzremoving from {} is deprecated)r   ro   rq   Úremove)r>   Úvaluer`   s     €r   r{   z/deprecated_list.<locals>._DeprecatedList.remove  s/   ø€ Ø0×7Ò7¸ÑFÔFÐFØ×(Ò(­¬°eÑ<Ô<Ð<r   Nc                 ó°   •— d                      ‰¦  «         |r |                      t          j        |¦  «        S |                      t          j        ¦  «        S )Nzpop'ing from {} is deprecated)r   ro   rq   Úpop)r>   rv   r`   s     €r   r~   z,deprecated_list.<locals>._DeprecatedList.pop  sO   ø€ Ø/×6Ò6°}ÑEÔEÐEØð 7Ø×,Ò,­T¬X°uÑ=Ô=Ð=ð ×,Ò,­T¬XÑ6Ô6Ð6r   ©N)r   r   r   rq   rG   rQ   ro   rr   ru   rx   r{   r~   )rX   r`   s   €€r   Ú_DeprecatedListrk     sË   ø€ € € € € Ø”, Ñ$ˆàˆð	/ð 	/ð 	/ð 	/ð 	/ð	;ð 	;ð 	;ð 	;ð 	;ð	Bð 	Bð 	Bð 	Bð 	Bð	@ð 	@ð 	@ð 	@ð 	@ð	=ð 	=ð 	=ð 	=ð 	=ð	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7r   r€   )r   rq   )r    r`   ra   ÚextraÚ
subst_textr€   rX   s    `    @r   r   r   ó   s‡   øø€ ð  ×&Ò& }Ñ5Ô5€JØ
  Ñ
-€CØð Øˆs�U‰{Ñˆð7ð 7ð 7ð 7ð 7ð 7ð 7ð 7�$ñ 7ô 7ð 7ðB ˆ?˜=Ñ)Ô)Ð)r   c                 ó|   — t           j        D ].}t          t          |d         ¦  «        r| r|d         dk    r dS Œ/dS )z®Check if there is already a filter for deprecation warnings.

    :param error_only: Only match an 'error' filter
    :return: True if a filter is found, False otherwise
    r+   r
   ÚerrorTF)ÚwarningsÚfiltersÚ
issubclassr0   )Ú
error_onlyÚfilters     r   Ú_check_for_filterrŠ   '  sP   € õ Ô"ð ð ˆÝÕ(¨&°¬)Ñ4Ô4ð 	àð  ¨¤¨gÒ!5Ð!5Ø�t�tøØˆ5r   c                 ó   ‡ — ˆ fd„}|S )zÄBuild and returns a callable removing filter from the warnings.

    :param filter: The filter to remove (can be None).

    :return: A callable that will remove filter from warnings.filters.
    c                  ó€   •— ‰ r:	 t           j                             ‰ ¦  «         d S # t          t          f$ r Y d S w xY wd S r   )r…   r†   r{   Ú
ValueErrorÚ
IndexError)r‰   s   €r   Úcleanupz(_remove_filter_callable.<locals>.cleanup<  s^   ø€ Øð 	ðÝÔ ×'Ò'¨Ñ/Ô/Ð/Ð/Ð/øÝ¥
Ð+ð ð ð Ø��ðøøøð	ð 	s   …& ¦;º;r9   )r‰   r�   s   ` r   Ú_remove_filter_callabler�   5  s#   ø€ ðð ð ð ð ð €Nr   Tc                 ó¤   — | st          d¬¦  «        rd}n-t          j        dt          ¬¦  «         t          j        d         }t          |¦  «        S )a¼  Call this function to suppress all deprecation warnings.

    When this is a final release version, we don't want to annoy users with
    lots of deprecation warnings. We only want the deprecation warnings when
    running a dev or release candidate.

    :param override: If True, always set the ignore, if False, only set the
        ignore if there isn't already a filter.

    :return: A callable to remove the new warnings this added.
    F©rˆ   NÚignore©Úcategoryr
   ©rŠ   r…   Úfilterwarningsr0   r†   r�   ©Úoverrider‰   s     r   Úsuppress_deprecation_warningsrš   E  sZ   € ð ð %Õ)°UÐ;Ñ;Ô;ð %ð ˆˆåÔ Õ3EÐFÑFÔFÐFÝÔ! !Ô$ˆÝ" 6Ñ*Ô*Ð*r   c                 ó¤   — | st          d¬¦  «        rd}n-t          j        dt          ¬¦  «         t          j        d         }t          |¦  «        S )aÝ  Call this function to activate deprecation warnings.

    When running in a 'final' release we suppress deprecation warnings.
    However, the test suite wants to see them. So when running selftest, we
    re-enable the deprecation warnings.

    Note: warnings that have already been issued under 'ignore' will not be
    reported after this point. The 'warnings' module has already marked them as
    handled, so they don't get issued again.

    :param override: If False, only add a filter if there isn't an error filter
        already. (This slightly differs from suppress_deprecation_warnings, in
        because it always overrides everything but -Werror).

    :return: A callable to remove the new warnings this added.
    Tr’   NÚdefaultr”   r
   r–   r˜   s     r   Úactivate_deprecation_warningsr�   [  sZ   € ð" ð %Õ)°TÐ:Ñ:Ô:ð %ð ˆˆåÔ 	Õ4FÐGÑGÔGÐGÝÔ! !Ô$ˆÝ" 6Ñ*Ô*Ð*r   r   )T)rG   Ú__all__r…   r	   r   r   r   r   r"   r   r   r   rO   r7   r[   r_   r]   r   rŠ   r�   rš   r�   r9   r   r   ú<module>rŸ      ss  ðð"ð ð
ð ð €ð €€€à Ð Ð Ð Ð Ð à €€€ð 8Ð ð;ð ;ð ;ðð ð ð(ð (ð (ð*ð ð ð&"ð "ð "ðJ7ð 7ð 7ð&-ð -ð -ð*,ð ,ð ,ð	ð 	ð 	ð @ð  @ð  @ð  @ð  @�Tñ  @ô  @ð  @ðH *.ð1*ð 1*ð 1*ð 1*ðhð ð ðð ð ð +ð +ð +ð +ð,+ð +ð +ð +ð +ð +r   