Home | History | Annotate | Download | only in Lib

Lines Matching defs:host

8 >>> ftp = FTP('ftp.python.org') # connect to host, default port
84 host, user, passwd, acct, timeout
92 Then use self.connect() with optional host and port argument.
104 host = ''
113 # Initialize host to localhost, port to standard ftp port
114 # Optional arguments are host (for connect()),
116 def __init__(self, host='', user='', passwd='', acct='',
119 if host:
120 self.connect(host)
124 def connect(self, host='', port=0, timeout=-999):
125 '''Connect to host. Arguments are:
126 - host: hostname to connect to (string, default previous host)
129 if host != '':
130 self.host = host
135 self.sock = socket.create_connection((self.host, self.port), self.timeout)
256 def sendport(self, host, port):
257 '''Send a PORT command with the current host and the given
260 hbytes = host.split('.')
266 def sendeprt(self, host, port):
267 '''Send an EPRT command with the current host and the given port number.'''
275 fields = ['', repr(af), host, repr(port), '']
301 host = self.sock.getsockname()[0] # Get proper host
303 resp = self.sendport(host, port)
305 resp = self.sendeprt(host, port)
312 host, port = parse227(self.sendcmd('PASV'))
314 host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
315 return host, port
334 host, port = self.makepasv()
335 conn = socket.create_connection((host, port), self.timeout)
390 # host or country.
648 def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
665 FTP.__init__(self, host, user, passwd, acct, timeout)
681 server_hostname=self.host)
713 server_hostname=self.host)
827 Return ('host.addr.as.numbers', port#) tuple.'''
839 host = '.'.join(numbers[:4])
841 return host, port
847 Return ('host.addr.as.numbers', port#) tuple.'''
861 host = peer[0]
863 return host, port
949 host = user = passwd = acct = None
961 host = w2.lower()
982 if host:
983 if host in self.__hosts:
985 self.__hosts[host]
989 self.__hosts[host] = user, passwd, acct
996 def get_account(self, host):
997 """Returns login information for the named host.
1003 host = host.lower()
1005 if host in self.__hosts:
1006 user, passwd, acct = self.__hosts[host]
1024 Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
1044 host = sys.argv[1]
1045 ftp = FTP(host)
1056 userid, passwd, acct = netrc.get_account(host)
1058 # no account for host