Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
599b65de
Kaydet (Commit)
599b65de
authored
Tem 23, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use augassign.
üst
db902ac0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
ntpath.py
Lib/ntpath.py
+22
-22
No files found.
Lib/ntpath.py
Dosyayı görüntüle @
599b65de
...
@@ -275,7 +275,7 @@ def split(p):
...
@@ -275,7 +275,7 @@ def split(p):
# set i to index beyond p's last slash
# set i to index beyond p's last slash
i
=
len
(
p
)
i
=
len
(
p
)
while
i
and
p
[
i
-
1
]
not
in
seps
:
while
i
and
p
[
i
-
1
]
not
in
seps
:
i
=
i
-
1
i
-=
1
head
,
tail
=
p
[:
i
],
p
[
i
:]
# now tail has no slashes
head
,
tail
=
p
[:
i
],
p
[
i
:]
# now tail has no slashes
# remove trailing slashes from head, unless it's all slashes
# remove trailing slashes from head, unless it's all slashes
head2
=
head
head2
=
head
...
@@ -366,7 +366,7 @@ def expanduser(path):
...
@@ -366,7 +366,7 @@ def expanduser(path):
return
path
return
path
i
,
n
=
1
,
len
(
path
)
i
,
n
=
1
,
len
(
path
)
while
i
<
n
and
path
[
i
]
not
in
_get_bothseps
(
path
):
while
i
<
n
and
path
[
i
]
not
in
_get_bothseps
(
path
):
i
=
i
+
1
i
+=
1
if
'HOME'
in
os
.
environ
:
if
'HOME'
in
os
.
environ
:
userhome
=
os
.
environ
[
'HOME'
]
userhome
=
os
.
environ
[
'HOME'
]
...
@@ -435,21 +435,21 @@ def expandvars(path):
...
@@ -435,21 +435,21 @@ def expandvars(path):
pathlen
=
len
(
path
)
pathlen
=
len
(
path
)
try
:
try
:
index
=
path
.
index
(
c
)
index
=
path
.
index
(
c
)
res
=
res
+
c
+
path
[:
index
+
1
]
res
+=
c
+
path
[:
index
+
1
]
except
ValueError
:
except
ValueError
:
res
=
res
+
path
res
+=
path
index
=
pathlen
-
1
index
=
pathlen
-
1
elif
c
==
percent
:
# variable or '%'
elif
c
==
percent
:
# variable or '%'
if
path
[
index
+
1
:
index
+
2
]
==
percent
:
if
path
[
index
+
1
:
index
+
2
]
==
percent
:
res
=
res
+
c
res
+=
c
index
=
index
+
1
index
+=
1
else
:
else
:
path
=
path
[
index
+
1
:]
path
=
path
[
index
+
1
:]
pathlen
=
len
(
path
)
pathlen
=
len
(
path
)
try
:
try
:
index
=
path
.
index
(
percent
)
index
=
path
.
index
(
percent
)
except
ValueError
:
except
ValueError
:
res
=
res
+
percent
+
path
res
+=
percent
+
path
index
=
pathlen
-
1
index
=
pathlen
-
1
else
:
else
:
var
=
path
[:
index
]
var
=
path
[:
index
]
...
@@ -461,11 +461,11 @@ def expandvars(path):
...
@@ -461,11 +461,11 @@ def expandvars(path):
value
=
'
%
'
+
var
+
'
%
'
value
=
'
%
'
+
var
+
'
%
'
if
isinstance
(
path
,
bytes
):
if
isinstance
(
path
,
bytes
):
value
=
value
.
encode
(
'ascii'
)
value
=
value
.
encode
(
'ascii'
)
res
=
res
+
value
res
+=
value
elif
c
==
dollar
:
# variable or '$$'
elif
c
==
dollar
:
# variable or '$$'
if
path
[
index
+
1
:
index
+
2
]
==
dollar
:
if
path
[
index
+
1
:
index
+
2
]
==
dollar
:
res
=
res
+
c
res
+=
c
index
=
index
+
1
index
+=
1
elif
path
[
index
+
1
:
index
+
2
]
==
brace
:
elif
path
[
index
+
1
:
index
+
2
]
==
brace
:
path
=
path
[
index
+
2
:]
path
=
path
[
index
+
2
:]
pathlen
=
len
(
path
)
pathlen
=
len
(
path
)
...
@@ -483,23 +483,23 @@ def expandvars(path):
...
@@ -483,23 +483,23 @@ def expandvars(path):
value
=
'${'
+
var
+
'}'
value
=
'${'
+
var
+
'}'
if
isinstance
(
path
,
bytes
):
if
isinstance
(
path
,
bytes
):
value
=
value
.
encode
(
'ascii'
)
value
=
value
.
encode
(
'ascii'
)
res
=
res
+
value
res
+=
value
except
ValueError
:
except
ValueError
:
if
isinstance
(
path
,
bytes
):
if
isinstance
(
path
,
bytes
):
res
=
res
+
b
'${'
+
path
res
+=
b
'${'
+
path
else
:
else
:
res
=
res
+
'${'
+
path
res
+=
'${'
+
path
index
=
pathlen
-
1
index
=
pathlen
-
1
else
:
else
:
var
=
''
var
=
''
index
=
index
+
1
index
+=
1
c
=
path
[
index
:
index
+
1
]
c
=
path
[
index
:
index
+
1
]
while
c
and
c
in
varchars
:
while
c
and
c
in
varchars
:
if
isinstance
(
path
,
bytes
):
if
isinstance
(
path
,
bytes
):
var
=
var
+
c
.
decode
(
'ascii'
)
var
+=
c
.
decode
(
'ascii'
)
else
:
else
:
var
=
var
+
c
var
+=
c
index
=
index
+
1
index
+=
1
c
=
path
[
index
:
index
+
1
]
c
=
path
[
index
:
index
+
1
]
if
var
in
os
.
environ
:
if
var
in
os
.
environ
:
value
=
os
.
environ
[
var
]
value
=
os
.
environ
[
var
]
...
@@ -507,12 +507,12 @@ def expandvars(path):
...
@@ -507,12 +507,12 @@ def expandvars(path):
value
=
'$'
+
var
value
=
'$'
+
var
if
isinstance
(
path
,
bytes
):
if
isinstance
(
path
,
bytes
):
value
=
value
.
encode
(
'ascii'
)
value
=
value
.
encode
(
'ascii'
)
res
=
res
+
value
res
+=
value
if
c
:
if
c
:
index
=
index
-
1
index
-=
1
else
:
else
:
res
=
res
+
c
res
+=
c
index
=
index
+
1
index
+=
1
return
res
return
res
...
@@ -529,7 +529,7 @@ def normpath(path):
...
@@ -529,7 +529,7 @@ def normpath(path):
# collapse initial backslashes
# collapse initial backslashes
if
path
.
startswith
(
sep
):
if
path
.
startswith
(
sep
):
prefix
=
prefix
+
sep
prefix
+=
sep
path
=
path
.
lstrip
(
sep
)
path
=
path
.
lstrip
(
sep
)
comps
=
path
.
split
(
sep
)
comps
=
path
.
split
(
sep
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment