3
6ßL]Þ  ã               @   sX   d Z ddlZddlmZmZmZmZmZ ddlm	Z	 G dd„ de	ƒZ
G dd	„ d	eƒZdS )
z2 Classes used to represent functions and methods. é    N)ÚAnyÚ	HasTraitsÚInstanceÚIntÚStré   )Ú	Namespacec               @   s,   e Zd ZdZeeƒZeZe	Z
eZdd„ ZdS )ÚFunctionz A function. c             C   s   d| j | jf S )z: Returns an informal string representation of the object. zFunction %s at %d)ÚnameÚlineno)Úself© r   úN/tmp/pip-install-5sebvq2j/envisage/envisage/developer/code_browser/function.pyÚ__str__#   s    zFunction.__str__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú	namespacer   r   r   r
   r   Údocr   r   r   r   r   r	      s   r	   c               @   s   e Zd ZdZdd„ ZdS )ÚFunctionFactoryz A factory for classes. c             C   s"   t ||j|jtj|dd�d�}|S )z# Creates a class from an AST node. F)Úclean)r   r   r
   r   )r	   r   r
   ÚastÚget_docstring)r   r   ÚnodeÚfunctionr   r   r   Úfrom_ast0   s    zFunctionFactory.from_astN)r   r   r   r   r   r   r   r   r   r   )   s   r   )r   r   Z
traits.apir   r   r   r   r   r   r   r	   r   r   r   r   r   Ú<module>   s
   