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
edc4b2fa
Kaydet (Commit)
edc4b2fa
authored
Eyl 19, 2015
tarafından
Jason R. Coombs
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12285: Replace implementation of findall with implementation from Setuptools 7ce820d524db.
üst
1a04c447
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
27 deletions
+21
-27
filelist.py
Lib/distutils/filelist.py
+21
-27
No files found.
Lib/distutils/filelist.py
Dosyayı görüntüle @
edc4b2fa
...
@@ -6,6 +6,7 @@ and building lists of files.
...
@@ -6,6 +6,7 @@ and building lists of files.
import
os
,
re
import
os
,
re
import
fnmatch
import
fnmatch
import
functools
from
distutils.util
import
convert_path
from
distutils.util
import
convert_path
from
distutils.errors
import
DistutilsTemplateError
,
DistutilsInternalError
from
distutils.errors
import
DistutilsTemplateError
,
DistutilsInternalError
from
distutils
import
log
from
distutils
import
log
...
@@ -242,35 +243,28 @@ class FileList:
...
@@ -242,35 +243,28 @@ class FileList:
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Utility functions
# Utility functions
def
_find_all_simple
(
path
):
"""
Find all files under 'path'
"""
results
=
(
os
.
path
.
join
(
base
,
file
)
for
base
,
dirs
,
files
in
os
.
walk
(
path
,
followlinks
=
True
)
for
file
in
files
)
return
filter
(
os
.
path
.
isfile
,
results
)
def
findall
(
dir
=
os
.
curdir
):
def
findall
(
dir
=
os
.
curdir
):
"""Find all files under 'dir' and return the list of full filenames
(relative to 'dir').
"""
"""
from
stat
import
ST_MODE
,
S_ISREG
,
S_ISDIR
,
S_ISLNK
Find all files under 'dir' and return the list of full filenames.
Unless dir is '.', return full filenames with dir prepended.
list
=
[]
"""
stack
=
[
dir
]
files
=
_find_all_simple
(
dir
)
pop
=
stack
.
pop
if
dir
==
os
.
curdir
:
push
=
stack
.
append
make_rel
=
functools
.
partial
(
os
.
path
.
relpath
,
start
=
dir
)
files
=
map
(
make_rel
,
files
)
while
stack
:
return
list
(
files
)
dir
=
pop
()
names
=
os
.
listdir
(
dir
)
for
name
in
names
:
if
dir
!=
os
.
curdir
:
# avoid the dreaded "./" syndrome
fullname
=
os
.
path
.
join
(
dir
,
name
)
else
:
fullname
=
name
# Avoid excess stat calls -- just one will do, thank you!
stat
=
os
.
stat
(
fullname
)
mode
=
stat
[
ST_MODE
]
if
S_ISREG
(
mode
):
list
.
append
(
fullname
)
elif
S_ISDIR
(
mode
)
and
not
S_ISLNK
(
mode
):
push
(
fullname
)
return
list
def
glob_to_re
(
pattern
):
def
glob_to_re
(
pattern
):
...
...
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