Test if path is a net location. Tests the scheme and netloc.
(self, path)
| 301 | return names |
| 302 | |
| 303 | def _isurl(self, path): |
| 304 | """Test if path is a net location. Tests the scheme and netloc.""" |
| 305 | |
| 306 | # We do this here to reduce the 'import numpy' initial import time. |
| 307 | from urllib.parse import urlparse |
| 308 | |
| 309 | # BUG : URLs require a scheme string ('http://') to be used. |
| 310 | # www.google.com will fail. |
| 311 | # Should we prepend the scheme for those that don't have it and |
| 312 | # test that also? Similar to the way we append .gz and test for |
| 313 | # for compressed versions of files. |
| 314 | |
| 315 | scheme, netloc, upath, uparams, uquery, ufrag = urlparse(path) |
| 316 | return bool(scheme and netloc) |
| 317 | |
| 318 | def _cache(self, path): |
| 319 | """Cache the file specified by path. |