Package doapfiend :: Package plugins :: Module base :: Class Plugin
[hide private]
[frames] | no frames]

Class Plugin

source code

object --+
         |
        Plugin
Known Subclasses:

Base class for doapfiend plugins. It's not necessary to subclass this class to create a plugin; however, all plugins must implement `add_options(self, parser)` and `configure(self, options, conf)`, and must have the attributes `enabled` and `name`.

Plugins should not be enabled by default.

Subclassing Plugin will give your plugin some friendly default behavior:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add_options(self, parser)
Add command-line options for this plugin.
source code
 
configure(self, options, conf)
Configure the plugin and system, based on selected options.
source code
 
help(self)
Return help for this plugin.
source code

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

Class Variables [hide private]
  enable_opt = None
  enabled = False
  name = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

add_options(self, parser)

source code 

Add command-line options for this plugin.

The base plugin class adds --with-$name by default, used to enable the plugin.

configure(self, options, conf)

source code 

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enable_opt) is true.

help(self)

source code 

Return help for this plugin. This will be output as the help section of the --with-$name option that enables the plugin.