관리-도구
편집 파일: clselectctlruby.cpython-37.pyc
B �v6dYJ � @ sj d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl mZ ddlm Z ddlmZ dd lmZ dd lmZ ddlmZmZ ddlmZmZmZ d d lmZmZmZ d dlmZmZ dZ dd� Z!d0dd�Z"d1dd�Z#dd� Z$d2dd�Z%d3dd�Z&dd� Z'dd� Z(d d!� Z)d"d#� Z*d$d%� Z+d&d'� Z,d4d(d)�Z-d*d+� Z.d,d-� Z/d.d/� Z0dS )5� )�print_function)�absolute_import)�divisionN)� iteritems� )�clpassenger)�clselectctl)�utils)�clprint)�ClSelectExcept�BaseClSelectException)�environments� extensions�interpreters)�userdomains�docroot�CP_NAME)�NoDomain�NotSupported�rubyc C s� t d� t d� t d� t d� t d� t d� t d� t d� t d � t d � t d� t d� t d � t d� t d� t d� t d� t d� t d� t d� t d� t d� d S )NzB -v | --version VERSION : Specify alternative versionz/ -u | --user USERNAME : UsernamezZ --domain DOMAIN : Domain (or subdomain); users main domain as defaultzH -l | --list : List alternatives for interpreterzB -G | --list-extensions : List global set of packageszC -K | --list-extensions-version : List version set of packageszC -s | --user-summary : List user summary of webappsz9 -y | --create-webapp : Create user webappz: -n | --destroy-webapp : Destroy user webappz] -f | --relocate-webapp : Change webapp directory (files must be moved manually)zA -F | --transit-webapp : Change webapp domain/aliasz5 -Z | --restart-webapp : Restart webappzZ -c | --user-current : Show currently selected alternative for user webappzM -b | --set-user-current : Set alternative as user webapp defaultz[ -e | --enable-user-extensions GEMS : Install comma-separated list of gems for user webappz] -d | --disable-user-extensions GEMS : Uninstall comma-separated list of gems for user webappzC : Use '-' (minus) for all gemszZ -r | --replace-user-extensions GEMS : Update comma-separated list of gems for user webappzJ -g | --list-user-extensions : List installed gems for user webappzi -p | --print-summary : If specified along with setting an alternative prints user summaryz9 -j | --json : Print data as JSON)�print� r r �I/opt/alt/python37/lib/python3.7/site-packages/clselect/clselectctlruby.py�usage s, r c C sj t | |�}|s|}t�|| |�}|�� sfytjdd�| }W n tk rZ t�|��Y nX |�|� |S )N�version)�key) �_get_prefixr �Environment�existsr �KeyErrorr �NoSuchAlternativeVersion�create)�user� directoryr �env_name�prefix�environment�interpreterr r r �_create_environment8 s r( c C sn t | |�}|d kr8t�| �}|�|�}|s8t�d| ��|d }tj�tj� tj� |���}t �|| |�}|S )Nz8No such application (or application not configured) "%s"�binary)r r �summary�getr �NoSuchApplication�os�path�basename�dirnamer r )r"