Package sabayon :: Module userprofile :: Class ModuleLoader
[hide private]
[frames] | no frames]

Class ModuleLoader

source code

Loads all python modules from a directory allows objects to be constructed from said modules using specific constructors for each object type.

Instance Methods [hide private]
  __init__(self, module_path)
Construct a ModuleLoader and will load all available python modules from @module_path.
  __load_module(self, module)
Load a python module named @module.
  __load_modules(self)
Load all available modules from self.module_path.
  __construct_object(self, module, constructor, arg)
Construct an object by invoking a function named @constructor, with @arg as an argument, in the module called @module.
  construct_objects(self, constructor, arg)
Construct and return a list of objects by invoking a function named @constructor, with @arg as an argument, in each of the python modules in self.module_path which contain a function by that name.

Method Details [hide private]

__init__(self, module_path)
(Constructor)

source code 
Construct a ModuleLoader and will load all available python modules from @module_path.

__load_module(self, module)

source code 
Load a python module named @module.

__load_modules(self)

source code 
Load all available modules from self.module_path.

__construct_object(self, module, constructor, arg)

source code 
Construct an object by invoking a function named @constructor, with @arg as an argument, in the module called @module.

construct_objects(self, constructor, arg)

source code 
Construct and return a list of objects by invoking a function named @constructor, with @arg as an argument, in each of the python modules in self.module_path which contain a function by that name.