| |
- _Verbose
-
- BasicModuleImporter
-
- ModuleImporter
- BasicModuleLoader
-
- ModuleLoader
-
- FancyModuleLoader
- Hooks
class BasicModuleImporter(_Verbose) |
|
Basic module importer; uses module loader.
This provides basic import facilities but no package imports.
|
| |
- __init__(self, loader=None, verbose=0)
- no doc string
- get_hooks(self)
- no doc string
- get_loader(self)
- no doc string
- import_module(self, name, globals={}, locals={}, fromlist=[])
- no doc string
- install(self)
- no doc string
- reload(self, module, path=None)
- no doc string
- set_hooks(self, hooks)
- no doc string
- set_loader(self, loader)
- no doc string
- uninstall(self)
- no doc string
- unload(self, module)
- no doc string
|
class BasicModuleLoader(_Verbose) |
|
Basic module loader.
This provides the same functionality as built-in import. It
doesn't deal with checking sys.modules -- all it provides is
find_module() and a load_module(), as well as find_module_in_dir()
which searches just one directory, and can be overridden by a
derived class to change the module search algorithm when the basic
dependency on sys.path is unchanged.
The interface is a little more convenient than imp's:
find_module(name, [path]) returns None or 'stuff', and
load_module(name, stuff) loads the module.
|
| |
- default_path(self)
- no doc string
- find_builtin_module(self, name)
- no doc string
- find_module(self, name, path=None)
- no doc string
- find_module_in_dir(self, name, dir)
- no doc string
- load_module(self, name, stuff)
- no doc string
|
class Hooks(_Verbose) |
|
Hooks into the filesystem and interpreter.
By deriving a subclass you can redefine your filesystem interface,
e.g. to merge it with the URL space.
This base class behaves just like the native filesystem.
|
| |
- add_module(self, name)
- no doc string
- default_path(self)
- # sys interface
- get_frozen_object(self, name)
- # imp interface
- get_suffixes(self)
- # imp interface
- init_builtin(self, name)
- # imp interface
- init_frozen(self, name)
- # imp interface
- is_builtin(self, name)
- # imp interface
- is_frozen(self, name)
- # imp interface
- listdir(self, x)
- no doc string
- load_compiled(self, name, filename, file=None)
- no doc string
- load_dynamic(self, name, filename, file=None)
- no doc string
- load_package(self, name, filename, file=None)
- no doc string
- load_source(self, name, filename, file=None)
- # imp interface
- modules_dict(self)
- # sys interface
- new_module(self, name)
- # imp interface
- openfile(self, *x)
- # etc.
- path_exists(self, x)
- no doc string
- path_isabs(self, x)
- no doc string
- path_isdir(self, x)
- no doc string
- path_isfile(self, x)
- no doc string
- path_islink(self, x)
- no doc string
- path_join(self, x, y)
- no doc string
- path_split(self, x)
- no doc string
|
class ModuleImporter(BasicModuleImporter) |
|
A module importer that supports packages.
|
| |
- determine_parent(self, globals)
- no doc string
- ensure_fromlist(self, m, fromlist, recursive=0)
- no doc string
- find_head_package(self, parent, name)
- no doc string
- import_it(self, partname, fqname, parent)
- no doc string
- import_module(self, name, globals=None, locals=None, fromlist=None)
- no doc string
- load_tail(self, q, tail)
- no doc string
- reload(self, module)
- no doc string
|
class ModuleLoader(BasicModuleLoader) |
|
Default module loader; uses file system hooks.
By defining suitable hooks, you might be able to load modules from
other sources than the file system, e.g. from compressed or
encrypted files, tar files or (if you're brave!) URLs.
|
| |
- __init__(self, hooks=None, verbose=0)
- no doc string
- default_path(self)
- no doc string
- find_builtin_module(self, name)
- no doc string
- find_module_in_dir(self, name, dir, allow_packages=1)
- no doc string
- get_hooks(self)
- no doc string
- load_module(self, name, stuff)
- no doc string
- modules_dict(self)
- no doc string
- set_hooks(self, hooks)
- no doc string
|
|