Ë
    àU.jã  ã                   óâ   — d Z ddlmZmZmZ ddlZ ej                  e«      Zddl	m
Z
mZ ddlZddlmZ ddlmZ g d¢Z G d„ d	e«      Z G d
„ de«      Zd„ Z G d„ de«      Z	 	 	 dd„Z	 	 dd„Zy)z7
passlib.utils.decor -- helper decorators & properties
é    )Úabsolute_importÚdivisionÚprint_functionN)ÚwrapsÚupdate_wrapper)Úwarn)ÚPY3)ÚclasspropertyÚhybrid_methodÚmemoize_single_valueÚmemoized_propertyÚdeprecated_functionÚdeprecated_methodc                   ó,   — e Zd ZdZd„ Zd„ Zed„ «       Zy)r
   zjFunction decorator which acts like a combination of classmethod+property (limited to read-only properties)c                 ó   — || _         y ©N©Úim_func©ÚselfÚfuncs     úUC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\passlib/utils/decor.pyÚ__init__zclassproperty.__init__#   s	   € Øˆ�ó    c                 ó$   — | j                  |«      S r   r   ©r   ÚobjÚclss      r   Ú__get__zclassproperty.__get__&   s   € Ø�|‰|˜CÓ Ð r   c                 ó   — | j                   S )zpy3 compatible aliasr   ©r   s    r   Ú__func__zclassproperty.__func__)   s   € ð �|‰|Ðr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úpropertyr"   © r   r   r
   r
       s#   „ Ùtòò!ð ñó ñr   r
   c                   ó   — e Zd ZdZd„ Zd„ Zy)r   z�
    decorator which invokes function with class if called as class method,
    and with object if called at instance level.
    c                 ó*   — || _         t        | |«       y r   )r   r   r   s     r   r   zhybrid_method.__init__4   s   € ØˆŒ	Ü�t˜TÕ"r   c                 ó˜   — |€|}t         r t        j                  | j                  |«      S t        j                  | j                  ||«      S r   )r	   ÚtypesÚ
MethodTyper   r   s      r   r   zhybrid_method.__get__8   s?   € Øˆ;ØˆCÝÜ×#Ñ# D§I¡I¨sÓ3Ð3ä×#Ñ# D§I¡I¨s°CÓ8Ð8r   N)r#   r$   r%   r&   r   r   r(   r   r   r   r   .   s   „ ñò
#ó9r   r   c                 óN   ‡ ‡— i Št        ‰ «      ˆˆ fd„«       }ˆfd„}||_        |S )z�
    decorator for function which takes no args,
    and memoizes result.  exposes a ``.clear_cache`` method
    to clear the cached value.
    c                  óJ   •— 	 ‰d   S # t         $ r Y nw xY w ‰«       x} ‰d<   | S ©NT)ÚKeyError)ÚvalueÚcacher   s    €€r   Úwrapperz%memoize_single_value.<locals>.wrapperL   s9   ø€ ð	Ø˜‘;ÐøÜò 	Ùð	úá"›fÐ$ˆ��d‘Øˆs   ƒ ˆ	“c                  ó*   •— ‰ j                  dd «       y r0   )Úpop)r3   s   €r   Úclear_cachez)memoize_single_value.<locals>.clear_cacheU   s   ø€ Ø�	‰	�$˜Õr   )r   r7   )r   r4   r7   r3   s   `  @r   r   r   D   s2   ù€ ð €Eä
ˆ4ƒ[ôó ðôà%€GÔà€Nr   c                   ó>   — e Zd ZdZd„ Zd„ Zesed„ «       Zd„ Z	dd„Z
y)	r   zM
    decorator which invokes method once, then replaces attr with result
    c                 óV   — || _         |j                  | _        |j                  | _        y r   )r"   r#   r&   r   s     r   r   zmemoized_property.__init___   s   € ØˆŒØŸ™ˆŒØ—|‘|ˆ�r   c                 ó^   — |€| S | j                  |«      }t        || j                  |«       |S r   )r"   Úsetattrr#   )r   r   r   r2   s       r   r   zmemoized_property.__get__d   s/   € Øˆ;ØˆKØ—‘˜cÓ"ˆÜ��T—]‘] EÔ*Øˆr   c                 ó   — | j                   S )z	py2 alias)r"   r!   s    r   r   zmemoized_property.im_funcm   s   € ð —=‘=Ð r   c                 óP   — |j                   j                  | j                  d«       y)z€
        class-level helper to clear stored value (if any).

        usage: :samp:`type(self).{attr}.clear_cache(self)`
        N)Ú__dict__r6   r#   )r   r   s     r   r7   zmemoized_property.clear_cacher   s   € ð 	�‰×Ñ˜Ÿ™¨Õ-r   Nc                 óN   — |j                   j                  | j                  |«      S )z€
        class-level helper to peek at stored value

        usage: :samp:`value = type(self).{attr}.clear_cache(self)`
        )r>   Úgetr#   )r   r   Údefaults      r   Ú
peek_cachezmemoized_property.peek_cachez   s   € ð �|‰|×Ñ §¡¨wÓ7Ð7r   r   )r#   r$   r%   r&   r   r   r	   r'   r   r7   rB   r(   r   r   r   r   [   s2   „ ñò$ò
ñ à	ñ	!ó 
ð	!ò.ô8r   r   c                 óv   ‡ ‡‡‡‡‡‡— ‰ €$‰rdŠ ndŠ ‰r‰ dz  Š ‰r‰ dz  Š ‰r‰ d‰z  z  Š ‰ dz  Š ˆˆˆˆ ˆˆˆfd„}|S )ab  decorator to deprecate a function.

    :arg msg: optional msg, default chosen if omitted
    :kwd deprecated: version when function was first deprecated
    :kwd removed: version when function will be removed
    :kwd replacement: alternate name / instructions for replacing this function.
    :kwd updoc: add notice to docstring (default ``True``)
    z5the method %(mod)s.%(klass)s.%(name)s() is deprecatedz-the function %(mod)s.%(name)s() is deprecatedz as of Passlib %(deprecated)sz,, and will be removed in Passlib %(removed)sz, use %s insteadÚ.c                 óv  •‡ ‡‡‡— ‰xr t        ‰ t        «      Š‰r ‰ j                  d t        «      j                  Š t        ‰xs ‰ j                  ‰ j                  ‰‰
¬«      Š‰r	ˆ ˆˆ	ˆfd„}n‰	‰z  Šˆ ˆfd„}t        |‰ «       ‰r¥‰s‰
r¡|j                  r•d|j                  vr‡‰xs d}‰
s‰r%|dz  }‰
r|d‰
›�z  }‰r‰
r|dz  }|d	‰z  z  }|d
z  }|j                  j                  d«      j                  d«      s|xj                  dz  c_	        |xj                  d|›d�z  c_	        ‰rt        |«      }|S )N)ÚmodÚnameÚ
deprecatedÚremovedc                  óØ   •— ‰j                  «       }‰r| d   n| d   j                  }|j                  |j                  |j                  ¬«       t        ‰|z  t        d¬«        ‰| i |¤ŽS )Nr   )ÚklassrF   é   ©Ú
stacklevel)ÚcopyÚ	__class__Úupdater#   r$   r   ÚDeprecationWarning)ÚargsÚkwdsÚtmprK   r   Úis_classmethodÚmsgÚoptss       €€€€r   r4   z3deprecated_function.<locals>.build.<locals>.wrapperº   s`   ø€ Ø—i‘i“k�Ù#1˜˜Qš°t¸A±w×7HÑ7H�Ø—
‘
 §¡°U×5EÑ5E�
ÔFÜ�S˜3‘YÔ 2¸qÕAÙ˜TÐ* TÑ*Ð*r   c                  ó8   •— t        ‰t        d¬«        ‰| i |¤ŽS )NrL   rM   )r   rR   )rS   rT   r   Útexts     €€r   r4   z3deprecated_function.<locals>.build.<locals>.wrapperÂ   s    ø€ Ü�TÔ-¸!Õ<Ù˜TÐ* TÑ*Ð*r   z.. deprecated::Ú z
    zand will be removed in version z, zuse %s insteadrD   Ú Ú
z
.. deprecated:: )Ú
isinstanceÚclassmethodr   Útyper"   Údictr$   r#   r   r&   ÚstripÚendswith)r   r4   ÚtxtrV   rX   rZ   Ú
_is_methodrH   Úfunc_modulerW   rI   ÚreplacementÚupdocs   `  @@@€€€€€€€r   Úbuildz"deprecated_function.<locals>.build®   s3  ü€ Ø#ÒE¬
°4¼Ó(EˆÙà—<‘< ¤dÓ+×4Ñ4ˆDÜØÒ.˜tŸ™Ø—‘Ø!Øô	ˆñ ÷+ð +ð ˜‘:ˆDõ+ô 	�w Ô%Ù‘j¡GØ—?’?Ð'8ÀÇÁÑ'OØÒ" ˆCÙ™+Ø�x‘�ÙÙÁ'ÐKÑK�CÙÙØ˜t™˜ØÐ+¨kÑ9Ñ9�CØ�s‘
�Ø—?‘?×(Ñ(¨Ó-×6Ñ6°tÔ<Ø—’ 4Ñ'•Ø�O‹Oº3Ð@Ñ@�OÙÜ! 'Ó*ˆGØˆr   r(   )rW   rH   rI   rh   rg   re   rf   ri   s   ``````` r   r   r   —   sa   þ€ ð €{ÙØI‰CàAˆCÙØÐ2Ñ2ˆCÙØÐAÑAˆCÙØÐ%¨Ñ3Ñ3ˆCØˆs‰
ˆ÷)ò )ðT €Lr   c                 ó$   — t        | ||||d¬«      S )aZ  decorator to deprecate a method.

    :arg msg: optional msg, default chosen if omitted
    :kwd deprecated: version when method was first deprecated
    :kwd removed: version when method will be removed
    :kwd replacement: alternate name / instructions for replacing this method.
    :kwd updoc: add notice to docstring (default ``True``)
    T)re   )r   )rW   rH   rI   rh   rg   s        r   r   r   Ú   s   € ô ˜s J°¸ÀØ*.ô0ð 0r   )NNNTNFN)NNNTN)r&   Ú
__future__r   r   r   ÚloggingÚ	getLoggerr#   ÚlogÚ	functoolsr   r   r,   Úwarningsr   Úpasslib.utils.compatr	   Ú__all__Úobjectr
   r   r   r   r   r   r(   r   r   Ú<module>rt      sŠ   ðñ÷ AÑ @Û Ø€g×Ñ˜Ó!€ß +Û Ý õ %ò	€ô�Fô ô9�Fô 9ò,ô.%8˜ô %8ðx HLØ5:Ø$(óAðF FJØ"&ô0r   