OpenGLContext.loaders.loader
Load-manager for downloading multi-value URLs
The Singleton "Loader" should be used for most interactions.
Classes
(Singleton) Manager for downloading resources
Is a generic class which provides download services
which follow VRML97 semantics (multiple-URL definitions,
with chaining to the first successful URL).
The loader will attempt to use a local cache of files
to prevent multiple downloading.
__call__(
self
,
url
,
baseURL
= None
)
Load the given multi-value url and call callbacks
- url
- vrml97-style url (multi-value string)
- baseURL
- optional base url from which items in url will be resolved. protofunctions.root(node).baseURI will give you the baseURL normally used for the given node.
raises IOError on failure
returns (successfulURL, filename, open_file, headers) on success
headers will be None for local files
findHandler(
self
,
url
)
Find registered handler for the url's apparent suffix
TODO: allow for content-type operations after downloading the URL
get(
self
,
url
)
Retrieve the given single-value URL
- url
- single-value URL, which may be a local filename or any URL type supported by urllib
returns (baseURL, file, filename, headers)