Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
main.cpython-313.pyc192 linesDownload Raw Back to __pycache__
1�

2s�j[9��B�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSK	J3r4 SSKJrJ
r
JrJrJrJrJrJr SSKJrJr SSKJr \\S4r\R6"\5rS	\4S5jrS\\S	\\4Sjr "S
S5r!S+S\S\S\\S	\\4Sjjr"\6S,S\S\\S\S	\\\\\\44Sjj5r#S-S\S\S\S\S\S\\S\S	\\\\\44Sjjr$S.S\S\S\S\\S\S	\\\\44Sjjr%S\\\\\4S\S	\\\\44Sjr&S\S	\\4S jr'S/S!\S"\S#\S	\4S$jjr(S0S\\S%\\\S&\S\S'\S\\S	\4S(jjr)S1S\\S%\\\S&\S'\S\\S	\
\\\44S)jjr*S\S	\4S*jr+g)2�N)�OrderedDict)�contextmanager)�IO�Dict�Iterable�Iterator�Mapping�Optional�Tuple�Union�)�Binding�parse_stream)�parse_variableszos.PathLike[str]�returnc�x�S[R;ag[RSR5nUS;$)z07Determine if dotenv loading has been disabled.8�PYTHON_DOTENV_DISABLEDF>�1�t�y�yes�true)�os�environ�casefold)�values �QD:\code\apps\devtools\python\user_packages\Python313\site-packages\dotenv/main.py�_load_dotenv_disabledrs7�� �r�z�z�1���J�J�/�0�9�9�;�E��2�2�2��mappingsc#�# �UHBnUR(a*[RSURR5 Uv� MD g7f)Nz;python-dotenv could not parse statement starting at line %s)�error�logger�warning�original�line)r �mappings  r�with_warn_for_invalid_linesr( s;������=�=��N�N�M�� � �%�%�
��
�
�s�A9Ac���\rSrSrSS\\S\\\S\S\\S\S\S	S4S10jjr	\11S	\\\4Sj5rS	\
\\\44SjrS	\\\\\44S
jrS	\4SjrS\S	\\4SjrSrg)�DotEnv�*N�dotenv_path�stream�verbose�encoding�interpolate�overriderc�Z�XlX lSUlX0lX@lXPlX`lg�N)r,r-�_dictr.r/r0r1)�selfr,r-r.r/r0r1s       r�__init__�DotEnv.__init__+s+��/:��)/��9=��12�$��'/�
�!,��&�
rc#�# �UR(aF[UR5(a,[URURS9nUv� SSS5 gURbURv� gUR13(a)[RSUR=(d S5 [R"S5v� g!,(df   g=f7f)N�r/z3python-dotenv could not find configuration file %s.�.env�)14r,�_is_file_or_fifo�openr/r-r.r#�info�io�StringIO)r5r-s  r�_get_stream�DotEnv._get_stream<s������� 0��1A�1A� B� B��d�&�&����?�6���@�?�
�[�[�
$��+�+���|�|����I��$�$�.����+�+�b�/�!�@�?�s�A15C�C	�A8C�	16C�Cc��UR(aUR$UR5nUR(a-[[	XR17S95UlUR$[U5UlUR$)zReturn dotenv as dict)r1)r4�parser0r�resolve_variablesr1)r5�18raw_valuess  r�dict�DotEnv.dictKsc���:�:��:�:���Z�Z�\�19����$�!�*�}�}�E��D�J��z�z��%�Z�0�D�J��z�z�rc#��# �UR5n[[U55H,nURcMURUR4v� M. SSS5 g!,(df   g=f7fr3)rAr(r�keyr)r5r-r's   rrD�DotEnv.parse[sP���
�
�
�
�6�6�|�F�7K�L���;�;�*�!�+�+�w�}�}�4�4�M� �
�
�s!�A2�#A!�A!�	A2�!20A/�+A2c���UR5(dgUR5R5HDupU[R;aUR(dM,UcM1U[RU'MF g)z921Load the current dotenv as system environment variable.22FT)rG�itemsrrr1)r5�k�vs   r�set_as_environment_variables�#DotEnv.set_as_environment_variablesasX���y�y�{�{���I�I�K�%�%�'�D�A��B�J�J��t�}�}���}� !��23�24�1�
�	(�rrJc��UR5nX;aX!$UR(a [RSXR5 g)r;zKey %s not found in %s.N)rGr.r#r$r,)r5rJ�datas   r�get�25DotEnv.getps9���y�y�{���;��9���<�<��N�N�4�c�;K�;K�L�r)r4r,r/r0r1r-r.)NFNTT)�__name__�26__module__�__qualname__�__firstlineno__r27�StrPathr�str�boolr6rrrArrGrrDrPrT�__static_attributes__�rrr*r**s���%)��"&� ��'��g�&�'���C��!�'��	'�28�3�-�'��
'��'�29�'�"�"�X�b��g�.�"��"��d�3���
�-�.�� 5�x��c�8�C�=�&8� 9�:�5�
�d�
�30�s�31�x��}�32rr*r,�33key_to_getr/c�6�[USUS9RU5$)zs34Get the value of a given key from the given .env.35 36Returns `None` if the key isn't found or doesn't have a value.37T)r.r/)r*rT)r,r_r/s   r�get_keyra}s���+�t�h�?�C�C�J�O�Or�path�follow_symlinksc#�# �U(a[RRU5n[XS9n[R"U5n[38R"UR5(a [39R"UR5OSn[R"SUSS[RR![RR#U55S9n[$R&"UR(5nSnU X64v� SSS5 SSS5 Wc3Ub[R*"WU5 [R,"WU5 gWR/SS9 USe![a UR5 ef=f![a [R"S5nSnGNf=f!,(df   N�=f![an	U	nSn	A	N�Sn	A	ff=f!,(df   N�=f![a WR/SS9 ef=f7f)	Nr9r;�wFz.tmp_)�moder/�delete�prefix�dirT)�40missing_ok)rrb�realpathr=�lstat�stat�S_ISREG�st_mode�S_IMODE�
BaseException�close�FileNotFoundErrorr?r@�tempfile�NamedTemporaryFile�dirname�abspath�pathlib�Path�name�chmod�replace�unlink)41rbr/rc�source�	path_stat�
original_mode�dest�	dest_pathr"�errs42          r�rewriter��s������w�w����%����t�7��		������I��<�<�	� 1� 1�2�2����Y�.�.�/��
�43�	$�	$�
�����G�G�O�O�B�G�G�O�O�D�1�2�44�45��L�L����+�	���	���n�$��46� 
�}�	��(�����M�2��J�J�y�$�'�47	���D��)�����E�	��L�L�N��	�������R����
�������	��E��	��48�49��,�	������-��	�s��'H�	F�AE'�AH�##G�G�	F/�G�H�#1G*�H�'F�F�"F,�(H�+F,�,H�/50F=	�9G�<G�=G�51G�52G�G�G�G�53G'�#H�*H�H�54key_to_set�value_to_set�55quote_mode�exportc���US;a[SU35eUS:H=(d! US:H=(a UR5(+nU(a"SRURSS55nOUnU(a56SUS	US573n	OUS	US583n	[	XUS9un59nSnSn
[[
U6055HwnURU:XaURU	5 S
nM(URURR5 URRRS615(+n
My U(d)U
(aURS625 URU	5 SSS5 S
X4$!,(df   N=f)a;63Adds or Updates a key/value to the given .env64 65The target .env file is created if it doesn't exist.66 67This function doesn't follow symlinks by default, to avoid accidentally68modifying a file at a potentially untrusted path. If you don't need this69protection and need symlinks to be followed, use `follow_symlinks`.70)�always�auto�neverzUnknown quote_mode: r�r�z'{}'�'z\'zexport �=�71�r/rcFTN)�72ValueError�isalnum�formatr|r�r(rrJ�writer%�string�endswith)r,r�r�r�r�r/rc�quote�	value_out�line_outr~r��replaced�missing_newliner's               r�set_keyr��s_��$�4�4��/�73�|�<�=�=��(�"�
��f��;�\�%9�%9�%;�!;�74�
��M�M�,�"6�"6�s�E�"B�C�	� �	�
��Z�L��)��B�7�� �\��9�+�R�0��	���	Q�V�������2�<��3G�H�G��{�{�j�(��75�76�8�$����77�78�7�+�+�2�2�3�&-�&6�&6�&=�&=�&F�&F�t�&L�"L��
I����79�80�4� ��J�J�x� �!81R�$��)�)�%82R�	Q�s
�CE#�#83E1�key_to_unsetc���[RRU5(d[R	SU5 SU4$Sn[XUS9unn[
[U55H<nURU:XaSnMURURR5 M> SSS5 U(d[R	SX5 SU4$XQ4$!,(df   N2=f)ah84Removes a given key from the given `.env` file.85 86If the .env path given doesn't exist, fails.87If the given key doesn't exist in the .env, fails.88 89This function doesn't follow symlinks by default, to avoid accidentally90modifying a file at a potentially untrusted path. If you don't need this91protection and need symlinks to be followed, use `follow_symlinks`.92z(Can't delete from %s - it doesn't exist.NFr�Tz/Key %s not removed from %s - key doesn't exist.)rrb�existsr#r$r�r(rrJr�r%r�)	r,r�r�r/rc�removedr~r�r's	         r�	unset_keyr��s���"�7�7�>�>�+�&�&����A�;�O��\�!�!��G�	���	Q�V���2�<��3G�H�G��{�{�l�*����93�94�7�+�+�2�2�3�	I�	95R�����=�|�	96��\�!�!�� � �!97R�	Q�s
�AC�98C�valuesr1c�V^�0nUH�up4UcSnO�[U5n0mU(a1TR[R5 TRU5 O0TRU5 TR[R5 SR	U4SjU55nXRU'M� U$)Nr;c3�D># �UHoRT5v� M g7fr3)�resolve)�.0�atom�envs  �r�	<genexpr>�$resolve_variables.<locals>.<genexpr>3s����A�5�4�\�\�#�.�.�5�s� )r�updaterr�join)r�r1�99new_valuesrzr�result�atomsr�s       @rrErE!s����,.�J�����=��F�#�E�*�E�,.�C���100�101�2�:�:�&��102�103�:�&��104�105�:�&��106�107�2�:�:�&��W�W�A�5�A�A�F�!�4��� �rc#�# �[RRU5(d[S5e[RR	U5(a[RRU5nSn[RR
U5nX:wacUv� [RR
[RRU[RR55nX#p!X:waMbgg7f)zD108Yield directories starting from the given directory up to the root109zStarting path not foundN)	rrbr��IOError�isfilervrwr��pardir)rb�last_dir�current_dir�110parent_dirs    r�
_walk_to_rootr�:s�����7�7�>�>�$����/�0�0�	�w�w�~�~�d����w�w���t�$���H��'�'�/�/�$�'�K�111�112!����W�W�_�_�R�W�W�\�\�+�r�w�w�~�~�%N�O�113� +�+��114!�s�C9C?�=C?�filename�raise_error_if_not_found�usecwdc��SnSnU(d.U"5(d"U"5(d[[SS5(a[R"5nGO0[R"5n[115nURRU:Xd8[RRURR5(dqURceURnURRU:XaM7[RRURR5(dMqURRn[RR[RRU55n[U5H6n	[RRX�5n116[U1175(dM4U118s $ U(a[!S5eg)z{119Search in increasingly higher folders for the given file120 121Returns path to the file if found, or an empty string otherwise122c��[[S5(d[[S5(ag[SSSS/S9n[US5(+$![a gf=f)	z<Decide whether this is running in a REPL or IPython notebook�ps1�ps2T�__main__N�__file__)�fromlistF)�hasattr�sys�123__import__�ModuleNotFoundError)�mains r�_is_interactive�$find_dotenv.<locals>._is_interactiveWs[���3����'�#�u�"5�"5��	��j�$��124�|�L�D��4��,�,�,��#�	��	�s�
A�125A�Ac�0�[R"5SL$r3)r��gettracer^rr�_is_debugger�!find_dotenv.<locals>._is_debuggeras���|�|�~�T�)�)r�frozenFzFile not foundr;)�getattrr�r�getcwd�	_getframer��f_code�co_filenamerbr��f_backrvrwr�r�r<r�)r�r�r�r�r�rb�frame�current_file�frame_filenamerv�126check_paths           r�find_dotenvr�LsC��-�*���"�"�l�n�n���X�u�8U�8U��y�y�{���
�
������l�l�&�&�,�6�b�g�g�n�n��L�L�$�$�?127�?128��<�<�+�+�+��L�L�E�	�l�l�&�&�,�6�b�g�g�n�n��L�L�$�$�?129�?130�131���1�1���w�w���r�w�w���~�>�?�� ��&���W�W�\�\�'�4�132��J�'�'���'�133 ��&�'�'�
rr-r.r0c	��[5(a[RS5 gUc
Uc134[5n[	UUUUUUS9nUR5$)a�Parse a .env file and then load all the variables found as environment variables.135 136Parameters:137    dotenv_path: Absolute or relative path to .env file.138    stream: Text stream (such as `io.StringIO`) with .env content, used if139        `dotenv_path` is `None`.140    verbose: Whether to output a warning the .env file is missing.141    override: Whether to override the system environment variables with the variables142        from the `.env` file.143    encoding: Encoding to be used to read the file.144Returns:145    Bool: True if at least one environment variable is set else False146 147If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the148.env file with it's default parameters. If you need to change the default parameters149of `find_dotenv()`, you can explicitly call `find_dotenv()` and pass the result150to this function as `dotenv_path`.151 152If the environment variable `PYTHON_DOTENV_DISABLED` is set to a truthy value,153.env loading is disabled.154zSpython-dotenv: .env loading disabled by PYTHON_DOTENV_DISABLED environment variableF�r,r-r.r0r1r/)rr#�debugr�r*rP)r,r-r.r1r0r/�dotenvs       r�load_dotenvr�s_��:������a�	155����v�~�!�m��
�������
�F��.�.�0�0rc	�Z�Uc
Uc156[5n[UUUUSUS9R5$)aa157Parse a .env file and return its content as a dict.158 159The returned dict will have `None` values for keys without values in the .env file.160For example, `foo=bar` results in `{"foo": "bar"}` whereas `foo` alone results in161`{"foo": None}`162 163Parameters:164    dotenv_path: Absolute or relative path to the .env file.165    stream: `StringIO` object with .env content, used if `dotenv_path` is `None`.166    verbose: Whether to output a warning if the .env file is missing.167    encoding: Encoding to be used to read the file.168 169If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the170.env file.171Tr�)r�r*rG)r,r-r.r0r/s     r�
dotenv_valuesr��s=��.��v�~�!�m���������
��d�f�
rc���[RRU5(ag[R"U5n[R"UR5$![[1724a gf=f)zF173Return True if `path` exists and is either a regular file or a FIFO.174TF)rrbr�rmrs�OSError�S_ISFIFOro)rb�sts  rr<r<�sZ��175�w�w�~�~�d�����
�W�W�T�]���=�=����$�$��
�w�'����s�A�A0�/A0)�utf-8)F)r�Fr�F)r�r�F)r:FF)NNFFTr�)NNFTr�),r?�loggingrrxrmr�rt�collectionsr�176contextlibr�typingrrrrr	r177rr�parserrr�	variablesrr[rZ�	getLoggerrVr#r\rr(r*rar�r�r�rEr�r�r�r�r<r^rr�<module>r�sf��	��	���178��#�%�P�P�P�)�&���'�'�179(��	�	�	�8�	$��3�t�3��(�7�*;����@Q��P�P�l&�180P��181P��182P��s�m�183P��c�]�	184P��"�3�185�3��s�m�3��3��e�B�s�G�R��W�$�%�&�	3��3�t��%�!�4*��4*��4*��4*��	4*�186
�4*��s�m�
4*��4*��8�D�>�3��#�$�4*�t�%�!�&!��&!��&!��&!��s�m�	&!�187�&!��8�D�>�3���
&!�R��U�3���
�-�.�/����
�S�(�3�-�
� ��28��8���
�8�&�%*��0��0�"�0�
�0�	�	0�h&*� $����%�
.1��'�"�.1��R��W��.1��.1��	.1�188�.1��s�m�
.1�189�.1�d&*� $���%�!
��'�"�!
��R��W��!
��!
��	!
�190�s�m�!
�191�#�x��}�192��
!
�H%�7�%�t�%r
codekingpro/portable-devtools · Team Ai