Your IP : 216.73.217.79


Current Path : /lib/python3/dist-packages/dotenv/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/dotenv/__pycache__/cli.cpython-311.pyc

�

�%c���ddlZddlZddlZddlZddlmZddlmZmZm	Z		ddl
Z
n5#e$r-ej�
d��ejd��YnwxYwddlmZmZmZmZddlmZe
j��e
jdd	ej�ej��d
��e
jd���d
���e
jddde
jgd���d���e
jddde
jd���e
je���e
jde
j dedededdf
d�������������Z!e!�"��e
je
jdd e
jgd!���d"���de
j d#e#ddfd$�������Z$e!�"��e
je
j%d%d�&��e
j%d'd�&��de
j d%ed'eddfd(���������Z&e!�"��e
je
j%d%d�&��de
j d%eddfd)�������Z'e!�"��e
je
j%d%d�&��de
j d%eddfd*�������Z(e!�"d+di�,��e
je
jd-dd.�/��e
j%d0d1e
j)�2��de
j d3e#d0e	e*ddfd4���������Z+d5e	e*d6ee*e*fde,fd7�Z-dS)8�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�returnc�P�i|_||jd<||jd<||jd<dS)zAThis script is used to set, get or unset values from a .env file.�QUOTE�EXPORT�FILEN)�obj)rrrrs    �,/usr/lib/python3/dist-packages/dotenv/cli.py�clir s2���C�G��C�G�G���C�G�H���C�G�F�O�O�O�z--format�simple)r"�json�shellrzlThe format in which to display the list. Default format is simple, which displays name=value without quotes.�formatc���|jd}tj�|��st	jd|z|����t
|��}|dkr+t	jtj	|dd�����dS|dkrd	nd
}t|��D]?}||}|�3|dvrtj|��}t	j|�|�d
|�����@dS)z!Display all the stored key/value.r�Path "%s" does not exist.�rr#�T)�indent�	sort_keysrzexport �N)rr$�=)
r�os�path�isfile�click�BadParameterr�echor#�dumps�sorted�shlexr)rr%r�dotenv_as_dict�prefix�k�vs       r�listr;'s���7�6�?�D�
�7�>�>�$���
�� �'�4�0��
�
�
�	
�#�4�(�(�N�
����
�
�4�:�n�Q�$�G�G�G�H�H�H�H�H�$��0�0���b����'�'�	7�	7�A��q�!�A��}��0�0�0���A���A��
������1�1�5�6�6�6��	7�	7r!�key)�required�valuec���|jd}|jd}|jd}t|||||��\}}}|rtj|�d|����dSt	d��dS)zStore the given key/value.rrrr-rN)rr
r1r3�exit)rr<r>rrr�successs       r�setrBBs{���7�6�?�D��G�G��E�
�W�X�
�F�!�$��U�E�6�B�B��G�S�%���
�
�c�c�c�5�5�)�*�*�*�*�*��Q�����r!c��|jd}tj�|��st	jd|z|����t
||��}|rt	j|��dStd��dS)z%Retrieve the value for the given key.rr'r(rN)	rr.r/r0r1r2r	r3r@)rr<r�stored_values    r�getrERs���
�7�6�?�D�
�7�>�>�$���
�� �'�4�0��
�
�
�	
��4��%�%�L���
�
�<� � � � � ��Q�����r!c��|jd}|jd}t|||��\}}|rtjd|z��dSt	d��dS)zRemoves the given key.rrzSuccessfully removed %srN)rrr1r3r@)rr<rrrAs     r�unsetrGdsc��
�7�6�?�D��G�G��E��T�3��.�.�L�G�S���
�
�,�s�2�3�3�3�3�3��Q�����r!�ignore_unknown_options)�context_settingsz--override/--no-overridezKOverride variables from the environment file with those from the .env file.)rr�commandline���)�nargsr�overridec�t��|jd}tj�|��st	jd|z|�����fd�t
|�����D��}|s#t	jd��td��t||��}t|��dS)z/Run command with environment variables present.rz+Invalid value for '-f' "%s" does not exist.r(c�@��i|]\}}|��s|tjv�||��S)N)r.�environ)�.0r9r:rMs   �r�
<dictcomp>zrun.<locals>.<dictcomp>�s>�������Q���=�h�=�!�2�:�*=�*=�	
�1�*=�*=�*=r!zNo command given.rN)rr.r/r0r1r2r�itemsr3r@�run_command)rrMrJrr7�rets `    r�runrVrs�����7�6�?�D�
�7�>�>�$���
�� �;�t�D��
�
�
�	
�����#�D�)�)�/�/�1�1����N���
�
�&�'�'�'��Q����
�k�>�
2�
2�C���I�I�I�I�Ir!�command�envc���tj���}|�|��t	|ddd|���}|���\}}|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�bufsizer$rX)r.rP�copy�updater�communicate�
returncode)rWrX�cmd_env�p�_s     rrTrT�sd��*�j�o�o���G��N�N�3����
�g�!%����		�	�	�A�

�=�=�?�?�D�A�q��<�r!).r#r.r6�sys�
subprocessr�typingrrrr1�ImportError�stderr�writer@�mainrr	r
rrr�group�optionr/�join�getcwd�Path�Choice�BOOL�version_option�pass_context�Contextr rW�boolr;�argumentrBrErG�UNPROCESSED�strrV�intrT�r!r�<module>rzs������	�	�	�	�����
�
�
�
�������"�"�"�"�"�"�"�"�"�"���L�L�L�L�������J���I�J�J�J��C�H�Q�K�K�K�K�K�����
=�<�<�<�<�<�<�<�<�<�<�<� � � � � � �
�����
���d�H�b�g�l�l�9�2�9�;�;��&G�&G��5�:��-�-�-�c�e�e�e����d�I�x��5�<� ;� ;� ;�<�<�w�y�y�y����d�J���:�P�R�R�R����k�*�*�*����U�]��#��c��3��4������+�*�R�R�y�y�e�e�����������
���j�(��5�<� E� E� E�F�F�?�@�@�@�7�e�m�7�T�7�d�7�7�7�	@�@�����7�*������������%�%�%�����$�'�'�'�	�U�]�	��	�S�	�T�	�	�	�(�'�&�%�����	�������������%�%�%��U�]��������&�%������������������%�%�%��u�}��3��4����&�%���������7��>��?�?���
�����	V����
���
�R�e�.?�@�@�@��U�]��d���c���t����A�@�����@�?��*��c����c�3�h���C������s�'�/A�A