Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module cli :: Class _ActionItem |
|
object
--+
|
_ActionItem
Class representing a single action to be executed.
This class represents a single named action to be executed, and understands how to execute that action.
Standard actions ("built-in" actions like collect, stage,
etc.) are instantiated in terms of a direct function reference, i.e. to
executeCollect
. Extended actions are instantiated in terms
of an ExtendedAction
object taken from configuration.
The two different actions are executed differently. In the case of
standard actions, the function reference is called directly. In the case
of extended actions, a function reference is first derived (using getFunctionReference
) and then called.
The standard actions will generally use the options and config values. We also pass in the config path so that extensions modules can re-parse configuration if they want to, to add in extra information.
This class is also where pre-action and post-action hooks are executed. An action item is instantiated in terms of optional pre- and post-action hook objects (config.ActionHook), which are then executed at the appropriate time if set.Note: The comparison operators for this class have been implemented to only compare based on the index value, and ignore all other values. This is so that the action set list can be easily sorted by index.
Method Summary | |
---|---|
Default constructor. | |
Definition of equals operator for this class. | |
Executes the action, specifically the function associated with the action. | |
Executes a hook command via util.executeCommand() . | |
Executes the action associated with an item, including hooks. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Method Details |
---|
__init__(self,
index,
name,
preHook,
postHook,
function=None,
extension=None)
|
__cmp__(self,
other)
Definition of equals operator for this class. The only thing we
compare is the item's index.
|
_executeAction(self, configPath, options, config)Executes the action, specifically the function associated with the action.
|
_executeHook(self, type, hook)Executes a hook command viautil.executeCommand() .
|
executeAction(self, configPath, options, config)Executes the action associated with an item, including hooks. See class notes for more details on how the action is executed.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Sep 4 13:49:32 2006 | http://epydoc.sf.net |