v_c@sddlZddlZddlmZddlZddlZddlmZejdfkrke Z ne Z e Z e ZeZdZdZdZy eZWnek reZnXejdZd efd YZejd Zd efd YZdZe e!dZ"ejdZ#e e!dZ$dZ%dZ&dddddddgZ'dddddd dgZ(e e)e'e(Z*d!Z+d"efd#YZ,d$efd%YZ-d&e-fd'YZ.dS((iN(tlinesep(tTomlTzicCs8dtjkr4ddl}t||jr4tSntS(Niii(ii(tsyst version_infotpathlibt isinstancetPurePathtTruetFalse(tpR((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt_detect_pathlib_paths  cCs#t|ttfrtSt|S(N(Rtbytest basestringRR (R ((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt_ispathscCsBdtjkr(ddl}|j|St|r>t|S|S(Niii(ii(RRtostfspathR tstr(R R((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt_getpath s     s1([0-9]{2}):([0-9]{2}):([0-9]{2})(\.([0-9]{3,6}))?tTomlDecodeErrorcBseZdZdZRS(sBase toml Exception / Error.cCs|jdd|d}||jdd|}dj||||}tj||||_||_||_||_||_ dS(Ns iis{} (line {} column {} char {})( tcounttrfindtformatt ValueErrort__init__tmsgtdoctpostlinenotcolno(tselfRRRRRtemsg((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyR5s    (t__name__t __module__t__doc__R(((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyR2ss([0-9])(_([0-9]))*t CommentValuecBs,eZdZdZdZdZRS(cCs5||_|rdnd}|||_||_dS(Ns t (tvaltcommentt_dict(RR$R%t beginlineR&t separator((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRFs  cCs |j|S(N(R$(Rtkey((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt __getitem__LscCs||j|tSd|ksVd|krZtSt|dkrptS|ddkr|ddkrtS|dd ks|dd kr|d}t|dkr|ddkr|ddkrtSnd|krtStS(Nit_is_.s._it0t.totbtxt+t-t__(R3R4R5R6(tstripRtlenR(tn((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt_strictly_valid_numZs(    2 c Csxt|rItjt|dd}t|j||SWdQXn+t|tr:ddlm }ddl m }g|D]}|j |r|^qsd}|t 7}|d7}t|n|dkrt|}n|j}xC|D];} |j | r(|jt| ||q|d qW|Syt|j||SWntk rstd nXdS( scParses named file or files as toml and returns a dictionary Args: f: Path to the file to open, array of files to read into single dict or a file descriptor _dict: (optional) Specifies the class of the returned toml dictionary decoder: The decoder to use Returns: Parsed toml file represented as a dictionary Raises: TypeError -- When f is invalid type TomlDecodeError: Error while decoding toml IOError / FileNotFoundError -- When an array with no valid (existing) (Python 2 / Python 3) file paths is passed tencodingsutf-8Ni(tpath(twarns.Load expects a list to contain filenames only.sAThe list needs to contain the path of at least one existing file.s>Non-existent filename in list with at least one valid filenames5You can only load a file descriptor, filename or list(R tiotopenRtloadstreadRtlistRR?twarningsR@texistsRtFNFErrortNonet TomlDecodertget_empty_tabletupdatetloadtAttributeErrort TypeError( tfR&tdecodertffiletopR@R?t error_msgtdtl((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRMqs. (      s^[A-Za-z0-9_-]+$c-Csg}|d.kr!t|}n|j}|}t|tsQtdnt|tsr|jd}n|}t|}d}t } d} t } t } t } t }t }d}d}d}d}xt |D]\}}|dkr||ddkrd||WWntk rPnX|s|j|||| qn|dkr| r| r| r| rt||dkr||ddkrt } qt }q|d7}n|dkrq| rq|r>t }qq| rd||ddkrnt } qnqq|d8}n|dkrS| s| r-| st d||n||ddks||ddkrF||d ||dkrF||d||<||d||dkr*d||dd|kr|jd}|| }||}n d}|}|dk rt|}ntt|d d t|}q,t|d}nWntk rFd}nXd|d kr[dSyt|d krtjt|d t|d d!t|dd !}notjt|d t|d d!t|dd !t|dd!t|dd!t|dd!||}Wntk r0dSX|S(NiiR3itZiR7R8i iiiiiii i iii( RIR;tuppertindexRtintRtdatetimetdate(R$t microsecondttzt subsecondvalttzvaltsubsecondvalandtzt splitpointRU((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt _load_datesP              0 cCst}t|d}x1|dkrI||dkrI| }|d8}qWxN|D]F}|rt}t|d}x1|dkr||dkr| }|d8}qvW||7}||7}qQnd}d}d}|dkrd}ndj||||!j}|jd r*td |n|dd krd|djd rdtd |d n|tt|d7}|t|t|7}qQW|S(Niis\RXiis\Uit0123456789abcdefsInvalid escape sequence: RUt01234567s). Only scalar unicode points are allowed.i( RR;RhtlowerR:RtunichrRR-(tvthexbytestprefixtskipRthxthxbthxblen((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt_load_unicode_escapes6s:      #  R2R5RPR<trttRYtss s s s cCsd}t}x|t|kr|rt}||tkrf||d t||||d}q||dkr||d ||}q||dks||dkr|d7}qtdqn||dkrt}n|d7}qW|S(s%Unescape characters in a TOML string.iis\tutUsReserved escape sequence used(RR;t_escapest_escape_to_escapedcharsRR(RRt backslash((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyt _unescape`s")    tInlineTableDictcBseZdZRS(s,Sentinel subclass of dict for inline tables.(RR R!(((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRvsRJcBseZedZdZdZeedZdZdZ dZ e dZ dZ d Zd Zd Zd ZRS( cCs ||_dS(N(R&(RR&((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyR|scCs |jS(N(R&(R((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRKscCs#d|jtfdY}|S(NtDynamicInlineTableDictcBseZdZRS(sConcrete sentinel subclass for inline tables. It is a subclass of _dict which is passed in dynamically at load time It is also a subclass of InlineTableDict (RR R!(((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRs(R&R(RR((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pytget_empty_inline_tablesc Cs|dd!jd}g}t|dkrL|dj rL|jnx4t|dkr|jd}y|jdd\}} Wntk rtdnX| j} | d| dkr| ddks8| dd ks8| dks8| dd kr| dd ks8| ddkrH| ddkrH|j|qOt|dkrs|d|d|d|D]6}|r|j|q||jd7}| }qW|S(NRYiRZiii(RiRR;Rq(RRtdoublequotesplitsRRtsinglequotesplitstdoublequotesplit((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRls&" %    cCsd}|j|}t}x?|D]7}| r?d|kr?Pn||jd7}| }q"W|jd|} t| d} tj| dr| djdd| d}||kr\|j|}t|d|d|}q\q\Wt|}nt|dkr|d|krt|dks|d|d kr|d d!}n|dd !dfS|ddkr9|j |dfS|ddkro|j }|j |||dfSt j |rt j |j\}}}}}tjt|t|t||rt|nd}|dfSt|}|dk r |dfS|stdnd}t}|ddkrNt}|d}n|dd krk|d}n|jd!d }|j}d"|ksd#|kr$d$|ksd%|kr$d"|kr|jd"ddd krtd&n|dd'krtd(nt|}d)}n?t|dkrc|d*ksN|d+krct|}d)}n|dkrt|d}n|rd||fS||fSdS(,NsEmpty value is invalidRtboolRiRYRZiRXiis\sFound tokens after a closed sstring. Invalid TOML.RRsReserved escape sequence useds\us\UiiRR]tarrayR_t inline_objectttimeRs<Weirdness with leading zeroes or underscores in your number.RR8R7R1R3R6tetEs,This float is missing digits after the pointt 0123456789s'This float doesn't have a leading digitRtinftnan(RRRRiR;RfRRRt load_arrayRRsRRnRRRRRRIRRR(RRRt quotecharttestvt triplequotettriplequotecountRttvRRRt escapeseqsRRRRthtmRuR1tmsRt parsed_datetitypetnegtlowerv((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRk)s      2                   4  $<       0(  *   cCst|dkrtS|d|dkr.tSd}t}x?t||dkr{||dkrw| }|d8}q=Pq=W| S(Niiis\i(R;RR(RRuRR((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pytbounded_strings cCsG|dd!j}|dkrC|ddks?|ddkrCtStS(NiiRXiRYRZ(R:RR(Rta((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRs,c Csd}g}|j}d|dd!ksQd|dd!jddjkrw|j|}|dd!jjds|dd!jd}ng}d}d}||dkrdnd}t} xt|t|dkr?||d ks||d krS| rI|d} x4| dkrE|| d krE| } | d8} qWn| } n| rw||dkrw|d7}n| s||d kr|d7}qn6||d kr|dkr|d8}|d7}qn|d7}|j|||!|d}x4|t|dkr1||dkr1|d7}qW|d}qW|}d} |rNx| t|dkrp|| j} x|j|  st| dkrb| d| dko| dknrb| d | dkrb| d| dkrb|| d|| d|| <|| j} | t|dkrQ|| d || d}q~|| d }q~W| d7} qUWqNnt |dd!} g}d}d}xt t| D]}| |dkr|d7}q| |dkr|d8}q| |dkr| r|jdj | ||!|d}qqW|jdj | |xt t|D]}}||j||<||dkra|j ||\}}|r||krt dqn|}|j|qaqaW|S(NR]iiRXiR_RiRYRZs\R`iiR^sNot a homogeneous array(RIR:RiRt startswithRR;RqRRERoRhRkR(RRtatypeRwtstrarraytnew_atstart_group_indextend_group_indextopen_bracket_counttin_strtbackslash_indexR5tabtalR{RRtnvaltntype((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRs 9         (   cCsdS(N((RRR)R%R'((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRgscCsdS(N((RRRx((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRj s(RR tdictRRKRRRsRlRtRRRkRRRRgRj(((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRJzs      T  m   [ tTomlPreserveCommentDecodercBs&eZedZdZdZRS(cCs#i|_tt|j|dS(N(tsaved_commentstsuperRR(RR&((sI/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/toml/decoder.pyRs cCs|||f|j|sJ            1c / #