Edit File: depends.cpython-36.pyc
3 U('d�������������������@���s����d�dl�Z�d�dlZd�dlZd�dlmZ�d�dlmZmZmZmZ�ddl m Z �dddd gZG�d d��d�Zddd�Z ddd�Zdd d �Zdd��Ze���dS�)�����N)� StrictVersion)� PKG_DIRECTORY�PY_COMPILED� PY_SOURCE� PY_FROZEN����)�Bytecode�Require�find_module�get_module_constant�extract_constantc���������������@���sH���e�Zd�ZdZddd�Zdd��Zdd ��Zddd�Zdd d�Zddd�Z dS�)r ���z7A prerequisite to building or installing a distribution��Nc�������������C���sF���|d�kr|d�k rt�}|d�k r0||�}|d�kr0d}|�jjt����|�`d�S�)N�__version__)r����__dict__�update�locals�self)r����name�requested_version�moduleZhomepage� attribute�format��r����/usr/lib/python3.6/depends.py�__init__���s����zRequire.__init__c�������������C���s ���|�j�dk rd|�j|�j�f�S�|�jS�)z0Return full package/distribution name, w/versionNz%s-%s)r���r���)r���r���r���r���� full_name ���s���� zRequire.full_namec�������������C���s*���|�j�dkp(|�jdkp(t|�dko(||�jkS�)z%Is 'version' sufficiently up-to-date?N�unknown)r���r����strr���)r����versionr���r���r���� version_ok&���s����zRequire.version_okr���c���������� ���C���s|���|�j�dkrBy"t|�j|�\}}}|r*|j���|S��tk r@���dS�X�t|�j|�j�||�}|dk rx||k rx|�jdk rx|�j|�S�|S�)a���Get version number of installed module, 'None', or 'default' Search 'paths' for module. If not found, return 'None'. If found, return the extracted version attribute, or 'default' if no version attribute was specified, or the value cannot be determined without importing the module. The version is formatted according to the requirement's version format (if any), unless it is 'None' or the supplied 'default'. N)r���r ���r����close�ImportErrorr���r���)r����paths�default�f�p�i�vr���r���r����get_version+���s���� zRequire.get_versionc�������������C���s���|�j�|�dk S�)z/Return true if dependency is present on 'paths'N)r(���)r���r"���r���r���r���� is_presentF���s����zRequire.is_presentc�������������C���s ���|�j�|�}|dkrdS�|�j|�S�)z>Return true if dependency is present and up-to-date on 'paths'NF)r(���r���)r���r"���r���r���r���r���� is_currentJ���s���� zRequire.is_current)r ���NN)Nr���)N)N) �__name__� __module__�__qualname__�__doc__r���r���r���r(���r)���r*���r���r���r���r���r ������s���� c������� ������C���sl���|�j�d�}x\|rf|jd�}tj||��\}}\}}}} |tkrP|pFdg}|g}q|rtd||�f���qW�| S�)z7Just like 'imp.find_module()', but with package support�.r���r���zCan't find %r in %s)�split�pop�impr ���r���r!���) r���r"����parts�partr$����path�suffix�mode�kind�infor���r���r���r ���R���s���� c������� ������C���s����yt�|�|�\}}\}}}W�n�tk r.���dS�X�z�|tkrP|jd��tj|�} n`|tkrdtj|��} nL|t kr~t |j��|d�} n2|�tjkr�tj |�|||||f��ttj|��|d�S�W�d|r�|j���X�t| ||�S�)z�Find 'module' by searching 'paths', and extract 'symbol' Return 'None' if 'module' does not exist on 'paths', or it does not define 'symbol'. If the module defines 'symbol' as a constant, return the constant. Otherwise, return 'default'.N�����exec)r ���r!���r����read�marshal�loadr���r2����get_frozen_objectr����compile�sys�modules�load_module�getattrr ���r���) r����symbolr#���r"���r$���r5���r6���r7���r8����coder���r���r���r���e���s$���� c�������������C���s����||�j�krdS�t|�j��j|�}d}d}d}|}xPt|��D�]D}|j} |j} | |kr\|�j| �}q8| |krx| |kst| |krx|S�|}q8W�dS�)a��Extract the constant value of 'symbol' from 'code' If the name 'symbol' is bound to a constant value by the Python code object 'code', return that value. If 'symbol' is bound to an expression, return 'default'. Otherwise, return 'None'. Return value is based on the first assignment to 'symbol'. 'symbol' must be a global, or at least a non-"fast" local in the code block. That is, only 'STORE_NAME' and 'STORE_GLOBAL' opcodes are checked, and 'symbol' must be present in 'code.co_names'. N�Z����a����d���)�co_names�list�indexr���Zopcode�arg� co_consts)rF���rE���r#���Zname_idxZ STORE_NAMEZSTORE_GLOBALZ LOAD_CONST�constZ byte_code�oprM���r���r���r���r�������s���� c��������������C���sD���t�jjd��rt�jdkrdS�d}�x|�D�]}t��|=�tj|��q&W�dS�)z� Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. �javaZcliNr���r���)r���r���)rA����platform� startswith�globals�__all__�remove)Zincompatibler���r���r���r����_update_globals����s���� rW���)N���)rX���NrX���)rX���)rA���r2���r=���Zdistutils.versionr���r���r���r���r���Z py33compatr���rU���r ���r ���r���r���rW���r���r���r���r����<module>���s���C " $