Home | History | Annotate | Download | only in Lib

Lines Matching defs:host

8 >>> ftp = FTP('ftp.python.org') # connect to host, default port
79 host, user, passwd, acct, timeout
87 Then use self.connect() with optional host and port argument.
99 host = ''
109 # Initialize host to localhost, port to standard ftp port
110 # Optional arguments are host (for connect()),
112 def __init__(self, host='', user='', passwd='', acct='',
116 if host:
117 self.connect(host)
135 def connect(self, host='', port=0, timeout=-999, source_address=None):
136 '''Connect to host. Arguments are:
137 - host: hostname to connect to (string, default previous host)
140 - source_address: a 2-tuple (host, port) for the socket to bind
143 if host != '':
144 self.host = host
151 self.sock = socket.create_connection((self.host, self.port), self.timeout,
278 def sendport(self, host, port):
279 '''Send a PORT command with the current host and the given
282 hbytes = host.split('.')
288 def sendeprt(self, host, port):
289 '''Send an EPRT command with the current host and the given port number.'''
297 fields = ['', repr(af), host, repr(port), '']
324 host = self.sock.getsockname()[0] # Get proper host
326 resp = self.sendport(host, port)
328 resp = self.sendeprt(host, port)
335 host, port = parse227(self.sendcmd('PASV'))
337 host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
338 return host, port
357 host, port = self.makepasv()
358 conn = socket.create_connection((host, port), self.timeout,
414 # host or country.
722 def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
743 FTP.__init__(self, host, user, passwd, acct, timeout, source_address)
759 server_hostname=self.host)
799 server_hostname=self.host)
840 Return ('host.addr.as.numbers', port#) tuple.'''
852 host = '.'.join(numbers[:4])
854 return host, port
860 Return ('host.addr.as.numbers', port#) tuple.'''
874 host = peer[0]
876 return host, port
931 Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
953 host = sys.argv[1]
954 ftp = FTP(host)
965 userid, acct, passwd = netrcobj.authenticators(host)
967 # no account for host