MCPcopy Index your code
hub / github.com/RustPython/RustPython / connect_ftp

Method connect_ftp

Lib/urllib/request.py:1583–1593  ·  view source on GitHub ↗
(self, user, passwd, host, port, dirs, timeout)

Source from the content-addressed store, hash-verified

1581 self.max_conns = m
1582
1583 def connect_ftp(self, user, passwd, host, port, dirs, timeout):
1584 key = user, host, port, '/'.join(dirs), timeout
1585 conn = self.cache.get(key)
1586 if conn is None or not conn.keepalive:
1587 if conn is not None:
1588 conn.close()
1589 conn = self.cache[key] = ftpwrapper(user, passwd, host, port,
1590 dirs, timeout)
1591 self.timeout[key] = time.time() + self.delay
1592 self.check_cache()
1593 return conn
1594
1595 def check_cache(self):
1596 # first check for old ones

Callers

nothing calls this directly

Calls 6

check_cacheMethod · 0.95
ftpwrapperClass · 0.85
joinMethod · 0.45
getMethod · 0.45
closeMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected