a
    ,ò¿WÜ  ã                   @   sP   d Z ddlmZ ddlmZ ddlmZ ddlmZ eeƒG dd„ deƒƒZ	dS )	zFactory object
é    )Úimplementer)ÚimplementedBy)Ú
Implements)ÚIFactoryc                   @   s2   e Zd ZdZddd„Zdd„ Zdd	„ Zd
d„ ZdS )ÚFactoryzªGeneric factory implementation.

    The purpose of this implementation is to provide a quick way of creating
    factories for classes, functions and other objects.
    Ú Nc                 C   s   || _ || _|| _|| _d S ©N)Ú	_callableÚtitleÚdescriptionÚ_interfaces)ÚselfÚcallabler
   r   Z
interfaces© r   ú8/usr/lib/python3/dist-packages/zope/component/factory.pyÚ__init__   s    zFactory.__init__c                 O   s   | j |i |¤ŽS r   )r	   )r   ÚargsÚkwr   r   r   Ú__call__$   s    zFactory.__call__c                 C   s2   | j d ur(t| j Ž }t| jddƒ|_|S t| jƒS )NÚ__name__z
[callable])r   r   Úgetattrr	   r   r   )r   Úspecr   r   r   ÚgetInterfaces'   s
    

zFactory.getInterfacesc                 C   s   d| j jt| jƒf S )Nz<%s for %s>)Ú	__class__r   Úreprr	   )r   r   r   r   Ú__repr__.   s    zFactory.__repr__)r   r   N)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s
   
r   N)
r   Zzope.interfacer   r   Zzope.interface.declarationsr   Zzope.component.interfacesr   Úobjectr   r   r   r   r   Ú<module>   s   