Package soovee_lib :: Module plugin :: Class Loader
[frames] | no frames]

Class Loader

object --+
         |
        Loader
Known Subclasses:

Provides a simple plugin extension import object.

Instance Methods
list
__init__(self, modprefix, directory, filesuffix)
Create a list of modules in the directory passed with the filesuffix passed.
object
get(self, method)
Get the module that matches the methodvalue passed.
list
list(self)
List available modules.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, modprefix, directory, filesuffix)
(Constructor)

 

Create a list of modules in the directory passed with the filesuffix passed. modprefix passed is string format that builds the final import path with the files discovered. Ingnores files prepended with '_'.

Parameters:
  • modprefix (basestring) - Prefix import of methods to load.
  • directory (basestring) - File list of which directory.
  • filesuffix (basestring) - Suffix for files that to load methods.
Returns: list
List of available methods.
Overrides: object.__init__

Requires: os

get(self, method)

 

Get the module that matches the methodvalue passed.

Parameters:
  • method (basestring) - method value presented with loadMod.List().
Returns: object
matching format module object
Raises:
  • ImportError - If methodvalue not found.

list(self)

 

List available modules. Provides a list of commands to pass to Get() to load a specific module.

Returns: list
modules listing