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
a807137c
Kaydet (Commit)
a807137c
authored
Eki 31, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
wrap some things in with blocks
üst
2d8c917f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
38 deletions
+33
-38
ftplib.py
Lib/ftplib.py
+33
-38
No files found.
Lib/ftplib.py
Dosyayı görüntüle @
a807137c
...
...
@@ -406,13 +406,12 @@ class FTP:
The response code.
"""
self
.
voidcmd
(
'TYPE I'
)
conn
=
self
.
transfercmd
(
cmd
,
rest
)
while
1
:
data
=
conn
.
recv
(
blocksize
)
if
not
data
:
break
callback
(
data
)
conn
.
close
()
with
self
.
transfercmd
(
cmd
,
rest
)
as
conn
:
while
1
:
data
=
conn
.
recv
(
blocksize
)
if
not
data
:
break
callback
(
data
)
return
self
.
voidresp
()
def
retrlines
(
self
,
cmd
,
callback
=
None
):
...
...
@@ -429,20 +428,18 @@ class FTP:
"""
if
callback
is
None
:
callback
=
print_line
resp
=
self
.
sendcmd
(
'TYPE A'
)
conn
=
self
.
transfercmd
(
cmd
)
fp
=
conn
.
makefile
(
'r'
,
encoding
=
self
.
encoding
)
while
1
:
line
=
fp
.
readline
()
if
self
.
debugging
>
2
:
print
(
'*retr*'
,
repr
(
line
))
if
not
line
:
break
if
line
[
-
2
:]
==
CRLF
:
line
=
line
[:
-
2
]
elif
line
[
-
1
:]
==
'
\n
'
:
line
=
line
[:
-
1
]
callback
(
line
)
fp
.
close
()
conn
.
close
()
with
self
.
transfercmd
(
cmd
)
as
conn
,
\
conn
.
makefile
(
'r'
,
encoding
=
self
.
encoding
)
as
fp
:
while
1
:
line
=
fp
.
readline
()
if
self
.
debugging
>
2
:
print
(
'*retr*'
,
repr
(
line
))
if
not
line
:
break
if
line
[
-
2
:]
==
CRLF
:
line
=
line
[:
-
2
]
elif
line
[
-
1
:]
==
'
\n
'
:
line
=
line
[:
-
1
]
callback
(
line
)
return
self
.
voidresp
()
def
storbinary
(
self
,
cmd
,
fp
,
blocksize
=
8192
,
callback
=
None
,
rest
=
None
):
...
...
@@ -461,13 +458,12 @@ class FTP:
The response code.
"""
self
.
voidcmd
(
'TYPE I'
)
conn
=
self
.
transfercmd
(
cmd
,
rest
)
while
1
:
buf
=
fp
.
read
(
blocksize
)
if
not
buf
:
break
conn
.
sendall
(
buf
)
if
callback
:
callback
(
buf
)
conn
.
close
()
with
self
.
transfercmd
(
cmd
,
rest
)
as
conn
:
while
1
:
buf
=
fp
.
read
(
blocksize
)
if
not
buf
:
break
conn
.
sendall
(
buf
)
if
callback
:
callback
(
buf
)
return
self
.
voidresp
()
def
storlines
(
self
,
cmd
,
fp
,
callback
=
None
):
...
...
@@ -483,16 +479,15 @@ class FTP:
The response code.
"""
self
.
voidcmd
(
'TYPE A'
)
conn
=
self
.
transfercmd
(
cmd
)
while
1
:
buf
=
fp
.
readline
()
if
not
buf
:
break
if
buf
[
-
2
:]
!=
B_CRLF
:
if
buf
[
-
1
]
in
B_CRLF
:
buf
=
buf
[:
-
1
]
buf
=
buf
+
B_CRLF
conn
.
sendall
(
buf
)
if
callback
:
callback
(
buf
)
conn
.
close
()
with
self
.
transfercmd
(
cmd
)
as
conn
:
while
1
:
buf
=
fp
.
readline
()
if
not
buf
:
break
if
buf
[
-
2
:]
!=
B_CRLF
:
if
buf
[
-
1
]
in
B_CRLF
:
buf
=
buf
[:
-
1
]
buf
=
buf
+
B_CRLF
conn
.
sendall
(
buf
)
if
callback
:
callback
(
buf
)
return
self
.
voidresp
()
def
acct
(
self
,
password
):
...
...
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