관리-도구
편집 파일: interpreters.cpython-37.pyc
B �v6dN � @ sf d dl mZ d dl mZ d dl mZ d dlZd dlZd dlmZ G dd� de�Z ddd �Z d d� ZdS ) � )�print_function)�division)�absolute_importN)�ClSelectExceptc @ s0 e Zd Zd dd�Zdd� Zdd� Zddd �ZdS )�InterpreterNc C s� |dkrddl m} |� }|| _| �� | _| jr6d}nd}tj�| j|d�| _tj� | j�slt �d| j ��|| j d | _ dS ) z� :param prefix: mandatory prefix for nodejs root :param versions_info: optional precomputed dict with handy info about versions Nr )�scan_node_versions�binzusr/bin�nodezCannot find node binary: %s�full_version)�clselect.clselectnodejsr �prefix�_guess_version_by_prefixZis_venv�os�path�join�binary�isfiler �InterpreterError�version�version_full)�selfr � versions_infor Zfolder_� r �Y/opt/alt/python37/lib/python3.7/site-packages/clselect/clselectnodejsuser/interpreters.py�__init__ s zInterpreter.__init__c C s6 | j �d�rd}d}nd}d}t�|| j �d | _|S )Nz/opt/altFz/opt/alt/alt-nodejs(\d+)/rootTz.+/nodevenv/.+/(\d+)r )r � startswith�re�findallr )r �venv�patternr r r r 1 s z$Interpreter._guess_version_by_prefixc C s$ d| j j| j j| j| j| j| jf S )Nz@%s.%s(prefix='%s', version='%s', binary='%s', version_full='%s'))� __class__� __module__�__name__r r r r )r r r r �__repr__>