@@ -72,7 +72,6 @@ class error_proto(Error): pass # response does not begin with [1-5]
72
72
73
73
# The class itself
74
74
class FTP :
75
-
76
75
'''An FTP client class.
77
76
78
77
To create a connection, call the class using these arguments:
@@ -105,12 +104,13 @@ class FTP:
105
104
passiveserver = 1
106
105
encoding = "latin-1"
107
106
108
- # Initialization method (called by class instantiation).
109
- # Initialize host to localhost, port to standard ftp port
110
- # Optional arguments are host (for connect()),
111
- # and user, passwd, acct (for login())
112
107
def __init__ (self , host = '' , user = '' , passwd = '' , acct = '' ,
113
108
timeout = _GLOBAL_DEFAULT_TIMEOUT , source_address = None ):
109
+ """Initialization method (called by class instantiation).
110
+ Initialize host to localhost, port to standard ftp port.
111
+ Optional arguments are host (for connect()),
112
+ and user, passwd, acct (for login()).
113
+ """
114
114
self .source_address = source_address
115
115
self .timeout = timeout
116
116
if host :
@@ -823,7 +823,6 @@ def parse227(resp):
823
823
'''Parse the '227' response for a PASV request.
824
824
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
825
825
Return ('host.addr.as.numbers', port#) tuple.'''
826
-
827
826
if resp [:3 ] != '227' :
828
827
raise error_reply (resp )
829
828
global _227_re
@@ -843,7 +842,6 @@ def parse229(resp, peer):
843
842
'''Parse the '229' response for an EPSV request.
844
843
Raises error_proto if it does not contain '(|||port|)'
845
844
Return ('host.addr.as.numbers', port#) tuple.'''
846
-
847
845
if resp [:3 ] != '229' :
848
846
raise error_reply (resp )
849
847
left = resp .find ('(' )
@@ -865,7 +863,6 @@ def parse257(resp):
865
863
'''Parse the '257' response for a MKD or PWD request.
866
864
This is a response to a MKD or PWD request: a directory name.
867
865
Returns the directoryname in the 257 reply.'''
868
-
869
866
if resp [:3 ] != '257' :
870
867
raise error_reply (resp )
871
868
if resp [3 :5 ] != ' "' :
0 commit comments