grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j§Áã@s4ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZmZddlmZddlmZmZmZmZmZmZmZddlmZgd¢ZdZd Z d Z!e eeefZ"ee e!fZ#d d „Z$d d„Z%Gdd„de&ƒZ'Gdd„de'ƒZ(Gdd„de'ƒZ)e(ƒZ*e)ƒZ+Gdd„dƒZ,Gdd„de,ƒZ-e-ƒZ.dd„Z/e0edƒr²e 1¡e/ƒZ/Gdd„dƒZ2Gdd„dƒZ3Gd d!„d!e2ƒZ4Gd"d#„d#e2ƒZ5Gd$d%„d%e2ƒZ6Gd&d'„d'e ƒZ7Gd(d)„d)e&ƒZ8ej9 :e8¡Gd*d+„d+e8ƒZ;Gd,d-„d-e8ƒZGd2d3„d3e=e<ƒZ?dS)4éN)ÚSequence)ÚEINVALÚENOENTÚENOTDIRÚEBADFÚELOOP)Ú attrgetter)ÚS_ISDIRÚS_ISLNKÚS_ISREGÚS_ISSOCKÚS_ISBLKÚS_ISCHRÚS_ISFIFO)Úquote_from_bytes)ÚPurePathÚ PurePosixPathÚPureWindowsPathÚPathÚ PosixPathÚ WindowsPathéé{i�cCs t|ddƒtvpt|ddƒtvS)NÚerrnoÚwinerror)ÚgetattrÚ_IGNORED_ERROSÚ_IGNORED_WINERRORS)Z exception©rú./opt/alt/python310/lib64/python3.10/pathlib.pyÚ _ignore_error&sÿr cCsd|vp d|vp d|vS)NÚ*ú?ú[r)ÚpatrrrÚ_is_wildcard_pattern+sr%c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_FlavourzPA flavour implements a particular (platform-specific) set of path semantics.cCs|jj|_dS©N)ÚsepÚjoin©ÚselfrrrÚ__init__5óz_Flavour.__init__c Csg}|j}|j}d}}t|ƒ}|D]c}|sq|r| ||¡}| |¡\}}} || vrDt|  |¡ƒD]} | rB| dkrB| t | ¡¡q2n| rR| dkrR| t | ¡¡|sV|ru|ss|D]}|s_qZ|rg| ||¡}| |¡d}|rrnqZnq|sz|r�| ||¡|  ¡|||fS)NÚÚ.r) r(ÚaltsepÚreversedÚreplaceÚ splitrootÚsplitÚappendÚsysÚinternÚreverse) r+ÚpartsZparsedr(r0ÚdrvÚrootÚitÚpartZrelÚxrrrÚ parse_parts8sH  €þ  ÿó z_Flavour.parse_partscCsz|r|s|r||||g|dd…fSn#|r1||ks%| |¡| |¡kr0||||dd…fSn||||fS|||fS)z‘ Join the two paths represented by the respective (drive, root, parts) tuples. Return a new (drive, root, parts) tuple. éN)Úcasefold)r+r:r;r9Zdrv2Zroot2Zparts2rrrÚjoin_parsed_parts^s€þ z_Flavour.join_parsed_partsN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r,r?rBrrrrr&1s  &r&c@s–eZdZdZdZdZeZej dkZ e dƒZ dZ hd£dd „d DƒBd d „d DƒBZefd d „Zdd„Zdd„Zdd„Ze fdd„Zdd„Zdd„ZdS)Ú_WindowsFlavourú\ú/TÚntZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\>ZNULZAUXZPRNZCONzCONOUT$zCONIN$cCóh|]}d|’qS)zCOM%sr©Ú.0ÚcrrrÚ €óz_WindowsFlavour.u123456789¹²³cCrK)zLPT%srrLrrrrO�rPc CsV|dd…}|dd…}||kr(||kr(| |¡\}}|dd…}|dd…}nd}|dd…}||kr~||kr~||kr~| |d¡}|dkr~| ||d¡}||dkr~|dkr\t|ƒ}|ro||d|…|||dd…fS|d|…|||dd…fSd} } |dkr™||jvr™|dd…} |dd…}|}||kr¤|} | |¡}|| | |fS)Nrr@ér.ééÿÿÿÿú:)Ú_split_extended_pathÚfindÚlenÚ drive_lettersÚlstrip) r+r=r(ÚfirstÚsecondÚprefixZthirdÚindexZindex2r:r;rrrr3“s6      "   z_WindowsFlavour.splitrootcCs| ¡Sr'©Úlower©r+ÚsrrrrAºóz_WindowsFlavour.casefoldcCsdd„|DƒS)NcSsg|]}| ¡‘qSrr^)rMÚprrrÚ ¾rPz2_WindowsFlavour.casefold_parts..r©r+r9rrrÚcasefold_parts½r-z_WindowsFlavour.casefold_partscCst t |¡tj¡jSr')ÚreÚcompileÚfnmatchÚ translateÚ IGNORECASEÚ fullmatch©r+ÚpatternrrrÚcompile_patternÀsz_WindowsFlavour.compile_patterncCsXd}| |¡r(|dd…}|dd…}| d¡r(||dd…7}d|dd…}||fS)Nr.ézUNC\rRrH)Ú startswith)r+raZ ext_prefixr\rrrrUÃs    z$_WindowsFlavour._split_extended_pathcCsJ|sdS|d d¡r dS|d d¡d d¡d d¡}| ¡|jvS)NFrz\\rSr/rTú )rqÚ partitionÚrstripÚupperÚreserved_names)r+r9ÚnamerrrÚ is_reservedÍs "z_WindowsFlavour.is_reservedcCs`|j}t|ƒdkr%|ddkr%| ¡dd… d¡}d|t| d¡ƒfSdt| ¡ d¡ƒS)NrQr@rTrIz file:///%s/%szutf-8zfile:)ÚdriverWÚas_posixrYÚurlquote_from_bytesÚencode)r+ÚpathryÚrestrrrÚmake_uriÚsÿz_WindowsFlavour.make_uriN)rCrDrEr(r0Úhas_drvÚntpathÚpathmodÚosrwÚ is_supportedÚsetrXZext_namespace_prefixrvr3rArfrorUrxrrrrrrGps*  ÿ þÿ '  rGc@sZeZdZdZdZdZeZej dkZ efdd„Z dd„Z d d „Z d d „Zd d„Zdd„ZdS)Ú _PosixFlavourrIr.FrJcCsP|r#|d|kr#| |¡}t|ƒt|ƒdkrd|d|fSd||fSdd|fS)NrrQr.)rYrW)r+r=r(Z stripped_partrrrr3ïs    z_PosixFlavour.splitrootcCó|Sr'rr`rrrrAþóz_PosixFlavour.casefoldcCr‡r'rrerrrrfrˆz_PosixFlavour.casefold_partscCst t |¡¡jSr')rgrhrirjrlrmrrrroóz_PosixFlavour.compile_patterncCsdS©NFrrerrrrxrˆz_PosixFlavour.is_reservedcCst|ƒ}dt|ƒS)Nzfile://)Úbytesr{)r+r}Zbpathrrrr s z_PosixFlavour.make_uriN)rCrDrEr(r0r€Ú posixpathr‚rƒrwr„r3rArfrorxrrrrrr†çs   r†c@seZdZdZdS)Ú _AccessorzjAn accessor implements a particular (system-specific or not) way of accessing paths on the filesystem.N)rCrDrErFrrrrr�sr�c@sÐeZdZejZejZejZejZej Z ej Z ej Z e edƒr"ej Z ndd„Z ejZejZejZe edƒr8ejZnddd„Zdd d „Ze ed ƒrKejZnd d„Zdd„Zdd„ZejZeejjƒZeejjƒZdS)Ú_NormalAccessorÚlinkcCótdƒ‚)Nz&os.link() not available on this system©ÚNotImplementedError)r+ÚsrcÚdstrrrr�-rbz_NormalAccessor.linkÚsymlinkFcCr�)Nz)os.symlink() not available on this systemr‘)r+r“r”Útarget_is_directoryrrrr•9rbz_NormalAccessor.symlinké¶TcCs`|rz t |d¡WdStyYnwtjtjB}|s"|tjO}t |||¡}t |¡dSr')rƒÚutimeÚOSErrorÚO_CREATÚO_WRONLYÚO_EXCLÚopenÚclose)r+r}ÚmodeÚexist_okÚflagsÚfdrrrÚtouch<s üþ  z_NormalAccessor.touchÚreadlinkcCr�)Nz*os.readlink() not available on this systemr‘©r+r}rrrr¤Qrbz_NormalAccessor.readlinkcCó6zddl}| | |¡j¡jWStytdƒ‚w)Nrz*Path.owner() is unsupported on this system)ÚpwdÚgetpwuidÚstatÚst_uidZpw_nameÚ ImportErrorr’)r+r}r§rrrÚownerTó  ÿz_NormalAccessor.ownercCr¦)Nrz*Path.group() is unsupported on this system)ÚgrpZgetgrgidr©Úst_gidZgr_namer«r’)r+r}r®rrrÚgroup[r­z_NormalAccessor.groupN©F©r—T)rCrDrErƒr©Úior�ÚlistdirÚscandirÚchmodÚmkdirÚunlinkÚhasattrr�ÚrmdirÚrenamer2r•r£r¤r¬r°ÚgetcwdÚ staticmethodr}Ú expanduserÚrealpathrrrrrŽs4      rŽcCsP|d}|dd…}|dkrt}nd|vrtdƒ‚t|ƒr t}nt}||||ƒS)Nrr@ú**z:Invalid pattern: '**' can only be an entire path component)Ú_RecursiveWildcardSelectorÚ ValueErrorr%Ú_WildcardSelectorÚ_PreciseSelector)Ú pattern_partsÚflavourr$Ú child_partsÚclsrrrÚ_make_selectorps  rÉÚ lru_cachec@s eZdZdZdd„Zdd„ZdS)Ú _SelectorzYA selector matches a specific glob pattern part against the children of a given path.cCs2||_|rt||ƒ|_d|_dStƒ|_d|_dS)NTF)rÇrÉÚ successorÚdironlyÚ_TerminatingSelector)r+rÇrÆrrrr,…s    z_Selector.__init__cCs<t|ƒ}|j}|j}|jj}||ƒstgƒS| ||||¡S)zuIterate over all child paths of `parent_path` matched by this selector. This can contain parent_path itself.)ÚtypeÚis_dirÚexistsÚ _accessorrµÚiterÚ _select_from)r+Ú parent_pathZpath_clsrÐrÑrµrrrÚ select_fromŽsz_Selector.select_fromN)rCrDrErFr,rÖrrrrrË�s rËc@seZdZdd„ZdS)rÎccs �|VdSr'r)r+rÕrÐrÑrµrrrrÔœs€ z!_TerminatingSelector._select_fromN)rCrDrErÔrrrrrΚs rÎc@óeZdZdd„Zdd„ZdS)rÄcCs||_t |||¡dSr')rwrËr,)r+rwrÇrÆrrrr,¢sz_PreciseSelector.__init__ccs`�z$| |j¡}|jr |n||ƒr |j ||||¡D]}|VqWdSWdSty/YdSwr')Ú_make_child_relpathrwrÍrÌrÔÚPermissionError)r+rÕrÐrÑrµr}rcrrrrÔ¦s€ þ ÿz_PreciseSelector._select_fromN©rCrDrEr,rÔrrrrrÄ ó rÄc@r×)rÃcCs| |¡|_t |||¡dSr')roÚmatchrËr,©r+r$rÇrÆrrrr,²s z_WildcardSelector.__init__c csÖ�z_||ƒ� }t|ƒ}Wdƒn1swY|D]A}|jrAz| ¡s(WqWnty@}z t|ƒs6‚WYd}~qd}~ww|j} | | ¡r]| | ¡} |j  | |||¡D]} | VqWqWdSt yjYdSwr') ÚlistrÍrÐr™r rwrÜrØrÌrÔrÙ) r+rÕrÐrÑrµÚ scandir_itÚentriesÚentryÚerwr}rcrrrrÔ¶s6€  ÿÿ €ý  €ð ÿz_WildcardSelector._select_fromNrÚrrrrrðrÛrÃc@s$eZdZdd„Zdd„Zdd„ZdS)rÁcCst |||¡dSr')rËr,rÝrrrr,Ñr‰z#_RecursiveWildcardSelector.__init__c csÐ�|VzY||ƒ� }t|ƒ}Wdƒn1swY|D];}d}z| ¡}Wnty@}z t|ƒs6‚WYd}~nd}~ww|rZ| ¡sZ| |j¡} | | ||¡D]} | VqTqWdStygYdSwrŠ) rÞrÐr™r Ú is_symlinkrØrwÚ_iterate_directoriesrÙ) r+rÕrÐrµrßràráZ entry_is_dirrâr}rcrrrräÔs2€  ÿ  ÿ€ÿ  €ö ÿz/_RecursiveWildcardSelector._iterate_directoriesc cs‚�z5tƒ}z,|jj}| |||¡D]}|||||ƒD]}||vr(|V| |¡qqW| ¡WdS| ¡wty@YdSwr')r…rÌrÔräÚaddÚclearrÙ) r+rÕrÐrÑrµZyieldedZsuccessor_selectZstarting_pointrcrrrrÔçs"€ €ýÿ ÿz'_RecursiveWildcardSelector._select_fromN)rCrDrEr,rärÔrrrrrÁÏs rÁc@s4eZdZdZdZdd„Zdd„Zdd„Zd d „Zd S) Ú _PathParentszvThis object provides sequence-like access to the logical ancestors of a path. Don't try to construct it yourself.)Ú_pathclsÚ_drvÚ_rootÚ_partscCs&t|ƒ|_|j|_|j|_|j|_dSr')rÏrèrérêrër¥rrrr,s  z_PathParents.__init__cCs$|js|jr t|jƒdSt|jƒS©Nr@)rérêrWrër*rrrÚ__len__s  z_PathParents.__len__csˆt|tƒrt‡fdd„t| tˆƒ¡ŽDƒƒS|tˆƒks$|tˆƒ kr(t|ƒ‚|dkr2|tˆƒ7}ˆj ˆj ˆj ˆj d| d…¡S)Nc3s�|]}ˆ|VqdSr'r)rMÚir*rrÚ s€z+_PathParents.__getitem__..rr@) Ú isinstanceÚsliceÚtupleÚrangeÚindicesrWÚ IndexErrorrèÚ_from_parsed_partsrérêrë)r+Úidxrr*rÚ __getitem__ s $ ÿz_PathParents.__getitem__cCsd |jj¡S)Nz <{}.parents>)ÚformatrèrCr*rrrÚ__repr__r-z_PathParents.__repr__N) rCrDrErFÚ __slots__r,rírørúrrrrrçûs rçc@s¨eZdZdZdZdd„Zdd„Zedd„ƒZed d „ƒZ ed d „ƒZ ed d„ƒZ dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zedd„ƒZdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zeed-ƒd.d/�Zeed0ƒd1d/�Zed2d3„ƒZed4d5„ƒZ ed6d7„ƒZ!ed8d9„ƒZ"ed:d;„ƒZ#dd?„Z%d@dA„Z&dBdC„Z'dDdE„Z(edFdG„ƒZ)dHdI„Z*dJdK„Z+dLdM„Z,edNdO„ƒZ-edPdQ„ƒZ.dRdS„Z/dTdU„Z0dVdW„Z1dXS)Yra|Base class for manipulating paths without I/O. PurePath represents a filesystem path and offers operations which don't imply any actual filesystem I/O. Depending on your system, instantiating a PurePath will return either a PurePosixPath or a PureWindowsPath object. You can also instantiate either of these classes directly, regardless of your system. )rérêrëÚ_strÚ_hashÚ_ppartsÚ_cached_cpartscGs$|tur tjdkr tnt}| |¡S)z÷Construct a PurePath from one or several strings and or existing PurePath objects. The strings and path objects are combined so as to yield a canonicalized path, which is incorporated into the new PurePath object. rJ)rrƒrwrrÚ _from_parts)rÈÚargsrrrÚ__new__*s zPurePath.__new__cCs|jt|jƒfSr')Ú __class__ròrër*rrrÚ __reduce__4szPurePath.__reduce__cCsbg}|D]&}t|tƒr||j7}qt |¡}t|tƒr#| t|ƒ¡qtdt|ƒƒ‚|j   |¡S)NzNargument should be a str object or an os.PathLike object returning str, not %r) rðrrërƒÚfspathÚstrr5Ú TypeErrorrÏÚ_flavourr?)rÈrr9ÚarrrÚ _parse_args9s    þÿ zPurePath._parse_argscCs0t |¡}| |¡\}}}||_||_||_|Sr')Úobjectrr rérêrë)rÈrr+r:r;r9rrrrMs zPurePath._from_partscCs t |¡}||_||_||_|Sr')r rrérêrë)rÈr:r;r9r+rrrröXs zPurePath._from_parsed_partscCs0|s|r|||j |dd…¡S|j |¡Srì)rr))rÈr:r;r9rrrÚ_format_parsed_parts`s zPurePath._format_parsed_partscCs@| |¡\}}}|j |j|j|j|||¡\}}}| |||¡Sr')r rrBrérêrërö)r+rr:r;r9rrrÚ _make_childgs  ÿzPurePath._make_childcCs<z|jWSty| |j|j|j¡pd|_|jYSw)z[Return the string representation of the path, suitable for passing to system calls.r/)rüÚAttributeErrorr rérêrër*rrrÚ__str__ms  ÿÿ ýzPurePath.__str__cCót|ƒSr')rr*rrrÚ __fspath__wrbzPurePath.__fspath__cCs|j}t|ƒ |jd¡S)zNReturn the string representation of the path with forward (/) slashes.rI)rrr2r(©r+ÚfrrrrzzszPurePath.as_posixcCs t |¡S)zaReturn the bytes representation of the path. This is only recommended to use under Unix.)rƒÚfsencoder*rrrÚ __bytes__€s zPurePath.__bytes__cCsd |jj| ¡¡S)Nz{}({!r}))rùrrCrzr*rrrrú…szPurePath.__repr__cCs| ¡stdƒ‚|j |¡S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)Ú is_absoluterÂrrr*rrrÚas_uriˆs zPurePath.as_uricCs2z|jWSty|j |j¡|_|jYSwr')rÿrrrfrër*rrrÚ_cpartsŽs   þzPurePath._cpartscCs&t|tƒstS|j|jko|j|juSr')rðrÚNotImplementedrr©r+ÚotherrrrÚ__eq__—s zPurePath.__eq__cCs2z|jWStytt|jƒƒ|_|jYSwr')rýrÚhashròrr*rrrÚ__hash__œs   þzPurePath.__hash__cCs&t|tƒr |j|jur tS|j|jkSr'©rðrrrrrrrrÚ__lt__£ó zPurePath.__lt__cCs&t|tƒr |j|jur tS|j|jkSr'rrrrrÚ__le__¨r!zPurePath.__le__cCs&t|tƒr |j|jur tS|j|jkSr'rrrrrÚ__gt__­r!zPurePath.__gt__cCs&t|tƒr |j|jur tS|j|jkSr'rrrrrÚ__ge__²r!zPurePath.__ge__cCó|Sr'r)rÈrÏrrrÚ__class_getitem__·rˆzPurePath.__class_getitem__réz.The drive prefix (letter or UNC path), if any.)ÚdocrêzThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)rérê)r+Úanchorrrrr(Às zPurePath.anchorcCs.|j}t|ƒ|js |jrdndkrdS|dS)z!The final path component, if any.r@rr.rS)rërWrérêrerrrrwÆsz PurePath.namecCsB|j}| d¡}d|krt|ƒdkrndS||d…SdS)z{ The final component's last suffix, if any. This includes the leading period. For example: '.txt' r/rr@Nr.©rwÚrfindrW©r+rwrîrrrÚsuffixÎs   þzPurePath.suffixcCs:|j}| d¡r gS| d¡}dd„| d¡dd…DƒS)zŒ A list of the final component's suffixes, if any. These include the leading periods. For example: ['.tar', '.gz'] r/cSsg|]}d|‘qS)r/r)rMr,rrrrdçrPz%PurePath.suffixes..r@N)rwÚendswithrYr4©r+rwrrrÚsuffixesÜs   zPurePath.suffixescCsB|j}| d¡}d|krt|ƒdkrn|S|d|…S|S)z0The final path component, minus its last suffix.r/rr@Nr)r+rrrÚstemés   þz PurePath.stemcCs†|js td|fƒ‚|j |f¡\}}}|r,|d|jj|jjfvs,|s,|s,t|ƒdkr2td|ƒ‚| |j|j |j dd…|g¡S)z-Return a new path with the file name changed.ú%r has an empty namerSr@zInvalid name %rN) rwrÂrr?r(r0rWrörérêrë)r+rwr:r;r9rrrÚ with_nameósÿÿ   ÿzPurePath.with_namecCs| ||j¡S)z(Return a new path with the stem changed.)r2r,)r+r0rrrÚ with_stemþszPurePath.with_stemcCs´|j}|j|vs|jr|j|vrtd|fƒ‚|r| d¡r"|dkr(td|ƒ‚|j}|s4td|fƒ‚|j}|s>||}n |dt|ƒ …|}| |j |j |j dd…|g¡S)zÀReturn a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the path. zInvalid suffix %rr/r1NrS) rr(r0rÂrqrwr,rWrörérêrë)r+r,rrwZ old_suffixrrrÚ with_suffixs   ÿzPurePath.with_suffixc Gsì|stdƒ‚|j}|j}|j}|r||g|dd…}n|}| |¡\}}}|r3||g|dd…} n|} t| ƒ} |jj} | dkrF|sE|ren | |d| …ƒ| | ƒkre| |||¡} t d  t |ƒt | ƒ¡ƒ‚|  d| dkrn|nd|| d…¡S)zÌReturn the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError. zneed at least one argumentr@NrzU{!r} is not in the subpath of {!r} OR one path is relative and the other is absolute.r.) rrërérêr rWrrfr rÂrùrrö) r+rr9r:r;Z abs_partsZto_drvZto_rootZto_partsZ to_abs_partsÚnÚcfZ formattedrrrÚ relative_tos0 €þ ÿzPurePath.relative_tocGs&z|j|ŽWdStyYdSw)zFReturn True if the path is relative to another path or False. TF)r7rÂrrrrÚis_relative_to8s   ÿzPurePath.is_relative_tocCs.z|jWStyt|jƒ|_|jYSw)zZAn object providing sequence-like access to the components in the filesystem path.)rþrròrër*rrrr9As    þzPurePath.partscGs | |¡S)zîCombine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored). )r )r+rrrrÚjoinpathMs zPurePath.joinpathcCs&z| |f¡WStytYSwr')r rr©r+ÚkeyrrrÚ __truediv__Us  ÿzPurePath.__truediv__cCs,z | |g|j¡WStytYSwr')rrërrr:rrrÚ __rtruediv__[s  ÿzPurePath.__rtruediv__cCs@|j}|j}|j}t|ƒdkr|s|r|S| |||dd…¡S)zThe logical parent of the path.r@NrS)rérêrërWrö)r+r:r;r9rrrÚparentas zPurePath.parentcCr)z*A sequence of this path's logical parents.)rçr*rrrÚparentskszPurePath.parentscCs|jsdS|jj pt|jƒS)zSTrue if the path is absolute (has both a root and, if applicable, a drive).F)rêrr€Úboolrér*rrrrpszPurePath.is_absolutecCs|j |j¡S)zaReturn True if the path contains one of the special names reserved by the system, if any.)rrxrër*rrrrxwszPurePath.is_reservedc CsÒ|jj}||ƒ}|j |f¡\}}}|stdƒ‚|r#|||jƒkr#dS|r.|||jƒkr.dS|j}|s5|rFt|ƒt|ƒkr?dS|dd…}n t|ƒt|ƒkrPdStt |ƒt |ƒƒD] \}}t   ||¡sfdSqYdS)zE Return True if this path matches the given pattern. z empty patternFr@NT) rrAr?rÂrérêrrWÚzipr1riZ fnmatchcase) r+Z path_patternr6r:r;Z pat_partsr9r=r$rrrrÜ|s* ÿzPurePath.matchN)2rCrDrErFrûrrÚ classmethodr rrör r rrrzrrúrÚpropertyrrrr r"r#r$r&rryr;r(rwr,r/r0r2r3r4r7r8r9r9r<r=r>r?rrxrÜrrrrrs|       ÿÿ       !     rc@óeZdZdZeZdZdS)rz¼PurePath subclass for non-Windows systems. On a POSIX system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. rN)rCrDrErFÚ_posix_flavourrrûrrrrršórc@rD)rzºPurePath subclass for Windows systems. On a Windows system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. rN)rCrDrErFÚ_windows_flavourrrûrrrrr¤rFrc@s˜eZdZdZeZdZdd„Zdd„Zdd„Z d d „Z e d d „ƒZ e d d„ƒZ dd„Zdd„Zdd„Zdd„Zdd„Zdadd„Zddœdd„Zd d!„Zd"d#„Z & &dbd'd(„Zd)d*„Zdcd+d,„Zd-d.„Zddd/d0„Zd1d2„Zded4d5„Zdfd7d8„Zddœd9d:„Zd;d<„Z dad=d>„Z!d?d@„Z"dAdB„Z#dCdD„Z$dEdF„Z%dadGdH„Z&dIdJ„Z'dKdL„Z(dMdN„Z)dOdP„Z*dQdR„Z+dSdT„Z,dUdV„Z-dWdX„Z.dYdZ„Z/d[d\„Z0d]d^„Z1d_d`„Z2d&S)gra¡PurePath subclass that can make system calls. Path represents a filesystem path but unlike PurePath, also offers methods to do system calls on path objects. Depending on your system, instantiating a Path will return either a PosixPath or a WindowsPath object. You can also instantiate a PosixPath or WindowsPath directly, but cannot instantiate a WindowsPath on a POSIX system or vice versa. rcOs@|tur tjdkr tnt}| |¡}|jjstd|j fƒ‚|S)NrJz$cannot instantiate %r on your system) rrƒrwrrrrr„r’rC)rÈrÚkwargsr+rrrr½s ÿz Path.__new__cCs|j|g}| |j|j|¡Sr')rërörérê)r+r=r9rrrrØÆs zPath._make_child_relpathcCr%r'rr*rrrÚ __enter__ÌrˆzPath.__enter__cCsdSr'r)r+ÚtÚvÚtbrrrÚ__exit__Ïs z Path.__exit__cCs||j ¡ƒS)zjReturn a new path pointing to the current working directory (as returned by os.getcwd()). )rÒr¼©rÈrrrÚcwdÜszPath.cwdcCs |dƒ ¡S)zrReturn a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). ú~)r¾rNrrrÚhomeãó z Path.homecCsB| ¡}z| ¡}Wnty|j |¡}Ynwtj ||¡S)zoReturn whether other_path is the same or not as this file (as returned by os.path.samefile()). )r©rrÒrƒr}Úsamestat)r+Z other_pathÚstZother_strrrÚsamefileês  ÿz Path.samefileccs.�|j |¡D] }|dvrq| |¡VqdS)zyIterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. >r/z..N)rÒr´rØr.rrrÚiterdirõs €üz Path.iterdirccsp�t d||¡|std |¡ƒ‚|j |f¡\}}}|s|r#tdƒ‚tt|ƒ|jƒ}|  |¡D]}|Vq0dS)z‘Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. zpathlib.Path.globzUnacceptable pattern: {!r}ú%Non-relative patterns are unsupportedN) r6ÚauditrÂrùrr?r’rÉròrÖ©r+rnr:r;rÅZselectorrcrrrÚglobÿs€ÿz Path.globccsb�t d||¡|j |f¡\}}}|s|rtdƒ‚tdt|ƒ|jƒ}| |¡D]}|Vq)dS)z¡Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. zpathlib.Path.rglobrW)rÀN)r6rXrr?r’rÉròrÖrYrrrÚrglob s€ÿz Path.rglobcCs$| ¡r|S| |j ¡g|j¡S)aReturn an absolute version of this path. This function works even if the path doesn't point to anything. No normalization is done, i.e. all '.' and '..' will be kept along. Use resolve() to get the canonical path to a file. )rrrÒr¼rër*rrrÚabsolutesz Path.absoluteFc Cs’dd„}z |jj||d�}Wnty}z||ƒ‚d}~ww| |f¡}|sGz| ¡W|StyF}z ||ƒWYd}~|Sd}~ww|S)z± Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). cSs0t|ddƒ}|jtks|tkrtd|jƒ‚dS)NrrzSymlink loop from %r)rrrÚ_WINERROR_CANT_RESOLVE_FILENAMEÚ RuntimeErrorÚfilename)rârrrrÚ check_eloop/s ÿz!Path.resolve..check_eloop)ÚstrictN)rÒr¿r™rr©)r+rar`rarârcrrrÚresolve(s&€þ  þ€þz Path.resolveT©Úfollow_symlinkscCs|jj||d�S)zh Return the result of the stat() system call on this path, like os.stat() does. rc)rÒr©)r+rdrrrr©Dsz Path.statcCó |j |¡S)z: Return the login name of the file owner. )rÒr¬r*rrrr¬Kó z Path.ownercCre)z8 Return the group name of the file gid. )rÒr°r*rrrr°Qrfz Path.groupÚrrSNcCs(d|vr t |¡}|j ||||||¡S)z| Open the file pointed by this path and return a file object, as the built-in open() function does. Úb)r³Ú text_encodingrÒr�)r+rŸÚ bufferingÚencodingÚerrorsÚnewlinerrrr�Ws  ÿz Path.opencCs8|jdd�� }| ¡WdƒS1swYdS)zK Open the file in bytes mode, read it, and close the file. Úrb©rŸN)r�ÚreadrrrrÚ read_bytesbs$ÿzPath.read_bytescCsFt |¡}|jd||d�� }| ¡WdƒS1swYdS)zJ Open the file in text mode, read it, and close the file. rg)rŸrkrlN)r³rir�rp)r+rkrlrrrrÚ read_textis $ÿzPath.read_textcCsBt|ƒ}|jdd�� }| |¡WdƒS1swYdS)zO Open the file in bytes mode, write to it, and close the file. ÚwbroN)Ú memoryviewr�Úwrite)r+ÚdataZviewrrrrÚ write_bytesqs$ÿzPath.write_bytescCsdt|tƒs td|jjƒ‚t |¡}|jd|||d�� }| |¡WdƒS1s+wYdS)zN Open the file in text mode, write to it, and close the file. zdata must be str, not %sÚw)rŸrkrlrmN) rðrrrrCr³rir�ru)r+rvrkrlrmrrrrÚ write_textzs ÿ $ÿzPath.write_textcCs|j |¡}| |f¡S)zD Return the path to which the symbolic link points. )rÒr¤rr¥rrrr¤…s  z Path.readlinkr—cCs|j |||¡dS)zS Create this file with the given access mode, if it doesn't exist. N)rÒr£)r+rŸr rrrr£Œsz Path.touchéÿcCszz |j ||¡WdSty,|r|j|kr‚|jjddd�|j|d|d�YdSty<|r8| ¡s9‚YdSw)z< Create a new directory at this given path. T)r?r FN)rÒr·ÚFileNotFoundErrorr>r™rÐ)r+rŸr?r rrrr·’s   ÿýz Path.mkdircCs|jj|||d�dS)zF Change the permissions of the path, like os.chmod(). rcN)rÒr¶)r+rŸrdrrrr¶£sz Path.chmodcCs|j|dd�dS)z� Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. FrcN)r¶)r+rŸrrrÚlchmod©sz Path.lchmodcCs.z |j |¡WdSty|s‚YdSw)zd Remove this file or link. If the path is a directory, use rmdir() instead. N)rÒr¸r{)r+Z missing_okrrrr¸°s ÿÿz Path.unlinkcCs|j |¡dS)zF Remove this directory. The directory must be empty. N)rÒrºr*rrrrº»sz Path.rmdircCs |jdd�S)z– Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. Frc)r©r*rrrÚlstatÁrRz Path.lstatcCó|j ||¡| |¡S)a2 Rename this path to the target path. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )rÒr»r©r+Útargetrrrr»Èó z Path.renamecCr~)aS Rename this path to the target path, overwriting if that path exists. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )rÒr2rrrrrr2Õr�z Path.replacecCs|j |||¡dS)z˜ Make this path a symlink pointing to the target path. Note the order of arguments (link, target) is the reverse of os.symlink. N)rÒr•)r+r€r–rrrÚ symlink_toâszPath.symlink_tocCs|j ||¡dS)z¤ Make this path a hard link pointing to the same file as *target*. Note the order of arguments (self, target) is the reverse of os.link's. N)rÒr�rrrrÚ hardlink_toészPath.hardlink_tocCs"tjdtdd�|j ||¡dS)aÅ Make the target path a hard link pointing to this path. Note this function does not make this path a hard link to *target*, despite the implication of the function and argument names. The order of arguments (target, link) is the reverse of Path.symlink_to, but matches that of os.link. Deprecated since Python 3.10 and scheduled for removal in Python 3.12. Use `hardlink_to()` instead. zypathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead.rQ)Ú stacklevelN)ÚwarningsÚwarnÚDeprecationWarningrÒr�rrrrÚlink_toñs ýz Path.link_toc CsRz| ¡WdSty}z t|ƒs‚WYd}~dSd}~wty(YdSw)z+ Whether this path exists. NFT)r©r™r r©r+rârrrrÑs ù€ þz Path.existsc CóTzt| ¡jƒWSty }z t|ƒs‚WYd}~dSd}~wty)YdSw)z3 Whether this path is a directory. NF)r r©Úst_moder™r rÂr‰rrrrÐó€ þz Path.is_dirc CrŠ)zq Whether this path is a regular file (also True for symlinks pointing to regular files). NF)r r©r‹r™r rÂr‰rrrÚis_file$s€ þz Path.is_filecCsn| ¡r| ¡s dSz|j ¡j}Wn tyYdSw| ¡j}||kr(dS| ¡j}|j ¡j}||kS)z; Check if this path is a POSIX mount point FT)rÑrÐr>r©Úst_devr™Úst_ino)r+Z parent_devZdevZinoZ parent_inorrrÚis_mount5s ÿ   z Path.is_mountc CrŠ)z7 Whether this path is a symbolic link. NF)r r}r‹r™r rÂr‰rrrrãIs€ þzPath.is_symlinkc CrŠ)z6 Whether this path is a block device. NF)r r©r‹r™r rÂr‰rrrÚis_block_deviceXrŒzPath.is_block_devicec CrŠ)z: Whether this path is a character device. NF)rr©r‹r™r rÂr‰rrrÚis_char_devicehrŒzPath.is_char_devicec CrŠ)z. Whether this path is a FIFO. NF)rr©r‹r™r rÂr‰rrrÚis_fifoxrŒz Path.is_fifoc CrŠ)z0 Whether this path is a socket. NF)r r©r‹r™r rÂr‰rrrÚ is_socketˆrŒzPath.is_socketcCsp|js6|js6|jr6|jddd…dkr6|j |jd¡}|dd…dkr)tdƒ‚| |g|jdd…¡S|S)zl Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser) rNr@rPz#Could not determine home directory.)rérêrërÒr¾r^r)r+Zhomedirrrrr¾˜s ÿzPath.expanduserr±)rgrSNNN)NN)NNNr²)rzFF)3rCrDrErFÚ_normal_accessorrÒrûrrØrIrMrBrOrQrUrVrZr[r\rbr©r¬r°r�rqrrrwryr¤r£r·r¶r|r¸rºr}r»r2r‚rƒrˆrÑrÐr�r�rãr‘r’r“r”r¾rrrrr±sf       ÿ        rc@seZdZdZdZdS)rzsPath subclass for non-Windows systems. On a POSIX system, instantiating a Path should return this object. rN)rCrDrErFrûrrrrr¦src@seZdZdZdZdd„ZdS)rzqPath subclass for Windows systems. On a Windows system, instantiating a Path should return this object. rcCr�)Nz-Path.is_mount() is unsupported on this systemr‘r*rrrr�´rbzWindowsPath.is_mountN)rCrDrErFrûr�rrrrr­s r)@riÚ functoolsr³r�rƒrŒrgr6r…Ú_collections_abcrrrrrrrÚoperatorrr©r r r r r rrZ urllib.parserr{Ú__all__Z_WINERROR_NOT_READYZ_WINERROR_INVALID_NAMEr]rrr r%r r&rGr†rGrEr�rŽr•rÉr¹rÊrËrÎrÄrÃrÁrçrÚPathLikeÚregisterrrrrrrrrrÚsl  $   ý?w*O ,! }  x