Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module cli :: Class _ActionSet |
|
object
--+
|
_ActionSet
Class representing a set of actions to be executed.
This class does three different things. First, it ensures that the
actions specified on the command-line are sensible. The command-line can
only list either built-in actions or extended actions specified in
configuration. Also, certain actions (in NONCOMBINE_ACTIONS
) cannot be combined with
other actions.
Second, the class enforces an execution order on the specified actions. Any time actions are combined on the command line (either built-in actions or extended actions), we must make sure they get executed in a sensible order.
Third, the class ensures that any pre-action or post-action hooks are scheduled and executed appropriately. Hooks are configured by building a dictionary mapping between hook action name and command. Pre-action hooks are executed immediately before their associated action, and post-action hooks are executed immediately after their associated action.Method Summary | |
---|---|
Constructor for the _ActionSet class. | |
Executes all actions and extended actions, in the proper order. | |
Builds a mapping from action name to list of _ActionItem
objects. (Static method)
| |
Build set of actions to be executed. (Static method) | |
Builds a mapping from named action to action function. (Static method) | |
Build two mappings from action name to configured ActionHook . (Static method)
| |
Builds a mapping from action name to proper execution index. (Static method) | |
Builds a list of extended actions that are available in configuration. (Static method) | |
Derive pre- and post-action hooks, if any, associated with named action. (Static method) | |
Validate that the set of specified actions is sensible. (Static method) | |
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) |
Instance Method Details |
---|
__init__(self,
actions,
extensions,
hooks)
|
executeActions(self, configPath, options, config)Executes all actions and extended actions, in the proper order. Each action (whether built-in or extension) is executed in an identical manner. The built-in actions will use only the options and config values. We also pass in the config path so that extension modules can re-parse configuration if they want to, to add in extra information.
|
Static Method Details |
---|
_buildActionMap(extensionNames, functionMap, indexMap, preHookMap, postHookMap)Builds a mapping from action name to list of
In most cases, the mapping from action name to
_ActionItem will be created with a proper function
reference and index value for execution ordering.
|
_buildActionSet(actions, actionMap)Build set of actions to be executed. The set of actions is built in the proper order, soexecuteActions can spin through the set without thinking
about it. Since we've already validated that the set of actions is
sensible, we don't take any precautions here to make sure things are
combined properly. If the action is listed, it will be
"scheduled" for execution.
|
_buildFunctionMap(extensions)Builds a mapping from named action to action function.
|
_buildHookMaps(hooks)Build two mappings from action name to configuredActionHook .
|
_buildIndexMap(extensions)Builds a mapping from action name to proper execution index. If extensions configuration is None or
"index" , actions will scheduled by explicit
index; and if the extensions order mode is
"dependency" , actions will be scheduled using a
dependency graph.
|
_deriveExtensionNames(extensions)Builds a list of extended actions that are available in configuration.
|
_deriveHooks(action, preHookDict, postHookDict)Derive pre- and post-action hooks, if any, associated with named action.
|
_validateActions(actions, extensionNames)Validate that the set of specified actions is sensible. Any specified action must either be a built-in action or must be among the extended actions defined in configuration. The actions from withinNONCOMBINE_ACTIONS may not be combined
with other actions.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Mar 29 20:58:26 2007 | http://epydoc.sf.net |