Package pysys :: Package utils :: Module loader
[hide private]
[frames] | no frames]

Module loader

source code

Functions [hide private]
 
import_module(name, path, reload=False)
Import a named module, searching within a list of paths.
source code
 
__import_module(fqname, qname, parent, path, reload)
Method to load a module.
source code
Variables [hide private]
  __package__ = 'pysys.utils'
Function Details [hide private]

import_module(name, path, reload=False)

source code 

Import a named module, searching within a list of paths.

Supports loading of hierarchical modules from a list of paths, returning a reference to the loaded module. Reloading of the module can be requested should the module already exist in sys.modules. Note that in a module named X.Y.Z, should reload be set to True only the tail module, X.Y.Z, will be reloaded on import; the intervening modules, X and X.Y, will not be reloaded.

Parameters:
  • name - The module name
  • path - A list of paths to search for the module
  • reload - A boolean indicating if the module should be reloaded if already in sys.modules

__import_module(fqname, qname, parent, path, reload)

source code 

Method to load a module.

Parameters:
  • fqname - The fully qualified name of the module
  • qname - The qualified name relative to the parent module (if one exists)
  • parent - A reference to the loaded parent module
  • path - The path used to search for the module
  • reload - Boolean indicating if the module should be reloaded if already in sys.modules