관리-도구
편집 파일: selector_manager.cpython-37.pyc
B �v6d� � @ s� d dl mZ d dl mZ d dl mZ d dlZd dlmZ d dlmZ d dl m Z mZ dd lm Z dd lmZ d dlmZ G dd � d eee��ZdS )� )�absolute_import)�print_function)�divisionN)�ABCMeta)� iteritems)�ENABLED_STATUS�NOT_INSTALLED_STATUS� )�BaseSelectorConfig)�BasePkgManager)�with_metaclassc @ sp e Zd ZdZdd� Zedd� �Zejdd� �Zedd� �Zd d � Z dd� Z d d� Zdd� Zdd� Z ddd�ZdS )�BaseSelectorManagerz:Responsible for actual interpreter selector high-level APIc C s || _ || _t�� dk| _dS )zc :type cfg: config.BaseSelectorConfig :type pkg: pkgmanager.BasePkgManager r N)�pkg�cfg�os�geteuid�is_root_user)�selfr r � r �W/opt/alt/python37/lib/python3.7/site-packages/clselect/baseclselect/selector_manager.py�__init__ s zBaseSelectorManager.__init__c C s | j jS )N)r �selector_enabled)r r r r r $ s z$BaseSelectorManager.selector_enabledc C s || j _| j �� d S )N)r r �save)r �valr r r r ( s c C s | j �� S )N)r �get_default_version)r r r r �default_version- s z#BaseSelectorManager.default_versionc C s | j �|� | j �� d S )N)r Zset_default_versionr )r �versionr r r �switch_default_version1 s z*BaseSelectorManager.switch_default_versionc C s | j �||� | j �� dS )z6Disable/Enable particular interpreter version globallyN)r �set_version_statusr )r r �statusr r r r 5 s z&BaseSelectorManager.set_version_statusc C s dd� t | jj�D �}||kS )z7Check whether particular (installed) version is enabledc S s g | ]\}}|d t kr|�qS )r )r )�.0�k�vr r r � <listcomp><