• File: ntpath.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/ntpath.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 12.14 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

RjO&@s@dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z
d1d2Zd3dZd4dZd5d
Zd6dZd7dZd8dZejje_d9dZd:dZd;dZd<dZydd=lmZWnek
r(d	ZYnXd>dZd?dZd@Zd	a d	a!dAdZ"dBd Z#dCdDZ$yddElm%Z%Wnek
re$Z&Yn
XdFd!Z&e&Z'e(e
dGoe
)dHdIkZ*dQdJd,Z+dKd0Z,y,e
)d	dIdLkrddMlm-Z-neWn"e.efk
rdNdOZ-YnXyddPlm/Z0Wnek
r:YnXd	S)RzCommon pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
.z..\;/z.;C:\binZnulN)*normcaseisabsjoin
splitdrivesplitsplitextbasenamedirnamecommonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount
expanduser
expandvarsnormpathabspathcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpathsamefilesameopenfilesamestat
commonpathcCst|trdSdSdS)Ns\/z\/)
isinstancebytes)pathr0+/opt/alt/python37/lib64/python3.7/ntpath.py
_get_bothseps"s
r2c	Csxt|}y.t|tr&|ddS|ddSWn:ttfk
rrt|ttfsltd|j	j
dYnXdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes./\rrz0normcase() argument must be str or bytes, not %rN)osfspathr-r.replacelower	TypeErrorAttributeErrorstr	__class____name__)sr0r0r1r,s

cCs2t|}t|d}t|dko0|dt|kS)zTest whether a path is absoluter)r5r6r
lenr2)r>r0r0r1rCs
c

GsTt|}t|tr"d}d}d}nd}d}d}y|sD|dd|t|\}}xttj|D]~}t|\}}	|	r|	d|kr|s|s|}|	}q^n*|r||kr||kr|}|	}q^|}|r|d|kr||}||	}q^W|r|d|kr|r|dd|kr|||S||Sttt	fk
rNt
jd	|f|YnXdS)
Nr4s\/:rz\/:rr	)r5r6r-r.r
mapr8r9r:BytesWarninggenericpath_check_arg_types)
r/pathsr sepscolonZresult_driveZresult_pathpZp_driveZp_pathr0r0r1r	KsF

cCst|}t|dkrt|tr0d}d}d}nd}d}d}|||}|dd|dkr|dd	|kr||d}|d
kr|dd|fS|||d}||dkr|dd|fS|d
krt|}|d|||dfS|dd|kr|dd|ddfS|dd|fS)
aSplit a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    r4r3rArrrBrrCNr?)r5r6r@r-r.r7find)rKr r#rJZnormpindexZindex2r0r0r1r
zs.

$cCs|t|}t|}t|\}}t|}x |rF||d|krF|d8}q(W|d|||d}}||pn|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.r?N)r5r6r2r
r@rstrip)rKrIdiheadtailr0r0r1rs
cCs8t|}t|tr$t|dddSt|dddSdS)Nr4r3.rrr)r5r6r-r.rF	_splitext)rKr0r0r1rs

cCst|dS)z)Returns the final component of a pathnamer?)r)rKr0r0r1r
scCst|dS)z-Returns the directory component of a pathnamer)r)rKr0r0r1rsc	Cs4yt|}Wnttfk
r&dSXt|jS)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r5lstatOSErrorr:statS_ISLNKst_mode)r/str0r0r1rs
cCs(yt|}Wntk
r"dSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r5rWrX)r/r\r0r0r1rs
)_getvolumepathnamecCstt|}t|}t|}t|\}}|rD|d|krD|pB||kS||krPdStrl||t||kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r5r6r2rr
r]rP)r/rIrootrestr0r0r1rs
cCst|}t|trd}nd}||s,|Sdt|}}x$||kr^||t|kr^|d7}q<Wdtjkrvtjd}n\dtjkrtjd}nFdtjkr|Sytjd}Wntk
rd}YnXt	|tjd}t|trt
|}|dkrt	t||d|}|||d	S)
zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.~~r?HOMEZUSERPROFILEZHOMEPATHZ	HOMEDRIVEN)r5r6r-r.
startswithr@r2environKeyErrorr	fsencoder)r/tilderRnuserhomedriver0r0r1rs2









z.'[^']*'?|%(%|[^%]*%?)|\$(\$|[-\w]+|\{[^}]*\}?)cst|}t|trjd|kr(d|kr(|StsHddl}|t|j	j
at}ddddttddnJd|kr~d	|kr~|Stsddl}|t|j	j
at}d	d
ddtj
fdd
}|||S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.$%rN{}environb$%{}cs|j}|dkr|dS||}|dkrR|kr2|S|sD|dS|dd}n4|kr^|S|r|sz|dS|dd}y*dkrttjt|S|SWntk
r|dSXdS)Nrr?rC)	lastindexendswithrdr5rgrefsdecoderf)mruname)bracedollarrepercentrbracer0r1replts,


zexpandvars.<locals>.repl)r5r6r-r._varsubbrecompile_varpatternencodeASCIIsubgetattr_varsubre)r/rrr~r0)rzr{rer|r}r1rUs4

c	CsTt|}t|tr*d}d}d}d}d}nd}d}d}d	}d
}||rL|S|||}t|\}}||r||7}||}||}d}x|t	|kr.||r|||kr||=q|||kr$|dkr||d|kr||d|d=|d8}n&|dkr|
|r||=n|d7}q|d7}qW|sF|sF|||||S)
z0Normalize path, eliminating double slashes, etc.r4r3rUs..)s\\.\s\\?\rrrz..)z\\.\z\\?\rr?)
r5r6r-r.rdr7r
lstriprr@rvappendr	)	r/r r#rrZspecial_prefixesprefixcompsrRr0r0r1rsF








cCs@t|}t|s8t|tr&t}nt}t||}t|S)zReturn the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r5r6rr-r.getcwdbgetcwdr	r)r/cwdr0r0r1_abspath_fallbacks



r)_getfullpathnamec	Cs.ytt|Sttfk
r(t|SXdS)z&Return the absolute version of a path.N)rrrX
ValueErrorr)r/r0r0r1rsgetwindowsversionrMrLcCsdt|}t|tr"d}d}d}nd}d}d}|dkr:|}|sFtdt|}ytt|}tt|}t|\}}t|\}	}
t|t|	krtd	|	|fd
d|	|D}dd|
	|D}d
}
x0t
||D]"\}}t|t|krP|
d7}
qW|gt||
||
d}|s(|St|St
ttttfk
r^td||YnXdS)z#Return a relative version of a pathr4rUs..rrz..Nzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|qSr0r0).0xr0r0r1
<listcomp>szrelpath.<locals>.<listcomp>cSsg|]}|r|qSr0r0)rrr0r0r1r	srr?r()r5r6r-r.rrrr
rrzipr@r	r9r:rEDeprecationWarningrFrG)r/startr rrZ	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest
start_list	path_listrRZe1Ze2rel_listr0r0r1r(sF


c	s|stdtttj|}t|dtr8dddndddy>fd	d
|D}fdd
|D}ytfdd
|D\}Wntk
rtddYnXttdd
|Ddkrtdt	|d
\}}|}fdd
|D}fdd
|D}t|}t
|}xBt|D]&\}	}
|
||	kr,|d|	}Pq,W|dt|}|rt|n|}||Sttfk
rtjd|YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr4r3rUrrrcs g|]}t|qSr0)r
r7r8)rrK)r#r r0r1r5szcommonpath.<locals>.<listcomp>csg|]\}}|qSr0)r)rrQrK)r r0r1r6sc3s"|]\}}|ddkVqdS)Nr?r0)rrQrK)r r0r1	<genexpr>9szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr0)rrQrKr0r0r1r@sr?zPaths don't have the same drivecsg|]}|r|kr|qSr0r0)rc)rr0r1rEscsg|]}fdd|DqS)csg|]}|r|kr|qSr0r0)rr)rr0r1rGsz)commonpath.<locals>.<listcomp>.<listcomp>r0)rr>)rr0r1rGsr,)r,)rtuplerDr5r6r-r.setr@r
r7rminmax	enumerater	r9r:rFrG)rHZdrivesplitssplit_pathsrrkr/commons1s2rRrrr0)r#rr r1r,$sF
)r)_getfinalpathnamecCstt|S)N)rr)fr0r0r1resr)_isdir)N)1__doc__rrr$r r!r#r"r%r5sysrYrF__all__r2rrr	r
rrrVr
rrrntr]ImportErrorrrrrrrrrrrr&hasattrrr'r(r,rr:rrr0r0r0r1<module>s



/8

2A1

85