CedarBackup2.config.CollectConfig

Package CedarBackup2 :: Module config :: Class CollectConfig |
[hide private]
[frames] | no frames]

# Class CollectConfig

source code

    object --+
             |
            CollectConfig

Class representing a Cedar Backup collect configuration.

The following restrictions exist on data in this class:

- The target directory must be an absolute path.
- The collect mode must be one of the values in VALID_COLLECT_MODES.
- The archive mode must be one of the values in VALID_ARCHIVE_MODES.
- The ignore file must be a non-empty string.
- Each of the paths in `absoluteExcludePaths` must be an absolute path
- The collect file list must be a list of `CollectFile` objects.
- The collect directory list must be a list of `CollectDir` objects.

For the `absoluteExcludePaths` list, validation is accomplished through the util.AbsolutePathList list implementation that overrides common list methods and transparently does the absolute path validation for us.

For the `collectFiles` and `collectDirs` list, validation is accomplished through the util.ObjectTypeList list implementation that overrides common list methods and transparently ensures that each element has an appropriate type.

Note: Lists within this class are "unordered" for equality comparisons.

Instance Methods | [hide private]
__init__(self, targetDir=None, collectMode=None, archiveMode=None, ignoreFile=None, absoluteExcludePaths=None, excludePatterns=None, collectFiles=None, collectDirs=None) Constructor for the `CollectConfig` 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) Definition of equals operator for this class. | source code
_setTargetDir(self, value) Property target used to set the target directory. | source code
_getTargetDir(self) Property target used to get the target directory. | source code
_setCollectMode(self, value) Property target used to set the collect mode. | source code
_getCollectMode(self) Property target used to get the collect mode. | source code
_setArchiveMode(self, value) Property target used to set the archive mode. | source code
_getArchiveMode(self) Property target used to get the archive mode. | source code
_setIgnoreFile(self, value) Property target used to set the ignore file. | source code
_getIgnoreFile(self) Property target used to get the ignore file. | source code
_setAbsoluteExcludePaths(self, value) Property target used to set the absolute exclude paths list. | source code
_getAbsoluteExcludePaths(self) Property target used to get the absolute exclude paths list. | source code
_setExcludePatterns(self, value) Property target used to set the exclude patterns list. | source code
_getExcludePatterns(self) Property target used to get the exclude patterns list. | source code
_setCollectFiles(self, value) Property target used to set the collect files list. | source code
_getCollectFiles(self) Property target used to get the collect files list. | source code
_setCollectDirs(self, value) Property target used to set the collect dirs list. | source code
_getCollectDirs(self) Property target used to get the collect dirs list. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
| targetDir Directory to collect files into.
| collectMode Default collect mode.
| archiveMode Default archive mode for collect files.
| ignoreFile Default ignore file name.
| absoluteExcludePaths List of absolute paths to exclude.
| excludePatterns List of regular expressions patterns to exclude.
| collectFiles List of collect files.
| collectDirs List of collect directories.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, targetDir=None, collectMode=None, archiveMode=None, ignoreFile=None, absoluteExcludePaths=None, excludePatterns=None, collectFiles=None, collectDirs=None) (Constructor) | source code
Constructor for the `CollectConfig` class. Parameters: `targetDir` - Directory to collect files into. `collectMode` - Default collect mode. `archiveMode` - Default archive mode for collect files. `ignoreFile` - Default ignore file name. `absoluteExcludePaths` - List of absolute paths to exclude. `excludePatterns` - List of regular expression patterns to exclude. `collectFiles` - List of collect files. `collectDirs` - List of collect directories. 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
Definition of equals operator for this class. Lists within this class are "unordered" for equality comparisons. Parameters: `other` - Other object to compare to. Returns: -1/0/1 depending on whether self is `<`, `=` or `>` other.

### _setTargetDir(self, value) | source code
Property target used to set the target directory. The value must be an absolute path if it is not `None`. It does not have to exist on disk at the time of assignment. Raises: `ValueError` - If the value is not an absolute path. `ValueError` - If the value cannot be encoded properly.

### _setCollectMode(self, value) | source code
Property target used to set the collect mode. If not `None`, the mode must be one of VALID_COLLECT_MODES. Raises: `ValueError` - If the value is not valid.

### _setArchiveMode(self, value) | source code
Property target used to set the archive mode. If not `None`, the mode must be one of VALID_ARCHIVE_MODES. Raises: `ValueError` - If the value is not valid.

### _setIgnoreFile(self, value) | source code
Property target used to set the ignore file. The value must be a non-empty string if it is not `None`. Raises: `ValueError` - If the value is an empty string. `ValueError` - If the value cannot be encoded properly.

### _setAbsoluteExcludePaths(self, value) | source code
Property target used to set the absolute exclude paths list. Either the value must be `None` or each element must be an absolute path. Elements do not have to exist on disk at the time of assignment. Raises: `ValueError` - If the value is not an absolute path.

### _setCollectFiles(self, value) | source code
Property target used to set the collect files list. Either the value must be `None` or each element must be a `CollectFile`. Raises: `ValueError` - If the value is not a `CollectFile`

### _setCollectDirs(self, value) | source code
Property target used to set the collect dirs list. Either the value must be `None` or each element must be a `CollectDir`. Raises: `ValueError` - If the value is not a `CollectDir`

Property Details | [hide private]

### targetDir Directory to collect files into. Get Method: _getTargetDir(self) - Property target used to get the target directory. Set Method: _setTargetDir(self, value) - Property target used to set the target directory.

### collectMode Default collect mode. Get Method: _getCollectMode(self) - Property target used to get the collect mode. Set Method: _setCollectMode(self, value) - Property target used to set the collect mode.

### archiveMode Default archive mode for collect files. Get Method: _getArchiveMode(self) - Property target used to get the archive mode. Set Method: _setArchiveMode(self, value) - Property target used to set the archive mode.

### ignoreFile Default ignore file name. Get Method: _getIgnoreFile(self) - Property target used to get the ignore file. Set Method: _setIgnoreFile(self, value) - Property target used to set the ignore file.

### absoluteExcludePaths List of absolute paths to exclude. Get Method: _getAbsoluteExcludePaths(self) - Property target used to get the absolute exclude paths list. Set Method: _setAbsoluteExcludePaths(self, value) - Property target used to set the absolute exclude paths list.

### excludePatterns List of regular expressions patterns to exclude. Get Method: _getExcludePatterns(self) - Property target used to get the exclude patterns list. Set Method: _setExcludePatterns(self, value) - Property target used to set the exclude patterns list.

### collectFiles List of collect files. Get Method: _getCollectFiles(self) - Property target used to get the collect files list. Set Method: _setCollectFiles(self, value) - Property target used to set the collect files list.

### collectDirs List of collect directories. Get Method: _getCollectDirs(self) - Property target used to get the collect dirs list. Set Method: _setCollectDirs(self, value) - Property target used to set the collect dirs list.