§
    cÌcš  ã                   óR   — d dl mZ d„ Zd„ Z G d„ d¦  «        Z G d„ d¦  «        ZdS )	é   )Útracec                  ó   ‡ — ˆ fd„}|S )a	  Make a decorator that will only allow the given error classes to be
    raised.  All other errors will be logged and then discarded.

    Typical use is something like::

        @only_raises(LockNotHeld, LockBroken)
        def unlock(self):
            # etc
    c                 óF   •‡ — ˆˆ fd„}‰ j         |_         ‰ j        |_        |S )Nc                  ó~   •— 	  ‰| i |¤ŽS # ‰$ r ‚  t          j        d¦  «         t          j        ¦   «          Y d S xY w)Nz Error suppressed by only_raises:)r   ÚmutterÚlog_exception_quietly)ÚargsÚkwargsÚerrorsÚunbounds     €€ú3/usr/lib/python3/dist-packages/breezy/decorators.pyÚwrappedz/only_raises.<locals>.decorator.<locals>.wrapped   sd   ø€ ð.Ø�w Ð/¨Ð/Ð/Ð/øØð ð ð Øð.Ý”Ð?Ñ@Ô@Ð@ÝÔ+Ñ-Ô-Ð-Ð-Ð-Ð-øøøs   ƒ ‹.<)Ú__doc__Ú__name__)r   r   r   s   ` €r   Ú	decoratorzonly_raises.<locals>.decorator   s=   øø€ ð	.ð 	.ð 	.ð 	.ð 	.ð 	.ð "œ/ˆŒØ"Ô+ˆÔØˆó    © )r   r   s   ` r   Úonly_raisesr      s$   ø€ ðð ð ð ð ð Ðr   c                 ó†   — t          | t          ¦  «        r| }t          |¦  «        S | }d|j        z  }t	          ||¦  «        S )a4  A decorator for methods that makes them properties with their return
    value cached.

    The value is cached on the instance, using the attribute name provided.

    If you don't provide a name, the mangled name of the property is used.

    >>> class CachedPropertyTest(object):
    ...
    ...     @cachedproperty('_foo_cache')
    ...     def foo(self):
    ...         print('foo computed')
    ...         return 23
    ...
    ...     @cachedproperty
    ...     def bar(self):
    ...         print('bar computed')
    ...         return 69

    >>> cpt = CachedPropertyTest()
    >>> getattr(cpt, '_foo_cache', None) is None
    True
    >>> cpt.foo
    foo computed
    23
    >>> cpt.foo
    23
    >>> cpt._foo_cache
    23
    >>> cpt.bar
    bar computed
    69
    >>> cpt._bar_cached_value
    69

    z_%s_cached_value)Ú
isinstanceÚstrÚ_CachedPropertyForAttrr   Ú_CachedProperty)Úattrname_or_fnÚattrnameÚfns      r   Úcachedpropertyr   0   sK   € õJ �.¥#Ñ&Ô&ð -Ø!ˆÝ% hÑ/Ô/Ð/àˆØ%¨¬Ñ3ˆÝ˜x¨Ñ,Ô,Ð,r   c                   ó   — e Zd Zd„ Zd„ ZdS )r   c                 ó   — || _         d S ©N)r   )Úselfr   s     r   Ú__init__z_CachedPropertyForAttr.__init__`   s   € Ø ˆŒˆˆr   c                 ó,   — t          | j        |¦  «        S r    )r   r   )r!   r   s     r   Ú__call__z_CachedPropertyForAttr.__call__c   s   € Ý˜tœ}¨bÑ1Ô1Ð1r   N)r   Ú
__module__Ú__qualname__r"   r$   r   r   r   r   r   ^   s2   € € € € € ð!ð !ð !ð2ð 2ð 2ð 2ð 2r   r   c                   ó   — e Zd Zd„ Zdd„ZdS )r   c                 óH   — || _         || _        t          ¦   «         | _        d S r    )r   r   ÚobjectÚmarker)r!   r   r   s      r   r"   z_CachedProperty.__init__i   s   € ØˆŒØ ˆŒÝ‘h”hˆŒˆˆr   Nc                 ó°   — |€| S t          || j        | j        ¦  «        }|| j        u r-|                      |¦  «        }t	          || j        |¦  «         |S |S r    )Úgetattrr   r*   r   Úsetattr)r!   ÚinstÚclsÚcachedresultÚresults        r   Ú__get__z_CachedProperty.__get__n   s\   € Øˆ<ØˆKÝ˜t T¤]°D´KÑ@Ô@ˆØ˜4œ;Ð&Ð&Ø—W’W˜T‘]”]ˆFÝ�D˜$œ-¨Ñ0Ô0Ð0ØˆMàÐr   r    )r   r%   r&   r"   r2   r   r   r   r   r   g   s7   € € € € € ðð ð ð
	 ð 	 ð 	 ð 	 ð 	 ð 	 r   r   N)Ú r   r   r   r   r   r   r   r   ú<module>r4      s’   ðð" Ð Ð Ð Ð Ð ðð ð ð8+-ð +-ð +-ð\2ð 2ð 2ð 2ð 2ñ 2ô 2ð 2ð ð  ð  ð  ð  ñ  ô  ð  ð  ð  r   