API documentation¶
confmodel
module¶
The top-level namespace contains some convenience imports.
Members¶
-
__version__
¶ Version number.
-
class
Config
(config_data, static=False)[source]¶ Config object.
Configuration options:
-
post_validate
()[source]¶ Subclasses may override this to provide cross-field validation.
Implementations should raise
ConfigError
if the configuration is invalid (by callingraise_config_error()
, for example).
-
raise_config_error
(message)[source]¶ Raise a
ConfigError
with the given message.
-
confmodel.errors
module¶
Exception classes used in confmodel.
confmodel.interfaces
module¶
Interfaces used in confmodel.
Members¶
-
interface
IConfigData
[source]¶ Interface for a config data provider.
This provides read-only access to some configuration data provider. The simplest implementation is a vanilla
dict
.-
__contains__
(field_name)¶ Check for the existence of a config field.
This is identical to
has_key()
but is often more convenient to use.Parameters: field_name (str) – The name of the field to look up. Returns: True
if a value exists for the givenfield_name
,False
otherwise.
-
has_key
(field_name)¶ Check for the existence of a config field.
Parameters: field_name (str) – The name of the field to look up. Returns: True
if a value exists for the givenfield_name
,False
otherwise.
-
get
(field_name, default)¶ Get the value of a config field.
Parameters: - field_name (str) – The name of the field to look up.
- default – The value to return if the requested field is not found.
Returns: The value for the given
field_name
, ordefault
if the field has not been specified.
-