Files
952-11/env/python/dll/Python312/Lib/__pycache__/posixpath.cpython-312.pyc
T

115 lines
18 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åfáFãóf—dZdZdZdZdZdZdZdZdZddl Z ddl
Z
ddl Z ddl Z dd l ­gd
¢Z
d „Zd „Zd
„Zd„Zd„Zd„Ze j(je_d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdadad„Z ddl m!Z!d„Z"d„Z$ddœd „Z%d!„Z&e
jNd"k(Z(d%d#„Z)d$„Z*y#e#$rd„Z"YŒ-wxYw)&aÙCommon operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).
Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
ú.ú..ú/ú:z
/bin:/usr/binNz /dev/nullé)Ú*)(ÚnormcaseÚisabsÚjoinÚ
splitdriveÚ splitrootÚsplitÚsplitextÚbasenameÚdirnameÚ commonprefixÚgetsizeÚgetmtimeÚgetatimeÚgetctimeÚislinkÚexistsÚlexistsÚisdirÚisfileÚismountÚ
expanduserÚ
expandvarsÚnormpathÚabspathÚsamefileÚ sameopenfileÚsamestatÚcurdirÚpardirÚsepÚpathsepÚdefpathÚaltsepÚextsepÚdevnullÚrealpathÚsupports_unicode_filenamesÚrelpathÚ
commonpathÚ
isjunctioncó&—t|t«ryy)Nó/r)Ú
isinstanceÚbytes©Úpaths úEc:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\posixpath.pyÚ_get_sepr7)s€Ü�$œÔØàócó,—tj|«S)z6Normalize case of pathname. Has no effect under Posix©ÚosÚfspath)Úss r6rr4s€ä
�9‰9�Q‹<Ðr8cód—tj|«}t|«}|j|«S)zTest whether a path is absolute)r;r<r7Ú
startswith)r=r%s r6r r <s'ۊ
� ‰ �!‹ €AÜ
�1‹+€CØ �<‰<˜Ó Ðr8cój—tj|«}t|«}|} |s|dd|zttj|«D]7}|j |«r|}Œ|r|j |«r||z
}Œ0|||zz
}Œ9 |S#t ttf$rtjd|g|¢­Ž‚wxYw)zæJoin two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
ends with a separator.Nrr
) r;r<r7Úmapr?ÚendswithÚ TypeErrorÚAttributeErrorÚ BytesWarningÚ genericpathÚ_check_arg_types)ÚaÚpr%r5Úbs r6r
r
Gsº€ô
� ‰ �!‹ €AÜ
�1‹+€CØ €Dð ÙØ ��!ˆH�sŠNÜ”R—Y‘Y Ó"ò ˆAØ�|‰|˜CÔ Ø‘Ù˜TŸ]™]¨3Ô/ؘ‘ ‘à˜˜a™‘‘ñ
 ð €Køô
”~¤|Ð 4òÜ×$Ñ$ V¨QÐ3°Ó3Ø
ðús ¤ABÂ-B2cóΗtj|«}t|«}|j|«dz}|d|||d}}|r"||t |«zk7r|j |«}||fS)z€Split a pathname. Returns tuple "(head, tail)" where "tail" is
everything after the final slash. Either part may be empty.éN©r;r<r7ÚrfindÚlenÚrstrip)rIr%ÚiÚheadÚtails r6r
r
dsk€ô � ‰ �!‹ €AÜ
�1‹+€CØ �‰�‹ �qÑ€AØ�2�A�˜˜!˜"˜ˆ$€DÙ �˜œC ›I™
Ò%Ø�{‰{˜3ÓˆØ �ˆ:Ðr8cóŽ—tj|«}t|t«rd}d}nd}d}t j
||d|«S)Nr1ó.rr)r;r<r2r3rFÚ _splitext)rIr%r)s r6rrusD€Ü
� ‰ �!‹ €AÜ�!”UÔØˆØ‰àˆØˆÜ × Ñ   C¨¨vÓ 6Ð6r8có:—tj|«}|dd|fS)zJSplit a pathname into drive and path. On Posix, drive is always
empty.Nrr:)rIs r6r r ƒs €ô � ‰ �!‹ €AØ ˆRˆaˆ5�!ˆ8€Or8có¾—tj|«}t|t«rd}d}nd}d}|dd|k7r|||fS|dd|k7s|dd|k(r|||ddfS||dd|ddfS) a¥Split a pathname into drive, root and tail. On Posix, drive is always
empty; the root may be empty, a single slash, or two slashes. The tail
contains anything after the root. For example:
splitroot('foo/bar') == ('', '', 'foo/bar')
splitroot('/foo/bar') == ('', '/', 'foo/bar')
splitroot('//foo/bar') == ('', '//', 'foo/bar')
splitroot('///foo/bar') == ('', '/', '//foo/bar')
r1r8rÚNrLéé)r;r<r2r3)rIr%Úemptys r6r r Šs�€ô � ‰ �!‹ €AÜ�!”UÔØˆØ‰àˆØˆØˆˆ!€u�‚|à�e˜QˆÐØ
ˆ1ˆQˆ�3Š˜!˜A˜a˜& Cš-à�c˜1˜Q˜R˜5Ð Ð ð�a˜˜�e˜Q˜q˜r˜UÐ"Ð"r8cót—tj|«}t|«}|j|«dz}||dS)z)Returns the final component of a pathnamerLN)r;r<r7rN)rIr%rQs r6rr©s5€ä
� ‰ �!‹ €AÜ
�1‹+€CØ �‰�‹ �qÑ€AØ ˆQˆRˆ5€Lr8cóÀ—tj|«}t|«}|j|«dz}|d|}|r"||t |«zk7r|j |«}|S)z-Returns the directory component of a pathnamerLNrM)rIr%rQrRs r6rr³sZ€ä
� ‰ �!‹ €AÜ
�1‹+€CØ �‰�‹ �qÑ€AØ ˆRˆaˆ5€DÙ �˜œC ›I™
Ò%Ø�{‰{˜3ÓˆØ €Kr8có.—tj|«y)zQTest whether a path is a junction
Junctions are not a part of posix semanticsFr:r4s r6r/r/Às€ô‡I�Iˆd„OØ r8cóZ— tj|«y#ttf$rYywxYw)zCTest whether a path exists. Returns True for broken symbolic linksFT)r;ÚlstatÚOSErrorÚ
ValueErrorr4s r6rrÉs0€ðÜ
�‰�Œð øô
”ZÐ òÙðús ‚˜*©*cóú— tj|«}tj|j«rytj|«}t|t«r
t|d«}n t|d«}t|«} tj|«}|j}|j}||k7ry|j}|j}||k(ryy#t
t f$rYywxYw#t
t f$rYywxYw)z$Test whether a path is a mount pointFó..rT)r;raÚstatÚS_ISLNKÚst_moderbrcr<r2r3r
r+Úst_devÚst_ino)r5Ús1ÚparentÚs2Údev1Údev2Úino1Úino2s r6rrÕsã€ðÜ
�X‰X�d‹^ˆô �<‰<˜Ÿ
™
Ô #Øä
�9‰9�T‹?€DÜ�$œÔÜ�d˜EÓ"‰ä�d˜DÓ!ˆÜ
�fÓ
€FðÜ
�X‰X�fÓ
ˆð �9‰9€DØ
�9‰9€DØ ˆt‚|ØØ
�9‰9€DØ
�9‰9€DØ ˆt‚|ØØ øô7
”ZÐ òáðûô
”ZÐ òÙðús#‚CÂC(ÃC%Ã$C%Ã(C:Ã9C:có`—tj|«}t|t«rd}nd}|j |«s|St |«}|j
|d«}|dkr t|«}|dk(rZdtjvr4 ddl } |jtj««j}nXtjd}nD ddl }|d|}t|t«r t|d«} |j!|«}|j}|€t"j$dk(r|St|t«rtj&|«}d }nd
}|j)|«}|||dzxs|S#t$r|cYSwxYw#t$r|cYSwxYw#t$r|cYSwxYw#t$r|cYSwxYw) zOExpand ~ and ~user constructions. If user or $HOME is unknown,
do nothing.ó~ú~rLrÚHOMENÚASCIIÚvxworksr1r)r;r<r2r3r?r7ÚfindrOÚenvironÚpwdÚ ImportErrorÚgetpwuidÚgetuidÚpw_dirÚKeyErrorÚstrÚgetpwnamÚsysÚplatformÚfsencoderP) r5Útilder%rQrzÚuserhomeÚnameÚpwentÚroots r6rrs¨€ô �9‰9�T‹?€DÜ�$œÔØ‰àˆØ �?‰?˜5Ô !؈ Ü
�4‹.€CØ � ‰ �#�qÓ€A؈1‚uÜ �‹IˆØˆA‚vØ œŸ™Ñ #ð
Ûð
ØŸ<™<¬¯ © « Ó4×;Ñ;‘ô —z‘z &Ñ)‰Hð Û ð�A�aˆyˆÜ �dœEÔ "Ü�t˜WÓ%ˆDð Ø—L‘L Ó&ˆEð
—<‘<ˆàМCŸL™L¨IÒ5؈ Ü�$œÔÜ—;‘;˜xÓ(ˆØ‰àˆØ�‰˜tÓ$€HØ �t˜A˜B�xÑ Ò ( DÐ(øôIò
à’ ð
ûô
ò
ð’ ð
ûôò àŠKð ûôò ðŠKð úsHÂE,Â-E=à FÃ1FÅ, E:Å9E:Å= F Æ
F Æ FÆFÆ F-Æ,F-có,—tj|«}t|t«rRd|vr|Sts ddl}|j
d|j«atj}d}d}ttdd«}nPd|vr|Sts ddl}|j
d |j«a
tj}d
}d }tj}d} |||«}|s |S|jd«\}}|jd «} | j|«r| j|«r| d d
} |€:tj tjtj"| ««}
n|| }
||d} |d||
z}t%|«}|| z
}Œº#t&$r|}YŒwxYw)zZExpand shell variables of form $var and ${var}. Unknown variables
are left unchanged.ó$rNs\$(\w+|\{[^}]*\})ó{ó}Úenvironbú$z\$(\w+|\{[^}]*\})ú{ú}rLéÿÿÿÿ)r;r<r2r3Ú _varprogbÚreÚcompilervÚsearchÚgetattrÚ_varprogryÚspanÚgroupr?rBr„ÚfsdecoderOr) r5r”r–ÚstartÚendryrQÚmÚjr‡ÚvaluerSs r6rr@sˆ€ô �9‰9�T‹?€Dä�$œÔØ �tÑ ØˆKÝÛ ØŸ
™
Ð#8¸"¿(¹(ÓCˆIÜ×!Ñ!ˆØˆØˆÜœ"˜j¨$Ó/‰à �d‰?؈KÝÛ Ø—z‘zÐ"6¸¿¹ÓAˆHÜ—‘ˆØˆØˆÜ—*‘*ˆØ €AØ
Ù �4˜‹OˆÙØ ð" €Kð!�v‰v�a‹y‰ˆˆ1Ø�w‰w�q‹zˆØ �?‰?˜5Ô ! d§m¡m°CÔ&8ؘ˜"�:ˆDð ØˆÜŸ ™ ¤B§J¡J¬r¯{©{¸4Ó/@Ñ$AÓB‘à ™
�ð˜˜�8ˆDؘ˜�8˜eÑ#ˆDÜ�D“ ˆAØ �D‰LˆDð' øôò ØŠAð úsÄ&AFÆ FÆF)Ú_path_normpathcóÔ—tj|«}t|t«r5tjt tj |«««xsdSt |«xsdS)ú0Normalize path, eliminating double slashes, etc.rUr)r;r<r2r3r„r¡r›r4s r6rr˜sK€ä�y‰y˜‹ˆÜ �dœEÔ "Ü—;‘;œ~¬b¯k©k¸$Ó.?Ó@ÓAÒIÀTÐ IܘdÓ#Ò* sÐ*r8có„—tj|«}t|t«r d}d}d}d}nd}d}d}d}||k(r|St |«\}}}|j |«}g}|D]A} | ||fvrŒ
| |k7s|s|r
|r|d |k(r|j
| «Œ/|sŒ2|j«ŒC|}||j|«z}|xs|S)