+
    i                         R t ^ RIHtHtHt ^ RIt]P                  ! ]4      t^ RI	H
t
Ht ^ RIt^ RIHt ^ RIHt . ROt ! R	 R]4      t ! R
 R]4      tR t ! R R]4      tRR ltRR ltR# )z7
passlib.utils.decor -- helper decorators & properties
)absolute_importdivisionprint_functionN)wrapsupdate_wrapper)warn)PY3classpropertyhybrid_methodmemoized_propertyc                   @   a  ] tR t^ t o RtR tR t]R 4       tRt	V t
R# )r	   zjFunction decorator which acts like a combination of classmethod+property (limited to read-only properties)c                    Wn         R # Nim_funcselffuncs   &&Q/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/utils/decor.py__init__classproperty.__init__#   s        c                $    V P                  V4      # r   r   r   objclss   &&&r   __get__classproperty.__get__&   s    ||C  r   c                    V P                   # )zpy3 compatible aliasr   r   s   &r   __func__classproperty.__func__)   s     ||r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   propertyr    __static_attributes____classdictcell____classdict__s   @r   r	   r	       s&     t!  r   c                   0   a  ] tR t^.t o RtR tR tRtV tR# )r
   zu
decorator which invokes function with class if called as class method,
and with object if called at instance level.
c                (    Wn         \        W4       R # r   )r   r   r   s   &&r   r   hybrid_method.__init__4   s    	t"r   c                    Vf   Tp\         '       d"   \        P                  ! V P                  V4      # \        P                  ! V P                  W4      # r   )r   types
MethodTyper   r   s   &&&r   r   hybrid_method.__get__8   s?    ;C3##DIIs33##DIIs88r   )r   N)	r"   r#   r$   r%   r&   r   r   r(   r)   r*   s   @r   r
   r
   .   s     
#9 9r   c                P   a a / o\        S 4      VV 3R l4       pV3R lpW!n        V# )z
decorator for function which takes no args,
and memoizes result.  exposes a ``.clear_cache`` method
to clear the cached value.
c                  V   <  SR ,          #   \          d     Mi ; iS! 4       ;p SR &   T # )T)KeyError)valuecacher   s    r   wrapper%memoize_single_value.<locals>.wrapperL   s9    	; 		"f$ds    c                  ,   < S P                  R R4       R# )TN)pop)r7   s   r   clear_cache)memoize_single_value.<locals>.clear_cacheU   s    		$r   )r   r<   )r   r8   r<   r7   s   f  @r   memoize_single_valuer>   D   s0     E
4[ %Nr   c                   `   a  ] tR t^[t o RtR tR t]'       g	   ]R 4       t	R t
R	R ltRtV tR# )
r   zE
decorator which invokes method once, then replaces attr with result
c                V    Wn         VP                  V n        VP                  V n        R # r   )r    r"   r&   r   s   &&r   r   memoized_property.__init___   s    ||r   c                `    Vf   V # V P                  V4      p\        WP                  V4       V# r   )r    setattrr"   )r   r   r   r6   s   &&& r   r   memoized_property.__get__d   s-    ;Kc"]]E*r   c                    V P                   # )z	py2 alias)r    r   s   &r   r   memoized_property.im_funcm   s     == r   c                R    VP                   P                  V P                  R4       R# )zh
class-level helper to clear stored value (if any).

usage: :samp:`type(self).{attr}.clear_cache(self)`
N)__dict__r;   r"   )r   r   s   &&r   r<   memoized_property.clear_cacher   s     	-r   Nc                N    VP                   P                  V P                  V4      # )zh
class-level helper to peek at stored value

usage: :samp:`value = type(self).{attr}.clear_cache(self)`
)rH   getr"   )r   r   defaults   &&&r   
peek_cachememoized_property.peek_cachez   s     ||w77r   )r&   r    r"   r   )r"   r#   r$   r%   r&   r   r   r   r'   r   r<   rM   r(   r)   r*   s   @r   r   r   [   s:     $
 		! 
	!.8 8r   c                   a aaaaaa S fQ   S'       d   Ro MRo S'       d
   S R,          o S'       d
   S R,          o S'       d   S RS,          ,          o S R,          o VVVV VVV3R lpV# )aJ  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                   <a aaa S;'       d    \        S \        4      oS'       d!   S P                  R \        4      P                  o \        S;'       g    S P                  S P                  SS
R7      oS'       d   V VV	V3R lpMS	S,          oV V3R lp\        VS 4       S'       Ed   S'       g	   S
'       d   VP                  '       d   RVP                  9  d   S;'       g    RpS
'       g	   S'       dQ   VR,          pS
'       d   VRS
: 2,          pS'       d"   S
'       d
   VR,          pVR	S,          ,          pVR
,          pVP                  P                  R4      P                  R4      '       g   V;P                  R,          un	        V;P                  RV: R2,          un	        S'       d   \        V4      pV# )N)modname
deprecatedremovedc                     < SP                  4       pS'       d
   V ^ ,          MV ^ ,          P                  pVP                  VP                  VP                  R7       \        SV,          \        ^R7       S! V / VB # )    )klassrR   
stacklevel)copy	__class__updater"   r#   r   DeprecationWarning)argskwdstmprX   r   is_classmethodmsgoptss   *,  r   r8   3deprecated_function.<locals>.build.<locals>.wrapper   s`    iik#1QtAw7H7H

U5E5E
FS3Y 2qAT*T**r   c                  8   < \        S\        ^R7       S! V / VB # )   rY   )r   r^   )r_   r`   r   texts   *,r   r8   re      s     T-!<T*T**r   z.. deprecated:: z
    zand will be removed in version z, zuse %s insteadrP    
z
.. deprecated:: )
isinstanceclassmethodr   typer    dictr#   r"   r   r&   stripendswith)r   r8   txtrb   rd   rh   
_is_methodrT   func_modulerc   rU   replacementupdocs   f  @@@r   build"deprecated_function.<locals>.build   sC   #EE
4(E<<d+44D..t!	 + + :D+ 	w%5jG???'8'O""C+x'KKCt+k99Cs
??((-66t<<4'OO3@@O!'*Gr    )rc   rT   rU   rv   ru   rs   rt   rw   s   fffffff r   deprecated_functionrz      sa     {ICAC22CAAC%33Cs
) )T Lr   c           	          \        WW#VRR7      # )aB  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)rs   )rz   )rc   rT   rU   rv   ru   s   &&&&&r   deprecated_methodr|      s     s*.0 0r   )r	   r
   r>   r   rz   r|   )NNNTNFN)NNNTN)r&   
__future__r   r   r   logging	getLoggerr"   log	functoolsr   r   r0   warningsr   passlib.utils.compatr   __all__objectr	   r
   r>   r   rz   r|   ry   r   r   <module>r      sq    A @ ! +   %	F 9F 9,.%8 %8xAF0r   