B
    XM\«  ã               @   sÈ   d dl Z dZdd„ ZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )é    NzF----------------------------------------------------------------------c             C   s   t  t  | ¡¡S )N)ÚtextwrapZfillÚdedent)Ús© r   ú5lib/python3.7/site-packages/conda_build/exceptions.pyÚ<lambda>   s    r   c               @   s   e Zd ZdS )ÚCondaBuildExceptionN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r      s   r   c               @   s   e Zd ZdS )ÚYamlParsingErrorN)r	   r
   r   r   r   r   r   r      s   r   c                   s4   e Zd Z‡ fdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )	ÚUnableToParsec                s   t t| ƒj||Ž || _d S )N)Úsuperr   Ú__init__Úoriginal)Úselfr   ÚargsÚkwargs)Ú	__class__r   r   r      s    zUnableToParse.__init__c             C   s   d  t|  ¡ |  ¡ g¡S )NÚ
)ÚjoinÚ	SEPARATORÚ
error_bodyÚindented_exception)r   r   r   r   Ú	error_msg   s    zUnableToParse.error_msgc             C   s   d  dg¡S )Nr   zUnable to parse meta.yaml file
)r   )r   r   r   r   r      s    zUnableToParse.error_bodyc             C   s    t | jƒ}dd„ }d ||ƒ¡S )Nc             S   s   |   dd¡S )Nr   z
--> )Úreplace)r   r   r   r   r   "   s    z2UnableToParse.indented_exception.<locals>.<lambda>zError Message:
--> {}

)Ústrr   Úformat)r   ZorigÚindentr   r   r   r       s    
z UnableToParse.indented_exception)r	   r
   r   r   r   r   r   Ú__classcell__r   r   )r   r   r      s   r   c                   s   e Zd Z‡ fdd„Z‡  ZS )ÚUnableToParseMissingJinja2c                s   d  tt| ƒ ¡ tdƒg¡S )Nr   z„                It appears you are missing jinja2.  Please install that
                package, then attempt to build.
            )r   r   r    r   r   )r   )r   r   r   r   '   s    z%UnableToParseMissingJinja2.error_body)r	   r
   r   r   r   r   r   )r   r   r    &   s   r    c               @   s   e Zd ZdS )Ú*UnableToParseMissingSetuptoolsDependenciesN)r	   r
   r   r   r   r   r   r!   1   s   r!   c                   s   e Zd Z‡ fdd„Z‡  ZS )ÚVerifyErrorc                s0   || _ || _d||f | _tt| ƒ | j¡ d S )Nz%s failed to verify
%s)ÚerrorÚscriptÚmsgr   r"   r   )r   r#   r$   r   )r   r   r   r   6   s    zVerifyError.__init__)r	   r
   r   r   r   r   r   )r   r   r"   5   s   r"   c               @   s*   e Zd Zddd„Zdd„ Zedd„ ƒZdS )	ÚDependencyNeedsBuildingErrorNc             O   s²   || _ g | _|r|| _n~|pg | _xrt|ƒ ¡ D ]b}| d¡s@q0| d¡ d¡d }| j |¡ | 	¡  d¡d  d¡d  d¡d }| j |¡ q0W | js®t
d t|ƒ¡ƒ‚d S )	Nz  - z -> éÿÿÿÿú r   ú=ú[z+failed to parse packages from exception: {})ÚsubdirÚ
matchspecsÚpackagesr   Ú
splitlinesÚ
startswithÚlstripÚsplitÚappendÚstripÚRuntimeErrorr   )r   Zconda_exceptionr-   r+   r   r   ÚlineÚpkgr   r   r   r   >   s    

&z%DependencyNeedsBuildingError.__init__c             C   s   | j S )N)Úmessage)r   r   r   r   Ú__str__P   s    z$DependencyNeedsBuildingError.__str__c             C   s   d  | jt| jƒ¡S )Nz.Unsatisfiable dependencies for platform {}: {})r   r+   Úsetr,   )r   r   r   r   r7   S   s    z$DependencyNeedsBuildingError.message)NNN)r	   r
   r   r   r8   Úpropertyr7   r   r   r   r   r&   =   s   
r&   c               @   s   e Zd ZdS )ÚRecipeErrorN)r	   r
   r   r   r   r   r   r;   Y   s   r;   c               @   s   e Zd ZdZdS )ÚBuildLockErrorz* Raised when we failed to acquire a lock. N)r	   r
   r   Ú__doc__r   r   r   r   r<   ]   s   r<   c                   s   e Zd Z‡ fdd„Z‡  ZS )ÚOverLinkingErrorc                s&   || _ d| | _tt| ƒ | j¡ d S )Nzoverlinking check failed 
%s)r#   r%   r   r>   r   )r   r#   r   )r   r   r   r   b   s    
zOverLinkingError.__init__)r	   r
   r   r   r   r   r   )r   r   r>   a   s   r>   c                   s   e Zd Z‡ fdd„Z‡  ZS )ÚOverDependingErrorc                s&   || _ d| | _tt| ƒ | j¡ d S )Nzoverdepending check failed 
%s)r#   r%   r   r?   r   )r   r#   r   )r   r   r   r   i   s    
zOverDependingError.__init__)r	   r
   r   r   r   r   r   )r   r   r?   h   s   r?   )r   r   r   Ú	Exceptionr   r   r   r    r!   r"   r&   r;   r<   r4   r>   r?   r   r   r   r   Ú<module>   s   