2006-10-18 13:10:07

Utilites for working with Python PEP 302 import hooks.

Copyright 2006 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/

Find a PEP 302 "loader" object for fullname

If fullname contains dots, path must be the containing package's __path__. Returns None if the module cannot be found or imported.

Find a PEP 302 "loader" object for fullname

If fullname contains dots, path must be the containing package's __path__. Returns None if the module cannot be found or imported. This function uses iter_importers(), and is thus subject to the same limitations regarding platform-specific special import locations such as the Windows registry.

Retrieve a PEP 302 importer for the given path item

The returned importer is cached in sys.path_importer_cache if it was newly created by a path hook.

If there is no importer, a wrapper around the basic import machinery is returned. This wrapper is never inserted into the importer cache (None is inserted instead).

The cache (or part of it) can be cleared manually if a rescan of sys.path_hooks is necessary.

Returns the last modified timestamp for the given module.

Returns a true filesystem name for the specified resource.

Return a timestamp indicating the last-modified time of the specified resource. Raises IOError is the pathname cannot be found from the loader for 'fullname'.

Return a readable stream for specified resource

Return a string containing the contents of the specified resource.

If the pathname is absolute it is retrieved starting at the path of the importer for 'fullname'. Otherwise, it is retrieved relative to the module within the loader.

Yields (module_loader, name, ispkg) for all submodules on path, or, if path is None, all top-level modules on sys.path.

'path' should be either None or a list of paths to look for modules in.

'prefix' is a string to output on the front of every module name on output.

['.so', 'module.so', '.py', '.pyc']
['.py', '.pyc', '.pyo']
['FindLoader', 'FindImporter', 'GetImporter', 'IterModules', 'GetLastModified', 'GetSearchPath', 'OsPathToResource', 'NormalizeResource', 'GetResourceFilename', 'GetResourceString', 'GetResourceStream', 'GetResourceLastModified']
True
('.pyc', 'rb', 2)
_Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 0)