Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/dotenv/__pycache__/main.cpython-37.pyc

91 lines
7.2 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
6U<36>]6$<00>@s\ddlmZmZmZddlZddlZddlZddlZddlZddl Z ddl
m Z m Z m Z mZmZmZmZmZmZmZmZddlZddlmZddlmZddlmZmZmZddlm Z er<>ej!d kr<>ej"Z#neZ#ej!d
kr<>eZ$neeZ$e<06>%d <0B>Z&Gd d <0A>d <0A>Z'dd<0F>Z(edd<11><00>Z)d#dd<14>Z*d$dd<16>Z+dd<18>Z,dd<1A>Z-d%dd<1E>Z.d&dd <20>Z/d'd!d"<22>Z0dS)(<28>)<03>absolute_import<72>print_function<6F>unicode_literalsN) <0B>Dict<63>Iterator<6F>List<73>Match<63>Optional<61>Pattern<72>Union<6F> TYPE_CHECKING<4E>Text<78>IO<49>Tuple)<01> OrderedDict)<01>contextmanager<65>)<03>StringIO<49>PY2<59>to_env)<01> parse_stream)<02><00>)rrz \$\{[^\}]*\}c@sDeZdZddd<04>Zedd<06><00>Zdd<08>Zd d
<EFBFBD>Zdd d <0C>Zd d<0E>Z dS)<11>DotEnvFNcCs||_d|_||_||_dS)N)<04> dotenv_path<74>_dict<63>verbose<73>encoding)<04>selfrrr<00>r<00>6/tmp/pip-install-h5md9nkv/python-dotenv/dotenv/main.py<70>__init__#szDotEnv.__init__c cspt|jt<02>r|jVnVtj<04>|j<01>rJtj|j|jd<01><02> }|VWdQRXn"|j rbt
<EFBFBD> d<02> |j<01><01>td<03>VdS)N)rzFile doesn't exist {}<7D>) <0A>
isinstancerr<00>os<6F>path<74>isfile<6C>io<69>openrr<00>warnings<67>warn<72>format)r<00>streamrrr <00> _get_stream*s 
zDotEnv._get_streamcCs(|jr |jSt|<00><02><00>}t|<01>|_|jS)zReturn dotenv as dict)rr<00>parse<73>resolve_nested_variables)r<00>valuesrrr <00>dict7s
 
z DotEnv.dictc csL|<00><00><00>:}x2t|<01>D]&}|jdk r|jdk r|j|jfVqWWdQRXdS)N)r-r<00>key<65>value)rr,<00>mappingrrr r.As
z DotEnv.parsecCs@x:|<00><00><00><01>D]*\}}|tjkr&|s&qt|<03>tjt|<02><qWdS)zH
Load the current dotenv as system environemt variable.
T)r1<00>itemsr$<00>environr)r<00>override<64>k<>vrrr <00>set_as_environment_variablesHs
z#DotEnv.set_as_environment_variablescCs6|<00><00>}||kr||S|jr2t<02>d||jf<00>dS)z
zkey %s not found in %s.N)r1rr)r*r)rr2<00>datarrr <00>getTs z
DotEnv.get)FN)F)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__r!rr-r1r.r:r<rrrr r!s 
 

rcCst|dd<02><02>|<01>S)zl
Gets the value of a given key from the given .env
If the .env path given doesn't exist, fails
T)r)rr<)rZ
key_to_getrrr <00>get_keycsr@c
cs<>y>tjddd<03><02>&}t<02>|<00><01>}||fVWdQRXWdQRXWn0tk
rntj<06>|j<08>rht<05> |j<08><00>YnXt
<EFBFBD> |j|<00>dS)Nzw+F)<02>mode<64>delete) <0C>tempfile<6C>NamedTemporaryFiler'r(<00> BaseExceptionr$r%r&<00>name<6D>unlink<6E>shutil<69>move)r%<00>dest<73>sourcerrr <00>rewritems " rL<00>alwaysc
Cs<>|<02>d<01><01>d<02>}tj<02>|<00>s4t<04>d|<00>d||fSd|kr@d}|dkrLdnd}|<04>||<02>}t|<00><01>T\}}d }x6t|<06>D]*} | j |kr<>|<07>
|<05>d
}qx|<07>
| j <0B>qxW|s<>|<07>
|<05>WdQRXd
||fS) z<>
Adds or Updates a key/value to the given .env
If the .env path given doesn't exist, fails instead of risking creating
an orphan .env somewhere in the filesystem
<20>'<27>"z%can't write to %s - it doesn't exist.N<> rMz{}="{}"
z{}={}
FT) <0C>stripr$r%<00>existsr)r*r+rLrr2<00>write<74>original)
rZ
key_to_setZ value_to_set<65>
quote_modeZ line_templateZline_outrKrJZreplacedr4rrr <00>set_key|s$ 
 

rVc Cs<>tj<01>|<00>s"t<03>d|<00>d|fSd}t|<00><01>8\}}x,t|<04>D] }|j|krRd}q>|<05>|j <09>q>WWdQRX|s<>t<03>d||f<00>d|fS||fS)z<>
Removes a given key from the given .env
If the .env path given doesn't exist, fails
If the given key doesn't exist in the .env, fails
z(can't delete from %s - it doesn't exist.NFTz/key %s not removed from %s - key doesn't exist.)
r$r%rRr)r*rLrr2rSrT)rZ key_to_unsetrU<00>removedrKrJr4rrr <00> unset_key<65>s 
rXcsF<00>fdd<02><08><00>fdd<04>}i<00>x$|<00><00>D]\}}t<01>||<03><02>|<q&W<00>S)Ncst<00>|<00><00>|d<01><02>}|S)z<>
get appropriate value for a variable name.
first search in environ, if not found,
then look into the dotenv variables
r")r$<00>getenvr<)rF<00>ret)<01>
new_valuesrr <00> _replacement<6E>sz.resolve_nested_variables.<locals>._replacementcs<00>|<00><00>dd<02><00>S)zh
From a match object gets the variable name and returns
the correct replacement
<20><00><><EFBFBD><EFBFBD><EFBFBD>)<01>group)Z match_object)r\rr <00>_re_sub_callback<63>sz2resolve_nested_variables.<locals>._re_sub_callback)r5<00>__posix_variable<6C>sub)r0r`r8r9r)r\r[r r/<00>s 
r/ccsxtj<01>|<00>std<01><01>tj<01>|<00>r,tj<01>|<00>}d}tj<01>|<00>}x6||krr|Vtj<01>tj<01>|tjj<08><02>}||}}q>WdS)zL
Yield directories starting from the given directory up to the root
zStarting path not foundN) r$r%rR<00>IOErrorr&<00>dirname<6D>abspath<74>join<69>pardir)r%Zlast_dirZ current_dir<69>
parent_dirrrr <00> _walk_to_root<6F>s    
ri<00>.envFc
Cs<>dd<02>}|s|<03>rt<00><01>}ndt<02><03>}trHt<05>d<03>sHt<05>dd<05>dd}nt}x|jj |krb|j
}qNW|jj }tj <0B> tj <0B> |<07><01>}x.t|<04>D]"}tj <0B>||<00>} tj <0B>| <09>r<>| Sq<>W|r<>td<07><01>dS) z<>
Search in increasingly higher folders for the given file
Returns path to the file if found, or an empty string otherwise
cSstddddgd<04>}t|d<03> S)z> Decide whether this is running in a REPL or IPython notebook <20>__main__N<5F>__file__)<01>fromlist)<02>
__import__<EFBFBD>hasattr)<01>mainrrr <00>_is_interactive<76>sz$find_dotenv.<locals>._is_interactivez.py<70>.rrzFile not foundr")r$<00>getcwd<77>sys<79> _getframerrl<00>endswith<74>rsplit<69>f_code<64> co_filename<6D>f_backr%rdrerirfr&rc)
<EFBFBD>filenameZraise_error_if_not_foundZusecwdrqr%<00>frameZ current_fileZframe_filenamerd<00>
check_pathrrr <00> find_dotenv<6E>s$


 r~cKs*|p |p t<00>}t|fd|i|<04><02>j|d<02>S)Nr)r7)r~rr:)rr,rr7<00>kwargs<67>frrr <00> load_dotenvsr<>cKs&|p |p t<00>}t|fd|i|<03><02><01><02>S)Nr)r~rr1)rr,rrr<>rrr <00> dotenv_valuessr<>)rM)rM)rjFF)NNFF)NNF)1<>
__future__rrrr'r$<00>rerHrtrC<00>typingrrrrr r
r r r rrr)<00> collectionsr<00>
contextlibr<00>compatrrr<00>parserr<00> version_info<66>PathLikeZ _PathLike<6B> _StringIO<49>compilerarr@rLrVrXr/rir~r<>r<>rrrr <00><module>s<4   


B

!

+