ape.plugins.base_plugin.BasePlugin

class ape.plugins.base_plugin.BasePlugin(configuration=None, section_header=None)

An abstract base-class for plugins

Param:
  • configuration: configuration-map for plugin configuration

BasePlugin constructor

Param:
  • configuration: a ConfigObj for the product
  • section_header: header in the configuration for this plugin’s info
__init__(configuration=None, section_header=None)

BasePlugin constructor

Param:
  • configuration: a ConfigObj for the product
  • section_header: header in the configuration for this plugin’s info

Methods

__init__([configuration, section_header]) BasePlugin constructor
fetch_config() Abstract Method: Get sample config-file snippet required by this plugin
help([width]) Prints a help-string for the plugin
log_error(error[, message]) Logs the error in bold red

Attributes

help_page A HelpPage to use if self.sections has been defined
logger
return:A logging object.
product Abstract Property: The plugin (Component implementation)
sections A (ordered) dictionary for the help page
fetch_config()

Abstract Method: Get sample config-file snippet required by this plugin

help(width=80)

Prints a help-string for the plugin

Param:
  • width: number of characters wide to print help
log_error(error, message='')

Logs the error in bold red

Param:
  • error: error type (prefix in red and bold)
  • message: descriptive message (red but not bold)
help_page

A HelpPage to use if self.sections has been defined

logger
Returns:A logging object.
product

Abstract Property: The plugin (Component implementation)

sections

A (ordered) dictionary for the help page

Navigation