@@ -72,7 +72,6 @@ class error_proto(Error): pass # response does not begin with [1-5]
7272
7373# The class itself
7474class FTP :
75-
7675'''An FTP client class.
7776
7877 To create a connection, call the class using these arguments:
@@ -105,12 +104,13 @@ class FTP:
105104passiveserver = 1
106105encoding = "latin-1"
107106
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())
112107def __init__ (self ,host = '' ,user = '' ,passwd = '' ,acct = '' ,
113108timeout = _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+ """
114114self .source_address = source_address
115115self .timeout = timeout
116116if host :
@@ -823,7 +823,6 @@ def parse227(resp):
823823'''Parse the '227' response for a PASV request.
824824 Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
825825 Return ('host.addr.as.numbers', port#) tuple.'''
826-
827826if resp [:3 ]!= '227' :
828827raise error_reply (resp )
829828global _227_re
@@ -843,7 +842,6 @@ def parse229(resp, peer):
843842'''Parse the '229' response for an EPSV request.
844843 Raises error_proto if it does not contain '(|||port|)'
845844 Return ('host.addr.as.numbers', port#) tuple.'''
846-
847845if resp [:3 ]!= '229' :
848846raise error_reply (resp )
849847left = resp .find ('(' )
@@ -865,7 +863,6 @@ def parse257(resp):
865863'''Parse the '257' response for a MKD or PWD request.
866864 This is a response to a MKD or PWD request: a directory name.
867865 Returns the directoryname in the 257 reply.'''
868-
869866if resp [:3 ]!= '257' :
870867raise error_reply (resp )
871868if resp [3 :5 ]!= ' "' :