CedarBackup2.config.StageConfig

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

# Class StageConfig

source code

    object --+
             |
            StageConfig

Class representing a Cedar Backup stage configuration.

The following restrictions exist on data in this class:

- The target directory must be an absolute path
- The list of local peers must contain only `LocalPeer` objects
- The list of remote peers must contain only `RemotePeer` objects

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

Instance Methods | [hide private]
__init__(self, targetDir=None, localPeers=None, remotePeers=None) Constructor for the `StageConfig` 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
hasPeers(self) Indicates whether any peers are filled into this object. | 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
_setLocalPeers(self, value) Property target used to set the local peers list. | source code
_getLocalPeers(self) Property target used to get the local peers list. | source code
_setRemotePeers(self, value) Property target used to set the remote peers list. | source code
_getRemotePeers(self) Property target used to get the remote peers list. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
| targetDir Directory to stage files into, by peer name.
| localPeers List of local peers.
| remotePeers List of remote peers.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, targetDir=None, localPeers=None, remotePeers=None) (Constructor) | source code
Constructor for the `StageConfig` class. Parameters: `targetDir` - Directory to stage files into, by peer name. `localPeers` - List of local peers. `remotePeers` - List of remote peers. 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.

### hasPeers(self) | source code
Indicates whether any peers are filled into this object. Returns: Boolean true if any local or remote peers are filled in, false otherwise.

### _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.

### _setLocalPeers(self, value) | source code
Property target used to set the local peers list. Either the value must be `None` or each element must be a `LocalPeer`. Raises: `ValueError` - If the value is not an absolute path.

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

Property Details | [hide private]

### targetDir Directory to stage files into, by peer name. 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.

### localPeers List of local peers. Get Method: _getLocalPeers(self) - Property target used to get the local peers list. Set Method: _setLocalPeers(self, value) - Property target used to set the local peers list.

### remotePeers List of remote peers. Get Method: _getRemotePeers(self) - Property target used to get the remote peers list. Set Method: _setRemotePeers(self, value) - Property target used to set the remote peers list.