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
4ffc8f51
Kaydet (Commit)
4ffc8f51
authored
Mar 13, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser.
üst
94fe3f58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
robotparser.py
Lib/robotparser.py
+6
-9
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/robotparser.py
Dosyayı görüntüle @
4ffc8f51
...
@@ -65,7 +65,7 @@ class RobotFileParser:
...
@@ -65,7 +65,7 @@ class RobotFileParser:
lines
.
append
(
line
.
strip
())
lines
.
append
(
line
.
strip
())
line
=
f
.
readline
()
line
=
f
.
readline
()
self
.
errcode
=
opener
.
errcode
self
.
errcode
=
opener
.
errcode
if
self
.
errcode
==
401
or
self
.
errcode
==
403
:
if
self
.
errcode
in
(
401
,
403
)
:
self
.
disallow_all
=
True
self
.
disallow_all
=
True
_debug
(
"disallow all"
)
_debug
(
"disallow all"
)
elif
self
.
errcode
>=
400
:
elif
self
.
errcode
>=
400
:
...
@@ -168,10 +168,7 @@ class RobotFileParser:
...
@@ -168,10 +168,7 @@ class RobotFileParser:
def
__str__
(
self
):
def
__str__
(
self
):
ret
=
""
return
''
.
join
([
str
(
entry
)
+
"
\n
"
for
entry
in
self
.
entries
])
for
entry
in
self
.
entries
:
ret
=
ret
+
str
(
entry
)
+
"
\n
"
return
ret
class
RuleLine
:
class
RuleLine
:
...
@@ -198,12 +195,12 @@ class Entry:
...
@@ -198,12 +195,12 @@ class Entry:
self
.
rulelines
=
[]
self
.
rulelines
=
[]
def
__str__
(
self
):
def
__str__
(
self
):
ret
=
""
ret
=
[]
for
agent
in
self
.
useragents
:
for
agent
in
self
.
useragents
:
ret
=
ret
+
"User-agent: "
+
agent
+
"
\n
"
ret
.
extend
([
"User-agent: "
,
agent
,
"
\n
"
])
for
line
in
self
.
rulelines
:
for
line
in
self
.
rulelines
:
ret
=
ret
+
str
(
line
)
+
"
\n
"
ret
.
extend
([
str
(
line
),
"
\n
"
])
return
ret
return
''
.
join
(
ret
)
def
applies_to
(
self
,
useragent
):
def
applies_to
(
self
,
useragent
):
"""check if this entry applies to the specified agent"""
"""check if this entry applies to the specified agent"""
...
...
Misc/NEWS
Dosyayı görüntüle @
4ffc8f51
...
@@ -168,6 +168,9 @@ Core and builtins
...
@@ -168,6 +168,9 @@ Core and builtins
Library
Library
-------
-------
- Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser.
- Patch #1635454: the csv.DictWriter class now includes the offending
- Patch #1635454: the csv.DictWriter class now includes the offending
field names in its exception message if you try to write a record with
field names in its exception message if you try to write a record with
a dictionary containing fields not in the CSV field names list.
a dictionary containing fields not in the CSV field names list.
...
...
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