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
d6cfb8e0
Kaydet (Commit)
d6cfb8e0
authored
Kas 01, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reapplied r74493 (after #6665 fix has been backported)
üst
07728e9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
filelist.py
Lib/distutils/filelist.py
+3
-1
test_filelist.py
Lib/distutils/tests/test_filelist.py
+7
-7
No files found.
Lib/distutils/filelist.py
Dosyayı görüntüle @
d6cfb8e0
...
@@ -344,7 +344,9 @@ def translate_pattern (pattern, anchor=1, prefix=None, is_regex=0):
...
@@ -344,7 +344,9 @@ def translate_pattern (pattern, anchor=1, prefix=None, is_regex=0):
pattern_re
=
''
pattern_re
=
''
if
prefix
is
not
None
:
if
prefix
is
not
None
:
prefix_re
=
(
glob_to_re
(
prefix
))[
0
:
-
1
]
# ditch trailing $
# ditch end of pattern character
empty_pattern
=
glob_to_re
(
''
)
prefix_re
=
(
glob_to_re
(
prefix
))[:
-
len
(
empty_pattern
)]
pattern_re
=
"^"
+
os
.
path
.
join
(
prefix_re
,
".*"
+
pattern_re
)
pattern_re
=
"^"
+
os
.
path
.
join
(
prefix_re
,
".*"
+
pattern_re
)
else
:
# no prefix -- respect anchor flag
else
:
# no prefix -- respect anchor flag
if
anchor
:
if
anchor
:
...
...
Lib/distutils/tests/test_filelist.py
Dosyayı görüntüle @
d6cfb8e0
...
@@ -6,15 +6,15 @@ class FileListTestCase(unittest.TestCase):
...
@@ -6,15 +6,15 @@ class FileListTestCase(unittest.TestCase):
def
test_glob_to_re
(
self
):
def
test_glob_to_re
(
self
):
# simple cases
# simple cases
self
.
assertEquals
(
glob_to_re
(
'foo*'
),
'foo[^/]*
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo*'
),
'foo[^/]*
\\
Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
'foo?'
),
'foo[^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo?'
),
'foo[^/]
\\
Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
'foo??'
),
'foo[^/][^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo??'
),
'foo[^/][^/]
\\
Z(?ms)
'
)
# special cases
# special cases
self
.
assertEquals
(
glob_to_re
(
r'foo\\*'
),
r'foo\\\\[^/]*
$
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\*'
),
r'foo\\\\[^/]*
\Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\\*'
),
r'foo\\\\\\[^/]*
$
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\\*'
),
r'foo\\\\\\[^/]*
\Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
'foo????'
),
r'foo[^/][^/][^/][^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo????'
),
r'foo[^/][^/][^/][^/]
\Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\??'
),
r'foo\\\\[^/][^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\??'
),
r'foo\\\\[^/][^/]
\Z(?ms)
'
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
FileListTestCase
)
return
unittest
.
makeSuite
(
FileListTestCase
)
...
...
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