o
    AD©ig	  ã                   @   sf   d Z ddlZddlZddlmZ ddlmZ dZejdd„ ƒZ	e	 
ej¡d	d
„ ƒZG dd„ deƒZdS )z…:mod:`wirerope.wire` --- end-point instant for each bound method
===================================================================
é    Né   )Ú
Descriptor)Ú	functools)ÚWirec                 C   s   t | ƒ ||¡}|| ||ƒS ©N)r   Údetect_binder)Ú
descriptorÚobjÚtype_Úbinder© r   úF/var/www/Datamplify/venv/lib/python3.10/site-packages/wirerope/wire.pyÚdescriptor_bind   s   r   c                 C   s   ||fS r   r   )r   r	   Útyper   r   r   Údescriptor_bind_function   s   r   c                   @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )r   a‘  The core data object for each function for bound method.

    Inherit this class to implement your own Wire classes.

    - For normal functions, each function is directly wrapped by **Wire**.
    - For any methods or descriptors (including classmethod, staticmethod),
      each one is wrapped by :class:`wirerope.rope.MethodRopeMixin`
      and it creates **Wire** object for each bound object.
    )Ú_ropeÚ	_callableÚ_bindingÚ__func__Ú_ownerÚ_bound_objectsc                 C   sì   || _ |j| _|| _|| _|r6| jjj}| jjr0tj	|g|¢R Ž }t
jr,|j|_|j|_|| _n||Ž | _n| jj| _| jd u rDd| _nt| jjg| j¢R Ž \}}|d urZ|f| _nd| _t| jƒsgJ | jƒ‚|jrtt | j¡| ƒ d S d S )Nr   )r   Úcallabler   r   r   Úwrapped_objectÚ__get__Úis_propertyr   ÚpartialÚsixÚPY2Ú
__module__Ú__name__r   r   r   Ú_wrappedÚwraps)ÚselfÚropeÚownerÚbindingÚfuncÚwrappedÚ_r   r   r   r   Ú__init__&   s8   


ÿÿ
ÿzWire.__init__c                 C   s   |   ¡ S r   )r   )r"   r   r   r   Ú_on_propertyF   s   zWire._on_propertyN)r   r   Ú__qualname__Ú__doc__Ú	__slots__r)   r*   r   r   r   r   r      s
    
 r   )r,   r   Útypesr   r   Ú_compatr   Ú__all__Úsingledispatchr   ÚregisterÚFunctionTyper   Úobjectr   r   r   r   r   Ú<module>   s    


