Lines Matching defs:host

8 >>> ftp = FTP('ftp.python.org') # connect to host, default port
78 host, user, passwd, acct, timeout, source_address, encoding
87 Then use self.connect() with optional host and port argument.
99 host = ''
109 def __init__(self, host='', user='', passwd='', acct='',
113 Initialize host to localhost, port to standard ftp port.
114 Optional arguments are host (for connect()),
120 if host:
121 self.connect(host)
139 def connect(self, host='', port=0, timeout=-999, source_address=None):
140 '''Connect to host. Arguments are:
141 - host: hostname to connect to (string, default previous host)
144 - source_address: a 2-tuple (host, port) for the socket to bind
147 if host != '':
148 self.host = host
157 sys.audit("ftplib.connect", self, self.host, self.port)
158 self.sock = socket.create_connection((self.host, self.port), self.timeout,
288 def sendport(self, host, port):
289 '''Send a PORT command with the current host and the given
292 hbytes = host.split('.')
298 def sendeprt(self, host, port):
299 '''Send an EPRT command with the current host and the given port number.'''
307 fields = ['', repr(af), host, repr(port), '']
315 host = self.sock.getsockname()[0] # Get proper host
317 resp = self.sendport(host, port)
319 resp = self.sendeprt(host, port)
329 host = untrusted_host
331 host = self.sock.getpeername()[0]
333 host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
334 return host, port
353 host, port = self.makepasv()
354 conn = socket.create_connection((host, port), self.timeout,
410 # host or country.
718 def __init__(self, host='', user='', passwd='', acct='',
740 super().__init__(host, user, passwd, acct,
756 self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
796 server_hostname=self.host)
837 Return ('host.addr.as.numbers', port#) tuple.'''
848 host = '.'.join(numbers[:4])
850 return host, port
856 Return ('host.addr.as.numbers', port#) tuple.'''
869 host = peer[0]
871 return host, port
925 Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
947 host = sys.argv[1]
948 ftp = FTP(host)
959 userid, acct, passwd = netrcobj.authenticators(host)
961 # no account for host