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
7ce734cd
Kaydet (Commit)
7ce734cd
authored
May 31, 2002
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use string methods where possible, and remove import string
üst
05ab2e69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
ftplib.py
Lib/ftplib.py
+5
-6
markupbase.py
Lib/markupbase.py
+5
-5
tabnanny.py
Lib/tabnanny.py
+1
-2
No files found.
Lib/ftplib.py
Dosyayı görüntüle @
7ce734cd
...
...
@@ -36,7 +36,6 @@ python ftplib.py -d localhost -l -p -l
import
os
import
sys
import
string
# Import SOCKS module if it exists, else standard socket module socket
try
:
...
...
@@ -266,7 +265,7 @@ class FTP:
if
af
==
0
:
raise
error_proto
,
'unsupported address family'
fields
=
[
''
,
`af`
,
host
,
`port`
,
''
]
cmd
=
'EPRT '
+
string
.
joinfields
(
fields
,
'|'
)
cmd
=
'EPRT '
+
'|'
.
join
(
fields
)
return
self
.
voidcmd
(
cmd
)
def
makeport
(
self
):
...
...
@@ -585,18 +584,18 @@ def parse229(resp, peer):
if
resp
[:
3
]
<>
'229'
:
raise
error_reply
,
resp
left
=
string
.
find
(
resp
,
'('
)
left
=
resp
.
find
(
'('
)
if
left
<
0
:
raise
error_proto
,
resp
right
=
string
.
find
(
resp
,
')'
,
left
+
1
)
right
=
resp
.
find
(
')'
,
left
+
1
)
if
right
<
0
:
raise
error_proto
,
resp
# should contain '(|||port|)'
if
resp
[
left
+
1
]
<>
resp
[
right
-
1
]:
raise
error_proto
,
resp
parts
=
string
.
split
(
resp
[
left
+
1
:
right
],
resp
[
left
+
1
])
parts
=
resp
[
left
+
1
]
.
split
(
resp
[
left
+
1
:
right
])
if
len
(
parts
)
<>
5
:
raise
error_proto
,
resp
host
=
peer
[
0
]
port
=
string
.
atoi
(
parts
[
3
])
port
=
int
(
parts
[
3
])
return
host
,
port
...
...
Lib/markupbase.py
Dosyayı görüntüle @
7ce734cd
...
...
@@ -38,10 +38,10 @@ class ParserBase:
if
i
>=
j
:
return
j
rawdata
=
self
.
rawdata
nlines
=
string
.
count
(
rawdata
,
"
\n
"
,
i
,
j
)
nlines
=
rawdata
.
count
(
"
\n
"
,
i
,
j
)
if
nlines
:
self
.
lineno
=
self
.
lineno
+
nlines
pos
=
string
.
rindex
(
rawdata
,
"
\n
"
,
i
,
j
)
# Should not fail
pos
=
rawdata
.
rindex
(
"
\n
"
,
i
,
j
)
# Should not fail
self
.
offset
=
j
-
(
pos
+
1
)
else
:
self
.
offset
=
self
.
offset
+
j
-
i
...
...
@@ -176,7 +176,7 @@ class ParserBase:
# style content model; just skip until '>'
rawdata
=
self
.
rawdata
if
'>'
in
rawdata
[
j
:]:
return
string
.
find
(
rawdata
,
">"
,
j
)
+
1
return
rawdata
.
find
(
">"
,
j
)
+
1
return
-
1
# Internal -- scan past <!ATTLIST declarations
...
...
@@ -200,7 +200,7 @@ class ParserBase:
if
c
==
"("
:
# an enumerated type; look for ')'
if
")"
in
rawdata
[
j
:]:
j
=
string
.
find
(
rawdata
,
")"
,
j
)
+
1
j
=
rawdata
.
find
(
")"
,
j
)
+
1
else
:
return
-
1
while
rawdata
[
j
:
j
+
1
]
in
string
.
whitespace
:
...
...
@@ -307,7 +307,7 @@ class ParserBase:
name
=
s
.
strip
()
if
(
i
+
len
(
s
))
==
n
:
return
None
,
-
1
# end of buffer
return
string
.
lower
(
name
),
m
.
end
()
return
name
.
lower
(
),
m
.
end
()
else
:
self
.
updatepos
(
declstartpos
,
i
)
self
.
error
(
"expected name token"
)
...
...
Lib/tabnanny.py
Dosyayı görüntüle @
7ce734cd
...
...
@@ -261,12 +261,11 @@ class Whitespace:
return
a
def
format_witnesses
(
w
):
import
string
firsts
=
map
(
lambda
tup
:
str
(
tup
[
0
]),
w
)
prefix
=
"at tab size"
if
len
(
w
)
>
1
:
prefix
=
prefix
+
"s"
return
prefix
+
" "
+
string
.
join
(
firsts
,
', '
)
return
prefix
+
" "
+
', '
.
join
(
firsts
)
def
process_tokens
(
tokens
):
INDENT
=
tokenize
.
INDENT
...
...
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