plugin Package

plugin Module

loader Module

exception pynsive.plugin.loader.LoaderError(msg)[source]

Bases: exceptions.ImportError

This error is thrown when the module loader encounters an exception or an unrecoverable state while attempting to load a dynamically located module.

class pynsive.plugin.loader.ModuleFinder(paths=None)[source]

Bases: object

As per PEP302, this module loader provides all of the necessary context for dynamically locating python modules based. This finder searches directories based on paths added to its internal list of available search directories.

add_path(path)[source]

Adds a path to search through when attempting to look up a module.

Parameters:path – the path the add to the list of searchable paths
find_module(module_name, path=None)[source]

Searches the paths for the required module.

Parameters:
  • module_name – the full name of the module to find
  • path – set to None when the module in being searched for is a top-level module - otherwise this is set to package.__path__ for submodules and subpackages (unused)
class pynsive.plugin.loader.ModuleLoader(module_path, module_name, load_target, is_pkg)[source]

Bases: object

As per PEP302, this module loader provides all of the necessary context for loading a python file and executing its contents.

load_module(module_name)[source]

Loads a module’s code and sets the module’s expected hidden variables. For more information on these variables and what they are for, please see PEP302.

Parameters:module_name – the full name of the module to load

manager Module

class pynsive.plugin.manager.PluginManager[source]

Bases: object

The PluginManager class is a nice wrapper for tapping into sys.meta_path with pynsive. It also provides a hook for removing itself from sys.meta_path.

destroy()[source]

Removes the meta_path hook associated with this manager.

plug_into(*paths)[source]

Adds all arguments passed as plugin directories to search when loading modules.

Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.