Files
intellecton/venv/lib/python3.12/site-packages/pymdownx/__pycache__/snippets.cpython-312.pyc
T

117 lines
18 KiB
Plaintext
Raw Normal View History

Ë
j0IãóÂdZddlmZddlmZddlZddlZddlZddlZddl m
Z
ddl Z ddl Z dZ
e
dzZd ZiZd
Zd ZGd d
e«ZGdde«ZGdde«ZdZy)ax
Snippet ---8<---.
pymdownx.snippet
Inject snippets
MIT license.
Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
é)Ú Extension)Ú PreprocessorNé)Úutilié g$@éécóeZdZdZy)ÚSnippetMissingErrorzSnippet missing exception.N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©óúT/home/antigravity/intellecton/venv/lib/python3.12/site-packages/pymdownx/snippets.pyr r +sÚ$rr cóöeZdZdZej
d«Zej
d«Zej
d«Zej
d«Z ˆfdZ
dZ dZ d „Z
ejd
«Zd
d Zd ZˆxZS)ÚSnippetPreprocessorz$Handle snippets in Markdown content.a(?x)
^(?P<space>[ \t]*)
(?P<escape>;*)
(?P<all>
(?P<inline_marker>-{1,}8<-{1,}[ \t]+)
(?P<snippet>(?:"(?:\\"|[^"\n\r])+?"|'(?:\\'|[^'\n\r])+?'))(?![ \t]) |
(?P<block_marker>-{1,}8<-{1,})(?![ \t])
)\r?$
zE(?x)
^(?P<space>[ \t]*)
(?P<snippet>.*?)\r?$
zà(?xi)
^(?P<pre>.*?)
(?P<escape>;*)
(?P<inline_marker>-{1,}8<-{1,}[ \t]+)
(?P<section>\[[ \t]*(?P<type>start|end)[ \t]*:[ \t]*(?P<name>[a-z][-_0-9a-z]*)[ \t]*\])
(?P<post>.*?)$
zb(?i)(.*?)(?:((?::-?[0-9]*){1,2}(?:(?:,(?=[-0-9:])-?[0-9]*)(?::-?[0-9]*)?)*)|(:[a-z][-_0-9a-z]*))?$cór|jd«}t|ttjf«r|g}|Dcgc]!}tj
j
|«Œ#c}|_|d|_|jd«|_ |jd«|_
|jd«|_ |d|_ |d|_
|d|_|d |_|d
|_|d |_|d |_|j&|_t(|U«|j,j/«y
cc}w)ú Initialize.Ú base_pathÚrestrict_base_pathÚencodingÚ check_pathsÚ auto_appendÚ url_downloadÚ url_max_sizeÚ url_timeoutÚurl_request_headersÚdedent_subsectionsÚ max_retriesÚbackoff_factorN)ÚgetÚ
isinstanceÚstrÚosÚPathLikeÚpathÚabspathrrrrrrrrrr r!r"Ú
tab_lengthÚsuperÚ__init__ÚdownloadÚ cache_clear)ÚselfÚconfigÚmdÚbaseÚbÚ __class__s €rr,zSnippetPreprocessor.__init__Ssø€ðz‰z˜&ˆÜ dœS¤"§+¡+Ð 6ˆDØ6:Öœ"Ÿ'™'Ÿ/™/¨!Õ;ˆŒØ"(Ð)=Ñ">ˆÔØŸ
 .ˆŒ
Ø!Ÿ:™: mÓÔØ!Ÿ:™: 4ˆÔØ" 2ˆÔØ" 2ˆÔØ! 0ˆÔØ#)Ð*?Ñ#@ˆÔ Ø"(Ð)=Ñ">ˆÔØ! 0ˆÔØ$Ð%5ÑÔØŸ-™-ˆŒÜ
ÑÔà
×#ùò<sº&D4cóÌg}d}d}|D]}|jj|«}|r~|r||jd«rk|jd«|jd«jddd«z|jd«z|jd«z|jd «z}nj|b|jd
«|k(rN|s|jd «d k(rd
}d
}ŒÐ|r|jd «d k(rŒç|r|jd «dk(rd}n n|r|rŒ |sŒ
|j |«Œ |s|j
rt
d|d«|jr|j|«S|S)z-Extract the specified section from the lines.FÚescapeÚpreúrÚ
inline_markerÚsectionÚpostÚnameÚtypeÚstartTÚendzSnippet section 'z' could not be located) ÚRE_SNIPPET_SECTIONÚmatchÚgroupÚreplaceÚappendrr r Údedent)r/r;ÚlinesÚ new_linesr?ÚfoundÚms rÚextract_sectionz#SnippetPreprocessor.extract_sectionjsvðˆ ØˆØˆØó( $ˆ×'×-¨aÓ0ˆU˜qŸw™w xÔ—GG˜E“N Q§W¡W¨XÓ%6×%>Ñ%>¸sÀBÈÓ%JÑJÈQÏWÉWÐUdÓMeÑ—GG˜'Ø)*¯©°«ñð  1§7¡7¨6£?°gÒ#=ñ §¡¨£°GÒ!;Ø  ñ˜qŸw™w v›°'Òñ˜qŸw™w v›°%Ò!ññ‘uÙóØ× Ñ  Ö#ðQ( $ñT˜×%Ð(9¸'¸ÐBXÐ&YÓ Zà)-×)@Ò)@ˆt{‰{˜OÀiÐOrcóhtjdj|««jd«S)zDe-indent lines.ú
)ÚtextwraprFÚjoinÚsplit©r/rGs rrFzSnippetPreprocessor.dedentŸs'ô˜tŸy™y¨Ó0×6°tÓ<rcó^d}|jD}tjj|«sŒ$tjj |«rÓ|j
rtjj
tjj||««}|j|jtj«s|tjzn|«s!ŒÐtjj||«}tjj|«sŒ|}|Stjj|«}tjj||«}tjj|«sŒvtjj||«sŒ˜|}|S|S)zGet snippet path.N)
rr&r(ÚexistsÚisdirrr)rPÚ
startswithÚendswithÚsepÚdirnameÚsamefile)r/r(Úsnippetr2ÚfilenamerYs rÚget_snippet_pathz$SnippetPreprocessor.get_snippet_path¤s(ðˆØ—N‘Nó ˆDÜw‰w~‰~˜dÕ—77—== Ô×.Ü#%§7¡7§?¡?´2·7±7·<±<ÀÀdÓ3KÓ#L˜ð (×Ï
É
ÔVX×V\ÑV\ÔH]°4¼"¿&¹&²=ÐcgÔ$ä#%§7¡7§<¡<°°dÓ#;˜Ü—ww—~~ /Ø"*˜Øðˆô !Ÿg™gŸo™o¨dÓ3!Ÿw™wŸ|™|¨G°TÓ:—ww—~~ /´B·G±G×4DÑ4DÀXÈtÖ4TØ"*˜ØØˆð+ ð*ˆrcó|j} tjj||j¬«}|j
dk(rdn |j
}tjj
||¬«5}tjr |jn |j}|dk7rtd|d|d«d}d |jvrF|jdk7r|j|j«n|j«}t|«}nt!|jd «}|jdk7r'||jk\rt#d
|j«|dk(r d gcddd«S||j«}|j%d «} |j'«D
cgc]}
|
j)|j*«Œ} }
| r| j-d «| cddd«Scc}
w#1swYnxYwn#tj.j0$ro} | jd
k(r>|r<|dz}|j2|j|z
z}
t5j6|
«Yd} ~ ŒStd|d| jd«| d} ~ wwxYwŒy)z
Actually download the snippet pointed to by the passed URL.
The most recently used files are kept in a cache until the next reset.
)ÚheadersrN)ÚtimeoutéÈzCannot download snippet 'z' (HTTP Error ú)zcontent-lengthz2refusing to read payloads larger than or equal to r9)ó
ó
i­r)r!ÚurllibÚrequestÚRequestrrÚurlopenrÚPY39ÚstatusÚcoder r_rÚreadÚlenÚintÚ
ValueErrorrWÚ
splitlinesÚdecoderrEÚerrorÚ HTTPErrorr"ÚtimeÚsleep)r/ÚurlÚretriesÚ http_requestr`ÚresponserjÚcontentÚcontent_lengthÚlastrJÚs_linesÚwaits rr-zSnippetPreprocessor.download¿skð×"ˆàð.
kÜ%Ÿ~™~×5°cÀ4×C[ÑC[Ð\ Ø"&×"2Ñ"2°aÒ"7™$¸T×=MÑ=MÜ—^^×+¨LÀ'Ð"#Èhä04· ² ˜XŸ_š_¸x¿}¹} 1Ð4MÈcÈUÐR`ÐagÐ`hÐhiÐ2jÓ#'¨x×/?Ñ/?ÑGK×FWÑFWÐ[\ÒF\ (§-¡-°×0AÑ0AÔ"BÐbj×boÑboÓbq˜Ü),¨W«ä),¨X×-=Ñ-=Ð>NÑ-OÓ)P˜à×(¨AÒ-°.ÀD×DUÑDUÒ2UÜ(Ð+]Ð^b×^oÑ^oÐ]pÐ)qÓÒ*Ø "˜t÷/""#ð2à"*§-¡-£/˜ð#×+¨NÓ;DØ@G×@RÑ@RÓ@TÖU¸1˜qŸx™x¨¯
©
ÕUØŸ "÷E""#ùò>V÷?""#úð"#øôH—<<×
kà—6‘6˜S’=¡Wؘq‘L×.°$×2BÑ2BÀWÑ2LÑM—JJ˜Ü)Ð,EÀcÀUÈ.ÐYZ×Y_ÑY_ÐX`Ð`aÐ*bÓcÐijÐjûð
kúñQsVA)G6Á8C+G)Å# G6Å-5G)Æ""G$ÇG)Ç G6Ç$G)Ç)G2Ç.G6Ç6JÈAI=É I=É=Jc
óx |r|jj|«g}d}d}|D]B}d}|jj|«} | r`| j d«r#|j |j
ddd««ŒW|r| j d«rŒk| j d«rd}n¹| }Œƒ|s³|sž|jj|«}
|
r}|
j d«rl|
j d«|