U
    e³“e-  ã                   @   sL   d dl mZ d dlmZ d dlZd dlmZ d dlmZ dd„ Z	dd	„ Z
dS )
é    )Úimport_module)ÚenvironN)ÚVersion)Ú'check_and_install_default_prerequisitesc               	   C   sö   d} ddddg}|D ]È}t |tƒr,|\}}nd}zt|ƒ W nD tk
r€   |dkrhtd |¡ƒ d} ntd	 ||¡ƒ d} Y qX |dkrŒqztj| j}W n t	k
r´   Y qY nX t
|ƒt
|ƒk rtd
 |||¡ƒ d} q| sòtdƒ tdƒ dS )zõ
    Check if the Python requirements are installed. This must appears
    before other imports because otherwise they're imported elsewhere.

    Using the ok check instead of failing immediately so that all
    errors are printed at once.
    T)Úcoloramaz0.3.3Úappdirs)Úshz1.10Zjinja2NzBERROR: The {} Python module could not be found, please install it.FzSERROR: The {} Python module could not be found, please install version {} or higherzBERROR: {} version is {}, but python-for-android needs at least {}.z<python-for-android is exiting due to the errors logged aboveé   )Ú
isinstanceÚtupler   ÚImportErrorÚprintÚformatÚsysÚmodulesÚ__version__ÚAttributeErrorr   Úexit)Úokr   ÚmoduleÚversionZcur_ver© r   úF/tmp/pip-unpacked-wheel-h4dze4ss/pythonforandroid/checkdependencies.pyÚcheck_python_dependencies   sR    	

ÿÿ þÿ

  ÿÿr   c                   C   s    t  dd¡dkstƒ  tƒ  d S )NZSKIP_PREREQUISITES_CHECKÚ0Ú1)r   Úgetr   r   r   r   r   r   ÚcheckC   s    r   )Ú	importlibr   Úosr   r   Zpackaging.versionr   Zpythonforandroid.prerequisitesr   r   r   r   r   r   r   Ú<module>   s   7