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
030cfe26
Kaydet (Commit)
030cfe26
authored
Eyl 10, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use bytes regex instead of decoding whole pages
üst
c8f9c81c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
simple.py
Lib/packaging/pypi/simple.py
+10
-12
No files found.
Lib/packaging/pypi/simple.py
Dosyayı görüntüle @
030cfe26
...
@@ -159,22 +159,20 @@ class Crawler(BaseClient):
...
@@ -159,22 +159,20 @@ class Crawler(BaseClient):
Return a list of names.
Return a list of names.
"""
"""
with
self
.
_open_url
(
self
.
index_url
)
as
index
:
if
'*'
in
name
:
if
'*'
in
name
:
name
.
replace
(
'*'
,
'.*'
)
name
.
replace
(
'*'
,
'.*'
)
else
:
else
:
name
=
"
%
s
%
s
%
s"
%
(
'*.?'
,
name
,
'*.?'
)
name
=
"
%
s
%
s
%
s"
%
(
'*.?'
,
name
,
'*.?'
)
name
=
name
.
replace
(
'*'
,
'[^<]*'
)
# avoid matching end tag
name
=
name
.
replace
(
'*'
,
'[^<]*'
)
# avoid matching end tag
pattern
=
(
'<a[^>]*>(
%
s)</a>'
%
name
)
.
encode
(
'utf-8'
)
projectname
=
re
.
compile
(
'<a[^>]*>(
%
s)</a>'
%
name
,
re
.
I
)
projectname
=
re
.
compile
(
pattern
,
re
.
I
)
matching_projects
=
[]
matching_projects
=
[]
with
self
.
_open_url
(
self
.
index_url
)
as
index
:
index_content
=
index
.
read
()
index_content
=
index
.
read
()
# FIXME should use bytes I/O and regexes instead of decoding
index_content
=
index_content
.
decode
()
for
match
in
projectname
.
finditer
(
index_content
):
for
match
in
projectname
.
finditer
(
index_content
):
project_name
=
match
.
group
(
1
)
project_name
=
match
.
group
(
1
)
.
decode
(
'utf-8'
)
matching_projects
.
append
(
self
.
_get_project
(
project_name
))
matching_projects
.
append
(
self
.
_get_project
(
project_name
))
return
matching_projects
return
matching_projects
...
...
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