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
237458b2
Kaydet (Commit)
237458b2
authored
Mar 10, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert rev. 54198, it's not really backwards compatible.
üst
86d8d352
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
20 deletions
+4
-20
glob.py
Lib/glob.py
+4
-7
test_glob.py
Lib/test/test_glob.py
+0
-10
NEWS
Misc/NEWS
+0
-3
No files found.
Lib/glob.py
Dosyayı görüntüle @
237458b2
"""Filename globbing utility."""
import
sys
import
os
import
re
import
fnmatch
import
re
__all__
=
[
"glob"
,
"iglob"
]
...
...
@@ -49,15 +48,13 @@ def iglob(pathname):
def
glob1
(
dirname
,
pattern
):
if
not
dirname
:
dirname
=
os
.
curdir
if
isinstance
(
pattern
,
unicode
)
and
not
isinstance
(
dirname
,
unicode
):
dirname
=
unicode
(
dirname
,
sys
.
getfilesystemencoding
())
try
:
names
=
os
.
listdir
(
dirname
)
except
os
.
error
:
return
[]
if
pattern
[
0
]
!=
'.'
:
names
=
filter
(
lambda
x
:
x
[
0
]
!=
'.'
,
names
)
return
fnmatch
.
filter
(
names
,
pattern
)
if
pattern
[
0
]
!=
'.'
:
names
=
filter
(
lambda
x
:
x
[
0
]
!=
'.'
,
names
)
return
fnmatch
.
filter
(
names
,
pattern
)
def
glob0
(
dirname
,
basename
):
if
basename
==
''
:
...
...
Lib/test/test_glob.py
Dosyayı görüntüle @
237458b2
...
...
@@ -52,16 +52,6 @@ class GlobTests(unittest.TestCase):
eq
(
self
.
glob
(
'aab'
),
[
self
.
norm
(
'aab'
)])
eq
(
self
.
glob
(
'zymurgy'
),
[])
# test return types are unicode, but only if os.listdir
# returns unicode filenames
uniset
=
set
([
unicode
])
tmp
=
os
.
listdir
(
u'.'
)
if
set
(
type
(
x
)
for
x
in
tmp
)
==
uniset
:
u1
=
glob
.
glob
(
u'*'
)
u2
=
glob
.
glob
(
u'./*'
)
self
.
assertEquals
(
set
(
type
(
r
)
for
r
in
u1
),
uniset
)
self
.
assertEquals
(
set
(
type
(
r
)
for
r
in
u2
),
uniset
)
def
test_glob_one_directory
(
self
):
eq
=
self
.
assertSequencesEqual_noorder
eq
(
self
.
glob
(
'a*'
),
map
(
self
.
norm
,
[
'a'
,
'aab'
,
'aaa'
]))
...
...
Misc/NEWS
Dosyayı görüntüle @
237458b2
...
...
@@ -217,9 +217,6 @@ Library
never
made
sense
with
ordinary
subclasses
--
the
failure
just
occurred
later
,
with
a
more
cumbersome
exception
.
-
Patch
#
1001604
:
glob
.
glob
()
now
returns
unicode
filenames
if
it
was
given
a
unicode
argument
and
os
.
listdir
()
returns
unicode
filenames
.
-
Patch
#
685268
:
Consider
a
package
's __path__ in imputil.
- Patch 1463026: Support default namespace in XMLGenerator.
...
...
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