관리-도구
편집 파일: nodeenv.cpython-38.pyc
U )�eg� � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlZz0ddlmZ ddlZe �d�ZddlZejZW nH ek �r ddlmZ ddlmZ e �d�ZddlZej jZY nX ddl!m"Z" dZ#ej$j%Z%ej$j&Z&da'ej(d d kZ)e�*� d kZ+e�*� �,d�Z-da.d d� Z/G dd� de0�Z1e2dd� ee3e1��D ��e1_4dd� Z5dd� Z6dd� Z7dd� Z8e8� Z9dd� Z:dldd�Z;d d!� Z<d"d#� Z=dmd$d%�Z>dnd&d'�Z?d(d)� Z@d*d+� ZAd,d-� ZBd.d/� ZCd0d1� ZDejEd2d3� �ZFdod4d5�ZGd6d7� ZHd8d9� ZIdpd:d;�ZJd<d=� ZKd>d?� ZLd@dA� ZMdBdC� ZNdDdE� ZOdFdG� ZPdHdI� ZQdJdK� ZRdLdM� ZSdNdO� ZTdPdQ� ZUdRdS� ZVdTdU� ZWdVdW� ZXdXdY� ZYdZd[� ZZd\d]� Z[d^d_d`�Z\dadbd`�Z]dcZ^ddZ_deZ`dfZadgZbdhZcdiZddjZeefdkk�re[� dS )qz� nodeenv ~~~~~~~ Node.js virtual environment :copyright: (c) 2014 by Eugene Kalinin :license: BSD, see LICENSE for more details. � N)�SafeConfigParser� iteritems)�ConfigParser�items)� parse_versionz1.8.0� �Windows)ZCYGWINZMSYSFc C s� | rt r| S z| �d�W S tk r� z| �d� | W Y S tk r� z| �d��d�W Y Y S tk rz Y nX Y nX Y nX | S )z:Convert given text to UTF-8 encoding (as far as possible).�utf8�cp1252)�is_PY3�encode�UnicodeDecodeError�decode)�text� r �5/opt/hc_python/lib/python3.8/site-packages/nodeenv.py�to_utf8C s r c @ sV e Zd ZdZdZdZdZdZdZdZ dZ dZdZdZ dZeddd ��Zed d� �ZdS ) �Configz" Configuration namespace. �latestF�2�makeTNc C s t |�D ]�}tj�|�}tj�|�s&qt� }|�|� d}|�|�sFqtt | ��D ]n\}}|� d�sR|�||�srqRt|t �r�|�||�}n|�||�}|r�td�tj�|�||�� t| ||� qRqtj�d��rtdd�� }t| d|�d�d �� � W 5 Q R X d S ) z� Load configuration from the given files in reverse order, if they exist and have a [nodeenv] section. Additionally, load version from .node-version if file exists. �nodeenv�_zCONFIG {0}: {1} = {2}z .node-version�r�node� r N)�reversed�os�path� expanduser�existsr �read�has_sectionr �vars� startswith� has_option� isinstance�bool� getboolean�get�print�format�basename�setattr�open� readlines�strip) �clsZconfigfiles�verboseZ configfileZini_file�section�attr�valZv_filer r r �_loadi s6 � �zConfig._loadc C s4 t d� t dd�dd� ttt| ���D �� � dS )z0 Print defaults for the README. z [nodeenv]z z c s s( | ] \}}|� d �sd||f V qdS )r z%s = %sN�r$ )�.0�k�vr r r � <genexpr>� s �zConfig._dump.<locals>.<genexpr>N)r* �join�sortedr r# )r1 r r r �_dump� s �zConfig._dump)F)�__name__� __module__�__qualname__�__doc__r �npm�with_npm�jobs�without_ssl�debug�profiler �prebuilt�ignore_ssl_certs�mirror�classmethodr6 r>