HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/lib/python3/dist-packages/dotenv/__pycache__/cli.cpython-310.pyc
o

��a��@s�ddlZddlZddlmZddlmZmZmZzddlZWne	y2ej
�d�e�d�Ynwddl
mZmZmZmZddlmZe��ejdd	ej�e��d
�ejdd�d
d�ejddde�gd��dd�ejdddejdd�ejed�ejdejdedededdf
dd�������Ze� �ejdejddfd d!���Z!e� �ejej"d"dd#�ej"d$dd#�dejd"ed$eddfd%d&�����Z#e� �ejej"d"dd#�dejd"eddfd'd(����Z$e� �ejej"d"dd#�dejd"eddfd)d*����Z%ej d+did,�ejejd-dd.d/�ej"d0d1ej&d2�dejd3e'd0ee(ddfd4d5�����Z)d6ee(d7ee(e(fde*fd8d9�Z+e,d:k�r@e�dSdS);�N)�Popen)�Any�Dict�ListzkIt seems python-dotenv is not installed with cli option. 
Run pip install "python-dotenv[cli]" to fix this.�)�
dotenv_values�get_key�set_key�	unset_key)�__version__z-fz--filez.envT)�	file_okayzNLocation of the .env file, defaults to .env file in current working directory.)�default�type�helpz-qz--quote�always)r�never�autozbWhether to quote or not the variable values. Default mode is always. This does not affect parsing.z-ez--exportFz;Whether to write the dot file as an executable bash script.)�version�ctx�file�quote�export�returncCs(i|_||jd<||jd<||jd<dS)zAThis script is used to set, get or unset values from a .env file.�QUOTE�EXPORT�FILEN)�obj)rrrr�r�,/usr/lib/python3/dist-packages/dotenv/cli.py�clis

rcCsX|jd}tj�|�stjd||d��t|�}|��D]
\}}t�d||f�qdS)z!Display all the stored key/value.r�Path "%s" does not exist.�r�%s=%sN)	r�os�path�isfile�click�BadParameterr�items�echo)rr�dotenv_as_dict�k�vrrr�list%s
��r-�key)�required�valuecCsZ|jd}|jd}|jd}t|||||�\}}}|r't�d||f�dStd�dS)zStore the given key/value.rrrr"rN)rr	r&r)�exit)rr.r0rrr�successrrr�set4s


r3cCsP|jd}tj�|�stjd||d��t||�}|r"t�|�dStd�dS)z%Retrieve the value for the given key.rr r!rN)	rr#r$r%r&r'rr)r1)rr.r�stored_valuerrr�getDs
�
r5cCsF|jd}|jd}t|||�\}}|rt�d|�dStd�dS)zRemoves the given key.rrzSuccessfully removed %srN)rr
r&r)r1)rr.rrr2rrr�unsetVs

r6�ignore_unknown_options)�context_settingsz--override/--no-overridezKOverride variables from the environment file with those from the .env file.)r
r�commandline���)�nargsr�overridecsn|jd}tj�|�stjd||d���fdd�t|���D�}|s,t�d�t	d�t
||�}t	|�dS)	z/Run command with environment variables present.rz+Invalid value for '-f' "%s" does not exist.r!cs,i|]\}}|dur�s|tjvr||�qS)N)r#�environ)�.0r+r,�r<rr�
<dictcomp>ts
�zrun.<locals>.<dictcomp>zNo command given.rN)rr#r$r%r&r'rr(r)r1�run_command)rr<r9rr*�retrr?r�runds

�

�

rC�command�envcCs8tj��}|�|�t|ddd|d�}|��\}}|jS)awRun command in sub process.

    Runs the command in a sub process with the variables from `env`
    added in the current environment variables.

    Parameters
    ----------
    command: List[str]
        The command and it's parameters
    env: Dict
        The additional environment variables

    Returns
    -------
    int
        The return code of the command

    TrF)�universal_newlines�bufsize�shellrE)r#r=�copy�updater�communicate�
returncode)rDrE�cmd_env�p�_rrrrA�s

�rA�__main__)-r#�sys�
subprocessr�typingrrrr&�ImportError�stderr�writer1�mainrrr	r
rr�group�optionr$�join�getcwd�Path�Choice�BOOL�version_option�pass_context�ContextrrDr-�argumentr3r5r6�UNPROCESSED�bool�strrC�intrA�__name__rrrr�<module>sr�
�
�
�
,
$�("
"
�