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

Class StageConfig

source code

object --+
         |
        StageConfig

Class representing a Cedar Backup stage configuration.

As with all of the other classes that represent configuration sections, all of these values are optional. It is up to some higher-level construct to decide whether everything they need is filled in. Some validation is done on non-None assignments through the use of the Python property() construct.

The following restrictions exist on data in this class:


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__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

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:
CedarBackup2.config.StageConfig._getTargetDir(self) - Property target used to get the target directory.
Set Method:
CedarBackup2.config.StageConfig._setTargetDir(self, value) - Property target used to set the target directory.

localPeers

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

remotePeers

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