CedarBackup3.config.ExtendedAction

Package CedarBackup3 :: Module config :: Class ExtendedAction |
[hide private]
[frames] | no frames]

# Class ExtendedAction

source code

    object --+
             |
            ExtendedAction

Class representing an extended action.

Essentially, an extended action needs to allow the following to happen:

      exec("from %s import %s" % (module, function))
      exec("%s(action, configPath")" % function)

The following restrictions exist on data in this class:

- The action name must be a non-empty string consisting of lower-case letters and digits.
- The module must be a non-empty string and a valid Python identifier.
- The function must be an on-empty string and a valid Python identifier.
- If set, the index must be a positive integer.
- If set, the dependencies attribute must be an `ActionDependencies` object.

Instance Methods | [hide private]
__init__(self, name=None, module=None, function=None, index=None, dependencies=None) Constructor for the `ExtendedAction` class. | source code
__repr__(self) Official string representation for class instance. | source code
__str__(self) Informal string representation for class instance. | source code
__cmp__(self, other) Original Python 2 comparison operator. | source code
__eq__(self, other) Equals operator, implemented in terms of original Python 2 compare operator. | source code
__lt__(self, other) Less-than operator, implemented in terms of original Python 2 compare operator. | source code
__gt__(self, other) Greater-than operator, implemented in terms of original Python 2 compare operator. | source code
_setName(self, value) Property target used to set the action name. | source code
_getName(self) Property target used to get the action name. | source code
_setModule(self, value) Property target used to set the module name. | source code
_getModule(self) Property target used to get the module name. | source code
_setFunction(self, value) Property target used to set the function name. | source code
_getFunction(self) Property target used to get the function name. | source code
_setIndex(self, value) Property target used to set the action index. | source code
_getIndex(self) Property target used to get the action index. | source code
_setDependencies(self, value) Property target used to set the action dependencies information. | source code
_getDependencies(self) Property target used to get action dependencies information. | source code
__ge__(x, y) x>=y |
__le__(x, y) x<=y |
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
| name Name of the extended action.
| module Name of the module containing the extended action function.
| function Name of the extended action function.
| index Index of action, used for execution ordering.
| dependencies Dependencies for action, used for execution ordering.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, name=None, module=None, function=None, index=None, dependencies=None) (Constructor) | source code
Constructor for the `ExtendedAction` class. Parameters: `name` - Name of the extended action `module` - Name of the module containing the extended action function `function` - Name of the extended action function `index` - Index of action, used for execution ordering `dependencies` - Dependencies for action, used for execution ordering Raises: `ValueError` - If one of the values is invalid. Overrides: object.__init__

### __repr__(self) (Representation operator) | source code
Official string representation for class instance. Overrides: object.__repr__

### __str__(self) (Informal representation operator) | source code
Informal string representation for class instance. Overrides: object.__str__

### __cmp__(self, other) (Comparison operator) | source code
Original Python 2 comparison operator. Parameters: `other` - Other object to compare to. Returns: -1/0/1 depending on whether self is `<`, `=` or `>` other.

### _setName(self, value) | source code
Property target used to set the action name. The value must be a non-empty string if it is not `None`. It must also consist only of lower-case letters and digits. Raises: `ValueError` - If the value is an empty string.

### _setModule(self, value) | source code
Property target used to set the module name. The value must be a non-empty string if it is not `None`. It must also be a valid Python identifier. Raises: `ValueError` - If the value is an empty string.

### _setFunction(self, value) | source code
Property target used to set the function name. The value must be a non-empty string if it is not `None`. It must also be a valid Python identifier. Raises: `ValueError` - If the value is an empty string.

### _setIndex(self, value) | source code
Property target used to set the action index. The value must be an integer >= 0. Raises: `ValueError` - If the value is not valid.

### _setDependencies(self, value) | source code
Property target used to set the action dependencies information. If not `None`, the value must be a `ActionDependecies` object. Raises: `ValueError` - If the value is not a `ActionDependencies` object.

Property Details | [hide private]

### name Name of the extended action. Get Method: _getName(self) - Property target used to get the action name. Set Method: _setName(self, value) - Property target used to set the action name.

### module Name of the module containing the extended action function. Get Method: _getModule(self) - Property target used to get the module name. Set Method: _setModule(self, value) - Property target used to set the module name.

### function Name of the extended action function. Get Method: _getFunction(self) - Property target used to get the function name. Set Method: _setFunction(self, value) - Property target used to set the function name.

### index Index of action, used for execution ordering. Get Method: _getIndex(self) - Property target used to get the action index. Set Method: _setIndex(self, value) - Property target used to set the action index.

### dependencies Dependencies for action, used for execution ordering. Get Method: _getDependencies(self) - Property target used to get action dependencies information. Set Method: _setDependencies(self, value) - Property target used to set the action dependencies information.