Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module config :: Class Config |
|
object
--+
|
Config
Class representing a Cedar Backup XML configuration document.
The Config
class is a Python object representation of a
Cedar Backup XML configuration file. It is intended to be the only
Python-language interface to Cedar Backup configuration on disk for both
Cedar Backup itself and for external applications.
The object representation is two-way: XML data can be used to create a
Config
object, and then changes to the object can be
propogated back to disk. A Config
object can even be used to
create a configuration file from scratch programmatically.
This class and the classes it is composed from often use Python's
property
construct to validate input and limit access to
values. Some validations can only be done once a document is considered
"complete" (see module notes for more details).
Assignments to the various instance variables must match the expected
type, i.e. reference
must be a ReferenceConfig
.
The internal check uses the built-in isinstance
function, so
it should be OK to use subclasses if you want to.
None
. When an object is initialized without using an XML
document, all of the values will be None
. Even when an
object is initialized using XML, some of the values might be
None
because not every section is required.
Note: Lists within this class are "unordered" for equality comparisons.
Method Summary | |
---|---|
Initializes a configuration object. | |
Official string representation for class instance. | |
Informal string representation for class instance. | |
Definition of equals operator for this class. | |
Extracts configuration into an XML document. | |
Validates configuration represented by the object. | |
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.__setattr__('name', value) <==> x.name = value |
Property Summary | |
---|---|
reference : Reference configuration in terms of a ReferenceConfig
object. | |
extensions : Extensions configuration in terms of a ExtensionsConfig
object. | |
options : Options configuration in terms of a OptionsConfig
object. | |
collect : Collect configuration in terms of a CollectConfig
object. | |
stage : Stage configuration in terms of a StageConfig object. | |
store : Store configuration in terms of a StoreConfig object. | |
purge : Purge configuration in terms of a PurgeConfig object. |
Instance Method Details |
---|
__init__(self,
xmlData=None,
xmlPath=None,
validate=True)
|
__repr__(self)
Official string representation for class instance.
|
__str__(self)
Informal string representation for class instance.
|
__cmp__(self,
other)
Definition of equals operator for this class. Lists within this
class are "unordered" for equality comparisons.
|
extractXml(self, xmlPath=None, validate=True)Extracts configuration into an XML document. If validate parameter is False ,
the Config.validate method will be called
(with its default arguments) against the configuration before
extracting the XML. If configuration is not valid, then an XML document
will not be extracted.
|
validate(self, requireOneAction=True, requireReference=False, requireExtensions=False, requireOptions=True, requireCollect=False, requireStage=False, requireStore=False, requirePurge=False)Validates configuration represented by the object. This method encapsulates all of the validations that should apply to a fully "complete" document but are not already taken care of by earlier validations. It also provides some extra convenience functionality which might be useful to some people. The process of validation is laid out in the Validation section in the class notes (above).
|
Property Details |
---|
referenceReference configuration in terms of aReferenceConfig
object.
|
extensionsExtensions configuration in terms of aExtensionsConfig
object.
|
optionsOptions configuration in terms of aOptionsConfig
object.
|
collectCollect configuration in terms of aCollectConfig
object.
|
stageStage configuration in terms of aStageConfig object.
|
storeStore configuration in terms of aStoreConfig object.
|
purgePurge configuration in terms of aPurgeConfig object.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 18 22:53:29 2006 | http://epydoc.sf.net |