grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B ¿%h\Êœk™ã@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkræddlZe  ¡dd …d krÜdd lm!Z!qêd ZdZ!ndZd dddddgZ"e e eefZ#dZ$dd„Z%dd„Z&Gdd„de'ƒZ(Gdd„de(ƒZ)Gdd„de(ƒZ*e)ƒZ+e*ƒZ,Gdd„dƒZ-Gd d!„d!e-ƒZ.e.ƒZ/d"d#„Z0e1ed$ƒ�rše 2¡e0ƒZ0Gd%d&„d&ƒZ3Gd'd(„d(ƒZ4Gd)d*„d*e3ƒZ5Gd+d,„d,e3ƒZ6Gd-d.„d.e3ƒZ7Gd/d0„d0e ƒZ8Gd1d „d e'ƒZ9ej: ;e9¡Gd2d„de9ƒZGd5d„de>e<ƒZ?Gd6d„de>e=ƒZ@dS)7éN)ÚSequence)ÚEINVALÚENOENTÚENOTDIRÚEBADFÚELOOP)Ú attrgetter)ÚS_ISDIRÚS_ISLNKÚS_ISREGÚS_ISSOCKÚS_ISBLKÚS_ISCHRÚS_ISFIFO)Úquote_from_bytesTÚnté)ér)Ú_getfinalpathnameFÚPurePathÚ PurePosixPathÚPureWindowsPathÚPathÚ PosixPathÚ WindowsPath)éi�cCs t|ddƒtkpt|ddƒtkS)NÚerrnoZwinerror)ÚgetattrÚ_IGNORED_ERROSÚ_IGNORED_WINERRORS)Z exception©r ú,/opt/alt/python37/lib64/python3.7/pathlib.pyÚ _ignore_error-sr"cCsd|kpd|kpd|kS)NÚ*ú?ú[r )Úpatr r r!Ú_is_wildcard_pattern2sr'c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_FlavourzPA flavour implements a particular (platform-specific) set of path semantics.cCs|jj|_dS)N)ÚsepÚjoin)Úselfr r r!Ú__init__<sz_Flavour.__init__c Csg}|j}|j}d}}t|ƒ}xÒ|D]Ê}|s0q&|r@| ||¡}| |¡\}}} || krŽxPt|  |¡ƒD] } | rh| dkrh| t | ¡¡qhWn| rª| dkrª| t | ¡¡|s²|r&|sîx6|D].}|sÆq¼|rÖ| ||¡}| |¡d}|r¼Pq¼WPq&W|sþ|�r | ||¡|  ¡|||fS)NÚÚ.r) r)ÚaltsepÚreversedÚreplaceÚ splitrootÚsplitÚappendÚsysÚinternÚreverse) r+ÚpartsZparsedr)r/ÚdrvÚrootÚitÚpartZrelÚxr r r!Ú parse_parts?s@       z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd…fSnF|rb||ksJ| |¡| |¡krp||||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+r9r:r8Zdrv2Zroot2Zparts2r r r!Újoin_parsed_partsesz_Flavour.join_parsed_partsN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r,r>rAr r r r!r(8s&r(c@sÀeZdZdZdZdZeZej dkZ e dƒZ dZ ddd d hd d „ed dƒDƒBdd „ed dƒDƒBZefdd„Zdd„Zdd„Zdd„Zd&dd„Ze fdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%S)'Ú_WindowsFlavourú\ú/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|] }d|’qS)zCOM%dr )Ú.0Úir r r!ú ‡sz_WindowsFlavour.r?é cCsh|] }d|’qS)zLPT%dr )rIrJr r r!rKˆsc Cs\|dd…}|dd…}||krP||krP| |¡\}}|dd…}|dd…}nd}|dd…}||krü||krü||krü| |d¡}|dkrü| ||d¡}||dkrü|dkr¸t|ƒ}|rÞ||d|…|||dd…fS|d|…|||dd…fSd} } |dk�r6||jk�r6|dd…} |dd…}|}||k�rN|} | |¡}|| | |fS)Nrr?rr-ééÿÿÿÿú:)Ú_split_extended_pathÚfindÚlenÚ drive_lettersÚlstrip) r+r<r)ÚfirstÚsecondÚprefixZthirdÚindexZindex2r9r:r r r!r2‘s6      "    z_WindowsFlavour.splitrootcCs| ¡S)N)Úlower)r+Úsr r r!r@¸sz_WindowsFlavour.casefoldcCsdd„|DƒS)NcSsg|] }| ¡‘qSr )rY)rIÚpr r r!ú ¼sz2_WindowsFlavour.casefold_parts..r )r+r8r r r!Úcasefold_parts»sz_WindowsFlavour.casefold_partscCst t |¡tj¡jS)N)ÚreÚcompileÚfnmatchÚ translateÚ IGNORECASEÚ fullmatch)r+Úpatternr r r!Úcompile_pattern¾sz_WindowsFlavour.compile_patternFcCs¨t|ƒ}|st ¡Sd}tdk r¤|r2| t|ƒ¡Sg}xly| t|ƒ¡}Wn>tk rˆ|}tj |¡\}}| |¡||kr„|SYq8Xtjj |ft |ƒžŽSq8WdS)N) ÚstrÚosÚgetcwdrÚ_ext_to_normalÚFileNotFoundErrorÚpathr3r4r*r0)r+rkÚstrictrZZ previous_sZ tail_partsÚtailr r r!ÚresolveÁs&  z_WindowsFlavour.resolvecCsXd}| |¡rP|dd…}|dd…}| d¡rP||dd…7}d|dd…}||fS)Nr-ézUNC\rMrG)Ú startswith)r+rZZ ext_prefixrWr r r!rPÙs    z$_WindowsFlavour._split_extended_pathcCs| |¡dS)Nr?)rP)r+rZr r r!riãsz_WindowsFlavour._ext_to_normalcCs6|sdS|d d¡rdS|d d¡d ¡|jkS)NFrz\\rNr.)rpÚ partitionÚupperÚreserved_names)r+r8r r r!Ú is_reservedçs z_WindowsFlavour.is_reservedcCsd|j}t|ƒdkrJ|ddkrJ| ¡dd… d¡}d|t| d¡ƒfSdt| ¡ d¡ƒSdS)Nrr?rOrHz file:///%s/%szutf-8zfile:)ÚdriverRÚas_posixrTÚurlquote_from_bytesÚencode)r+rkruÚrestr r r!Úmake_uriós z_WindowsFlavour.make_uricCsòdtjkrtjd}n`dtjkr,tjd}nJdtjkrnytjd}Wntk r\d}YnX|tjd}ntdƒ‚|rîtjd|krî| |f¡\}}}|dtjdkr¸td |ƒ‚||d<|sÈ|rä||| |d d…¡}n | |¡}|S) NÚHOMEZ USERPROFILEZHOMEPATHZ HOMEDRIVEr-zCan't determine home directoryZUSERNAMErNz%Can't determine home directory for %rr?)rgÚenvironÚKeyErrorÚ RuntimeErrorr>r*)r+ÚusernameÚuserhomer9r:r8r r r!Ú gethomedirÿs,       z_WindowsFlavour.gethomedirN)F)rBrCrDr)r/Úhas_drvÚntpathÚpathmodrgÚnameÚ is_supportedÚsetrSZext_namespace_prefixÚrangersr2r@r]rernrPrirtrzr�r r r r!rFws&  '    rFc@sleZdZdZdZdZeZej dkZ efdd„Z dd„Z d d „Z d d „Zdd d„Zdd„Zdd„Zdd„ZdS)Ú _PosixFlavourrHr-FrcCsV|rH|d|krH| |¡}t|ƒt|ƒdkr._resolver-)r)Ú _accessorÚ is_absolutergrhrf)r+rkrlÚbaser )r‘r’r“r)rlr!rn>s &z_PosixFlavour.resolvecCsdS)NFr )r+r8r r r!rtksz_PosixFlavour.is_reservedcCst|ƒ}dt|ƒS)Nzfile://)Úbytesrw)r+rkZbpathr r r!rznsz_PosixFlavour.make_uricCst|s:y tjdStk r6ddl}| t ¡¡jSXn6ddl}y | |¡jStk rntd|ƒ‚YnXdS)Nr{rz%Can't determine home directory for %r) rgr|r}ÚpwdÚgetpwuidÚgetuidÚpw_dirÚgetpwnamr~)r+rr˜r r r!r�ts  z_PosixFlavour.gethomedirN)F)rBrCrDr)r/r‚Ú posixpathr„rgr…r†r2r@r]rernrtrzr�r r r r!r‰s   -r‰c@seZdZdZdS)Ú _AccessorzjAn accessor implements a particular (system-specific or not) way of accessing paths on the filesystem.N)rBrCrDrEr r r r!ržˆsržc@sœeZdZejZejZejZejZejZej Z e edƒr>ej Z ndd„Z ej Z ej Z ejZejZejZer~ertejZqŠdd„Zn edd„ƒZejZdd„Zd S) Ú_NormalAccessorÚlchmodcCs tdƒ‚dS)Nz%lchmod() not available on this system)ÚNotImplementedError)r+ZpathobjÚmoder r r!r žsz_NormalAccessor.lchmodcCs tdƒ‚dS)Nz&symlink() not available on this system)r¡)ÚaÚbÚtarget_is_directoryr r r!Úsymlink¯sz_NormalAccessor.symlinkcCs t ||¡S)N)rgr¦)r£r¤r¥r r r!r¦³scCs t |¡S)N)rgr‹)r+rkr r r!r‹ºsz_NormalAccessor.readlinkN)rBrCrDrgÚstatÚlstatÚopenÚlistdirÚscandirÚchmodÚhasattrr ÚmkdirÚunlinkÚrmdirÚrenamer1rÚsupports_symlinksr¦Ú staticmethodÚutimer‹r r r r!rŸ�s*   rŸcCsR|d}|dd…}|dkr"t}n$d|kr4tdƒ‚nt|ƒrBt}nt}||||ƒS)Nrr?z**z:Invalid pattern: '**' can only be an entire path component)Ú_RecursiveWildcardSelectorÚ ValueErrorr'Ú_WildcardSelectorÚ_PreciseSelector)Ú pattern_partsÚflavourr&Ú child_partsÚclsr r r!Ú_make_selectorÅs  r½Ú lru_cachec@s eZdZdZdd„Zdd„ZdS)Ú _SelectorzYA selector matches a specific glob pattern part against the children of a given path.cCs0||_|rt||ƒ|_d|_ntƒ|_d|_dS)NTF)r»r½Ú successorÚdironlyÚ_TerminatingSelector)r+r»rºr r r!r,Ús  z_Selector.__init__cCs<t|ƒ}|j}|j}|jj}||ƒs,tgƒS| ||||¡S)zuIterate over all child paths of `parent_path` matched by this selector. This can contain parent_path itself.)ÚtypeÚis_dirÚexistsr”r«ÚiterÚ _select_from)r+Ú parent_pathZpath_clsrÄrÅr«r r r!Ú select_fromãsz_Selector.select_fromN)rBrCrDrEr,rÉr r r r!r¿Ös r¿c@seZdZdd„ZdS)rÂccs |VdS)Nr )r+rÈrÄrÅr«r r r!rÇñsz!_TerminatingSelector._select_fromN)rBrCrDrÇr r r r!rÂïsrÂc@seZdZdd„Zdd„ZdS)r¸cCs||_t |||¡dS)N)r…r¿r,)r+r…r»rºr r r!r,÷sz_PreciseSelector.__init__ccs^yD| |j¡}|jr|n||ƒrBx |j ||||¡D] }|Vq4WWntk rXdSXdS)N)Ú_make_child_relpathr…rÁrÀrÇÚPermissionError)r+rÈrÄrÅr«rkr[r r r!rÇûs z_PreciseSelector._select_fromN)rBrCrDr,rÇr r r r!r¸õsr¸c@seZdZdd„Zdd„ZdS)r·cCs| |¡|_t |||¡dS)N)reÚmatchr¿r,)r+r&r»rºr r r!r,s z_WildcardSelector.__init__c csÈy®||ƒ�}t|ƒ}WdQRXxŒ|D]„}|jrly| ¡s:w$Wn.tk rj}zt|ƒsX‚w$Wdd}~XYnX|j} | | ¡r$| | ¡} x |j  | |||¡D] } | VqšWq$WWnt k rÂdSXdS)N) ÚlistrÁrÄrŒr"r…rÌrÊrÀrÇrË) r+rÈrÄrÅr«Ú scandir_itÚentriesÚentryr�r…rkr[r r r!rÇ s&    z_WildcardSelector._select_fromN)rBrCrDr,rÇr r r r!r·sr·c@s$eZdZdd„Zdd„Zdd„ZdS)rµcCst |||¡dS)N)r¿r,)r+r&r»rºr r r!r,&sz#_RecursiveWildcardSelector.__init__c csÂ|Vy¢||ƒ�}t|ƒ}WdQRXx€|D]x}d}y | ¡}Wn,tk rj}zt|ƒsZ‚Wdd}~XYnX|r*| ¡s*| |j¡} x| | ||¡D] } | Vq”Wq*WWntk r¼dSXdS)NF) rÍrÄrŒr"Ú is_symlinkrÊr…Ú_iterate_directoriesrË) r+rÈrÄr«rÎrÏrÐZ entry_is_dirr�rkr[r r r!rÒ)s"     z/_RecursiveWildcardSelector._iterate_directoriesc cs„yjtƒ}zT|jj}xF| |||¡D]4}x.|||||ƒD]}||kr6|V| |¡q6Wq"WWd| ¡XWntk r~dSXdS)N)r‡rÀrÇrÒÚaddÚclearrË) r+rÈrÄrÅr«ZyieldedZsuccessor_selectZstarting_pointr[r r r!rÇ<sz'_RecursiveWildcardSelector._select_fromN)rBrCrDr,rÒrÇr r r r!rµ$srµ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|_dS)N)rÃrÖr×rØrÙ)r+rkr r r!r,Us z_PathParents.__init__cCs(|js |jrt|jƒdSt|jƒSdS)Nr?)r×rØrRrÙ)r+r r r!Ú__len__\s z_PathParents.__len__cCs@|dks|t|ƒkrt|ƒ‚|j |j|j|jd| d…¡S)Nrr?)rRÚ IndexErrorrÖÚ_from_parsed_partsr×rØrÙ)r+Úidxr r r!Ú __getitem__bsz_PathParents.__getitem__cCsd |jj¡S)Nz <{}.parents>)ÚformatrÖrB)r+r r r!Ú__repr__hsz_PathParents.__repr__N) rBrCrDrEÚ __slots__r,rÚrÞràr r r r!rÕPs rÕc@sœeZdZdZdZdd„Zdd„Zedd„ƒZedVd d „ƒZ edWd d „ƒZ edd„ƒZ dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zed d!„ƒZd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zeed.ƒd/d0�Zeed1ƒd2d0�Zed3d4„ƒZed5d6„ƒZ ed7d8„ƒZ!ed9d:„ƒZ"ed;d<„ƒZ#d=d>„Z$d?d@„Z%dAdB„Z&edCdD„ƒZ'dEdF„Z(dGdH„Z)dIdJ„Z*edKdL„ƒZ+edMdN„ƒZ,dOdP„Z-dQdR„Z.dSdT„Z/dUS)Xra|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$|tkrtjdkrtnt}| |¡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. r)rrgr…rrÚ _from_parts)r¼Úargsr r r!Ú__new__zszPurePath.__new__cCs|jt|jƒfS)N)Ú __class__ÚtuplerÙ)r+r r r!Ú __reduce__„szPurePath.__reduce__cCshg}xV|D]N}t|tƒr$||j7}q t |¡}t|tƒrH| t|ƒ¡q tdt|ƒƒ‚q W|j   |¡S)NzNargument should be a str object or an os.PathLike object returning str, not %r) Ú isinstancerrÙrgÚfspathrfr4Ú TypeErrorrÃÚ_flavourr>)r¼rçr8r£r r r!Ú _parse_args‰s     zPurePath._parse_argsTcCs<t |¡}| |¡\}}}||_||_||_|r8| ¡|S)N)Úobjectrèrðr×rØrÙÚ_init)r¼rçÚinitr+r9r:r8r r r!ræ�s zPurePath._from_partscCs,t |¡}||_||_||_|r(| ¡|S)N)rñrèr×rØrÙrò)r¼r9r:r8rór+r r r!rܪs zPurePath._from_parsed_partscCs4|s|r$|||j |dd…¡S|j |¡SdS)Nr?)rïr*)r¼r9r:r8r r r!Ú_format_parsed_parts´szPurePath._format_parsed_partscCsdS)Nr )r+r r r!rò»szPurePath._initcCs@| |¡\}}}|j |j|j|j|||¡\}}}| |||¡S)N)rðrïrAr×rØrÙrÜ)r+rçr9r:r8r r r!Ú _make_child¿szPurePath._make_childcCs<y|jStk r6| |j|j|j¡p,d|_|jSXdS)z[Return the string representation of the path, suitable for passing to system calls.r.N)râÚAttributeErrorrôr×rØrÙ)r+r r r!Ú__str__Ås  zPurePath.__str__cCst|ƒS)N)rf)r+r r r!Ú __fspath__ÏszPurePath.__fspath__cCs|j}t|ƒ |jd¡S)zNReturn the string representation of the path with forward (/) slashes.rH)rïrfr1r))r+Úfr r r!rvÒszPurePath.as_posixcCs t |¡S)zaReturn the bytes representation of the path. This is only recommended to use under Unix.)rgÚfsencode)r+r r r!Ú __bytes__ØszPurePath.__bytes__cCsd |jj| ¡¡S)Nz{}({!r}))rßrérBrv)r+r r r!ràÝ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)r•r¶rïrz)r+r r r!Úas_uriàszPurePath.as_uricCs2y|jStk r,|j |j¡|_|jSXdS)N)rårörïr]rÙ)r+r r r!Ú_cpartsæs zPurePath._cpartscCs&t|tƒstS|j|jko$|j|jkS)N)rìrÚNotImplementedrýrï)r+Úotherr r r!Ú__eq__ïs zPurePath.__eq__cCs2y|jStk r,tt|jƒƒ|_|jSXdS)N)rãröÚhashrêrý)r+r r r!Ú__hash__ôs zPurePath.__hash__cCs&t|tƒr|j|jk rtS|j|jkS)N)rìrrïrþrý)r+rÿr r r!Ú__lt__ûszPurePath.__lt__cCs&t|tƒr|j|jk rtS|j|jkS)N)rìrrïrþrý)r+rÿr r r!Ú__le__szPurePath.__le__cCs&t|tƒr|j|jk rtS|j|jkS)N)rìrrïrþrý)r+rÿr r r!Ú__gt__szPurePath.__gt__cCs&t|tƒr|j|jk rtS|j|jkS)N)rìrrïrþrý)r+rÿr r r!Ú__ge__ szPurePath.__ge__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+Úanchorr r r!rs zPurePath.anchorcCs.|j}t|ƒ|js|jrdndkr&dS|dS)z!The final path component, if any.r?rr-rN)rÙrRr×rØ)r+r8r r r!r…sz PurePath.namecCsD|j}| d¡}d|kr,t|ƒdkr.r?N)r…ÚendswithrTr3)r+r…r r r!Úsuffixes1s   zPurePath.suffixescCsD|j}| d¡}d|kr,t|ƒdkrs    z PurePath.stemcCs†|jstd|fƒ‚|j |f¡\}}}|rX|d|jj|jjgksX|sX|sXt|ƒdkrdtd|ƒ‚| |j|j |j dd…|g¡S)z-Return a new path with the file name changed.z%r has an empty namerNr?zInvalid name %rN) r…r¶rïr>r)r/rRrÜr×rØrÙ)r+r…r9r:r8r r r!Ú with_nameHs  zPurePath.with_namecCs´|j}|j|ks |jr.|j|kr.td|fƒ‚|r<| d¡rD|dkrPtd|ƒ‚|j}|shtd|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.z%r has an empty nameNrN) rïr)r/r¶rpr…r rRrÜr×rØrÙ)r+r rùr…Z old_suffixr r r!Ú with_suffixSs   zPurePath.with_suffixc Gsì|s tdƒ‚|j}|j}|j}|r8||g|dd…}n|}| |¡\}}}|rf||g|dd…} n|} t| ƒ} |jj} | dkrŒ|s¤|rÊn| |d| …ƒ| | ƒkrÊ| |||¡} t d  t |ƒt | ƒ¡ƒ‚|  d| dkrÜ|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?Nrz{!r} does not start with {!r}r-) rîrÙr×rØrðrRrïr]rôr¶rßrfrÜ) r+rÿr8r9r:Z abs_partsZto_drvZto_rootZto_partsZ to_abs_partsÚnÚcfZ formattedr r r!Ú relative_tohs( *zPurePath.relative_tocCs.y|jStk r(t|jƒ|_|jSXdS)zZAn object providing sequence-like access to the components in the filesystem path.N)rärörêrÙ)r+r r r!r8ˆs  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+rçr r r!Újoinpath”szPurePath.joinpathcCs | |f¡S)N)rõ)r+Úkeyr r r!Ú __truediv__œszPurePath.__truediv__cCs| |g|j¡S)N)rærÙ)r+rr r r!Ú __rtruediv__ŸszPurePath.__rtruediv__cCs@|j}|j}|j}t|ƒdkr*|s&|r*|S| |||dd…¡S)zThe logical parent of the path.r?NrN)r×rØrÙrRrÜ)r+r9r:r8r r r!Úparent¢s zPurePath.parentcCst|ƒS)z*A sequence of this path's logical parents.)rÕ)r+r r r!Úparents¬szPurePath.parentscCs|js dS|jj pt|jƒS)zSTrue if the path is absolute (has both a root and, if applicable, a drive).F)rØrïr‚Úboolr×)r+r r r!r•±szPurePath.is_absolutecCs|j |j¡S)zaReturn True if the path contains one of the special names reserved by the system, if any.)rïrtrÙ)r+r r r!rt¸szPurePath.is_reservedc CsÔ|jj}||ƒ}|j |f¡\}}}|s0tdƒ‚|rF|||jƒkrFdS|r\|||jƒkr\dS|j}|sj|rŒt|ƒt|ƒkr~dS|dd…}nt|ƒt|ƒkr dSx.tt |ƒt |ƒƒD]\}}t   ||¡s´dSq´WdS)zE Return True if this path matches the given pattern. z empty patternFr?NT) rïr@r>r¶r×rØrýrRÚzipr0r`Z fnmatchcase) r+Z path_patternrr9r:Z pat_partsr8r<r&r r r!r̽s( zPurePath.matchN)T)T)0rBrCrDrErárèrëÚ classmethodrðrærÜrôròrõr÷rørvrûràrüÚpropertyrýrrrrrrrrur:rr…r r r rrrr8rrrrrr•rtrÌr r r r!rls\             c@seZdZdZeZdZdS)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. r N)rBrCrDrEÚ_posix_flavourrïrár r r r!rÛsc@seZdZdZeZdZdS)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. r N)rBrCrDrEÚ_windows_flavourrïrár r r r!råsc@s�eZdZdZdZdd„Zdbdd„Zdd „Zd d „Zd d „Z dd„Z dcdd„Z dddd„Z e dd„ƒZe dd„ƒZdd„Zdd„Zdd„Zd d!„Zd"d#„Zded%d&„Zd'd(„Zd)d*„Zd+d,„Zdfd/d0„Zd1d2„Zdgd3d4„Zd5d6„Zdhd7d8„Zdid:d;„Zdjdd?„Z d@dA„Z!dBdC„Z"dDdE„Z#dFdG„Z$dHdI„Z%dJdK„Z&dkdLdM„Z'dNdO„Z(dPdQ„Z)dRdS„Z*dTdU„Z+dVdW„Z,dXdY„Z-dZd[„Z.d\d]„Z/d^d_„Z0d`da„Z1dS)lra¡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. )r”Ú_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j fƒ‚|  ¡|S)NrF)róz$cannot instantiate %r on your system) rrgr…rrrærïr†r¡rBrò)r¼rçÚkwargsr+r r r!rès z Path.__new__NcCs"d|_|dk r|j|_nt|_dS)NF)rr”Ú_normal_accessor)r+Útemplater r r!rò s z Path._initcCs|j|g}| |j|j|¡S)N)rÙrÜr×rØ)r+r<r8r r r!rÊs zPath._make_child_relpathcCs|jr| ¡|S)N)rÚ _raise_closed)r+r r r!Ú __enter__szPath.__enter__cCs d|_dS)NT)r)r+ÚtÚvÚtbr r r!Ú__exit__sz Path.__exit__cCs tdƒ‚dS)NzI/O operation on closed path)r¶)r+r r r!r#"szPath._raise_closedé¶cCs|j |||¡S)N)r”r©)r+r…Úflagsr¢r r r!Ú_opener%sz Path._openeréÿcCs|jr| ¡|j |||¡S)zm Open the file pointed by this path and return a file descriptor, as os.open() does. )rr#r”r©)r+r*r¢r r r!Ú _raw_open)szPath._raw_opencCs |t ¡ƒS)zjReturn a new path pointing to the current working directory (as returned by os.getcwd()). )rgrh)r¼r r r!Úcwd4szPath.cwdcCs||ƒj d¡ƒS)zrReturn a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). N)rïr�)r¼r r r!Úhome;sz Path.homecCsB| ¡}y | ¡}Wntk r2t |¡}YnXtj ||¡S)zoReturn whether other_path is the same or not as this file (as returned by os.path.samefile()). )r§rörgrkÚsamestat)r+Z other_pathÚstZother_str r r!ÚsamefileBs  z Path.samefileccsL|jr| ¡x8|j |¡D](}|dkr*q| |¡V|jr| ¡qWdS)zyIterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. >ú..r.N)rr#r”rªrÊ)r+r…r r r!ÚiterdirMs z Path.iterdirccsd|std |¡ƒ‚|j |f¡\}}}|s.|r6tdƒ‚tt|ƒ|jƒ}x| |¡D] }|VqRWdS)z‘Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. zUnacceptable pattern: {!r}z%Non-relative patterns are unsupportedN)r¶rßrïr>r¡r½rêrÉ)r+rdr9r:r¹Úselectorr[r r r!Úglob[sz Path.globccsV|j |f¡\}}}|s|r$tdƒ‚tdt|ƒ|jƒ}x| |¡D] }|VqDWdS)z¡Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. z%Non-relative patterns are unsupported)z**N)rïr>r¡r½rêrÉ)r+rdr9r:r¹r5r[r r r!Úrglobhs z Path.rglobcCsD|jr| ¡| ¡r|S|jt ¡g|jdd�}|j|d�|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. F)ró)r")rr#r•rærgrhrÙrò)r+Úobjr r r!Úabsolutets z Path.absoluteFcCsh|jr| ¡|jj||d�}|dkr:| ¡t| ¡ƒ}|jj |¡}|j |fdd�}|j |d�|S)z± Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). )rlNF)ró)r") rr#rïrnr§rfr9r„Únormpathrærò)r+rlrZZnormedr8r r r!rn†s  z Path.resolvecCs |j |¡S)zh Return the result of the stat() system call on this path, like os.stat() does. )r”r§)r+r r r!r§šsz Path.statcCsddl}| | ¡j¡jS)z: Return the login name of the file owner. rN)r˜r™r§Úst_uidZpw_name)r+r˜r r r!Úowner¡sz Path.ownercCsddl}| | ¡j¡jS)z8 Return the group name of the file gid. rN)ÚgrpZgetgrgidr§Úst_gidZgr_name)r+r=r r r!Úgroup¨sz Path.groupÚrrNc Cs(|jr| ¡tj|||||||jd�S)z| Open the file pointed by this path and return a file object, as the built-in open() function does. )Úopener)rr#Úior©r+)r+r¢Ú bufferingÚencodingÚerrorsÚnewliner r r!r©¯sz Path.openc Cs |jdd�� }| ¡SQRXdS)zK Open the file in bytes mode, read it, and close the file. Úrb)r¢N)r©Úread)r+rùr r r!Ú read_bytesºszPath.read_bytesc Cs$|jd||d�� }| ¡SQRXdS)zJ Open the file in text mode, read it, and close the file. r@)r¢rDrEN)r©rH)r+rDrErùr r r!Ú read_textÁszPath.read_textc Cs*t|ƒ}|jdd�� }| |¡SQRXdS)zO Open the file in bytes mode, write to it, and close the file. Úwb)r¢N)Ú memoryviewr©Úwrite)r+ÚdataZviewrùr r r!Ú write_bytesÈszPath.write_bytesc Cs@t|tƒstd|jjƒ‚|jd||d�� }| |¡SQRXdS)zN Open the file in text mode, write to it, and close the file. zdata must be str, not %sÚw)r¢rDrEN)rìrfrîrérBr©rM)r+rNrDrErùr r r!Ú write_textÑs   zPath.write_textTcCsr|jr| ¡|r>y|j |d¡Wntk r8YnXdStjtjB}|sX|tjO}|  ||¡}t  |¡dS)zS Create this file with the given access mode, if it doesn't exist. N) rr#r”r´rŒrgÚO_CREATÚO_WRONLYÚO_EXCLr-Úclose)r+r¢Úexist_okr*Úfdr r r!ÚtouchÛs   z Path.touchcCsŠ|jr| ¡y|j ||¡Wndtk rd|r>|j|kr@‚|jjddd�|j|d|d�Yn"tk r„|r~| ¡s€‚YnXdS)z< Create a new directory at this given path. T)rrVFN)rr#r”r®rjrrŒrÄ)r+r¢rrVr r r!r®òs z Path.mkdircCs |jr| ¡|j ||¡dS)zF Change the permissions of the path, like os.chmod(). N)rr#r”r¬)r+r¢r r r!r¬sz Path.chmodcCs |jr| ¡|j ||¡dS)z� Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. N)rr#r”r )r+r¢r r r!r  sz Path.lchmodcCs|jr| ¡|j |¡dS)zd Remove this file or link. If the path is a directory, use rmdir() instead. N)rr#r”r¯)r+r r r!r¯sz Path.unlinkcCs|jr| ¡|j |¡dS)zF Remove this directory. The directory must be empty. N)rr#r”r°)r+r r r!r°sz Path.rmdircCs|jr| ¡|j |¡S)z– Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. )rr#r”r¨)r+r r r!r¨'sz Path.lstatcCs |jr| ¡|j ||¡dS)z5 Rename this path to the given path. N)rr#r”r±)r+r�r r r!r±0sz Path.renamecCs |jr| ¡|j ||¡dS)zo Rename this path to the given path, clobbering the existing destination if it exists. N)rr#r”r1)r+r�r r r!r18sz Path.replacecCs"|jr| ¡|j |||¡dS)z™ Make this path a symlink pointing to the given path. Note the order of arguments (self, target) is the reverse of os.symlink's. N)rr#r”r¦)r+r�r¥r r r!Ú symlink_toAszPath.symlink_toc Cs>y | ¡Wn,tk r8}zt|ƒs(‚dSd}~XYnXdS)z+ Whether this path exists. FNT)r§rŒr")r+r�r r r!rÅLs z Path.existsc Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z3 Whether this path is a directory. FN)r r§Úst_moderŒr")r+r�r r r!rÄXs z Path.is_dirc Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)zq Whether this path is a regular file (also True for symlinks pointing to regular files). FN)r r§rZrŒr")r+r�r r r!Úis_filees z Path.is_filecCst| ¡r| ¡sdSt|jƒ}y| ¡j}Wntk r@dSX| ¡j}||krXdS| ¡j}| ¡j}||kS)z; Check if this path is a POSIX mount point FT)rÅrÄrrr§Úst_devrŒÚst_ino)r+rZ parent_devZdevZinoZ parent_inor r r!Úis_mountss    z Path.is_mountc Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z7 Whether this path is a symbolic link. FN)r r¨rZrŒr")r+r�r r r!rшs zPath.is_symlinkc Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z6 Whether this path is a block device. FN)r r§rZrŒr")r+r�r r r!Úis_block_device”s zPath.is_block_devicec Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z: Whether this path is a character device. FN)rr§rZrŒr")r+r�r r r!Úis_char_device¡s zPath.is_char_devicec Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z. Whether this path is a FIFO. FN)rr§rZrŒr")r+r�r r r!Úis_fifo®s z Path.is_fifoc Cs@yt| ¡jƒStk r:}zt|ƒs*‚dSd}~XYnXdS)z0 Whether this path is a socket. FN)r r§rZrŒr")r+r�r r r!Ú is_socket»s zPath.is_socketcCs`|js\|js\|jr\|jddd…dkr\|j |jddd…¡}| |g|jdd…¡S|S)zl Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser) rNr?ú~)r×rØrÙrïr�ræ)r+Zhomedirr r r!Ú expanduserÈs  zPath.expanduser)N)r))r,)F)r@rNNNN)NN)NN)r)T)r,FF)F)2rBrCrDrErárèròrÊr$r(r#r+r-rr.r/r2r4r6r7r9rnr§r<r?r©rIrJrOrQrXr®r¬r r¯r°r¨r±r1rYrÅrÄr[r^rÑr_r`rarbrdr r r r!ròs^                       c@seZdZdZdZdS)rzsPath subclass for non-Windows systems. On a POSIX system, instantiating a Path should return this object. r N)rBrCrDrErár r r r!rÔsc@s,eZdZdZdZdd„Zdd„Zdd„Zd S) rzqPath subclass for Windows systems. On a Windows system, instantiating a Path should return this object. r cCs tdƒ‚dS)Nz*Path.owner() is unsupported on this system)r¡)r+r r r!r<âszWindowsPath.ownercCs tdƒ‚dS)Nz*Path.group() is unsupported on this system)r¡)r+r r r!r?åszWindowsPath.groupcCs tdƒ‚dS)Nz-Path.is_mount() is unsupported on this system)r¡)r+r r r!r^èszWindowsPath.is_mountN)rBrCrDrErár<r?r^r r r r!rÛs )Ar`Ú functoolsrBrƒrgr�r^r5Ú_collections_abcrrrrrrrÚoperatorrr§r r r r r rrZ urllib.parserrwr²r…rZgetwindowsversionrÚ__all__rrr"r'rñr(rFr‰rrržrŸr!r½r­r¾r¿rÂr¸r·rµrÕrÚPathLikeÚregisterrrrrrr r r r!Úsp  $    ?(f1  ,n   e