o
    œ¨Êh=  ã                   @   s0   d dl mZ G dd„ deƒZG dd„ deƒZdS )é    )ÚCallablec                   @   s   e Zd ZdZdd„ ZdS )ÚClassPropertya™  
    An implementation of a property callable on a class. Used to decorate a
    classmethod but to then treat it like a property.

    Example:

    >>> class MyClass:
    ...    @ClassProperty
    ...    @classmethod
    ...    def skillz(cls):
    ...        return cls.__name__.startswith('My')
    >>> MyClass.skillz
    True
    >>> class YourClass(MyClass): pass
    >>> YourClass.skillz
    False
    c                 C   s   | j  d |¡ƒ S ©N)ÚfgetÚ__get__)ÚselfÚclsÚowner© r
   úI/var/www/html/env/lib/python3.10/site-packages/keyring/util/properties.pyr      s   zClassProperty.__get__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   r
   r
   r   r      s    r   c                   @   s"   e Zd ZdZdd„ Zddd„ZdS )ÚNonDataPropertya‡  Much like the property builtin, but only implements __get__,
    making it a non-data property, and can be subsequently reset.

    See http://users.rcn.com/python/download/Descriptor.htm for more
    information.

    >>> class X(object):
    ...   @NonDataProperty
    ...   def foo(self):
    ...     return 3
    >>> x = X()
    >>> x.foo
    3
    >>> x.foo = 4
    >>> x.foo
    4
    c                 C   s,   |d usJ dƒ‚t |tƒsJ dƒ‚|| _d S )Nzfget cannot be nonezfget must be callable)Ú
isinstancer   r   )r   r   r
   r
   r   Ú__init__0   s   
zNonDataProperty.__init__Nc                 C   s   |d u r| S |   |¡S r   )r   )r   ÚobjÚobjtyper
   r
   r   r   5   s   
zNonDataProperty.__get__r   )r   r   r   r   r   r   r
   r
   r
   r   r      s    r   N)Úcollectionsr   Úpropertyr   Úobjectr   r
   r
   r
   r   Ú<module>   s    