PyOpenWorm.configure module¶
-
exception
PyOpenWorm.configure.
BadConf
[source]¶ Bases:
Exception
Special exception subclass for alerting the user to a bad configuration
-
class
PyOpenWorm.configure.
ConfigValue
[source]¶ Bases:
object
A value to be configured. Base class intended to be subclassed, as its only method is not implemented
-
class
PyOpenWorm.configure.
Configure
(**initial_values)[source]¶ Bases:
object
A simple configuration object. Enables setting and getting key-value pairs
Unlike a dict, Configure objects will execute a function when retrieving values to enable deferred computation of seldom-used configuration values. In addition, entries in a Configure can be aliased to one another.
-
copy
(self, other)[source]¶ Copy this configuration into a different object.
Parameters: other – A different configuration object to copy the configuration from this object into Returns:
-
get
(self, pname, default=NO_DEFAULT)[source]¶ Get some parameter value out by asking for a key. Note that unlike
dict
, if you don’t specify a default, then aKeyError
is raisedParameters: - pname : str
they key of the value you want to return.
- default : object
The default value to return if there’s no entry for pname
Returns: - The value corresponding to the key
-
-
class
PyOpenWorm.configure.
Configureable
(conf=None, **kwargs)[source]¶ Bases:
object
An object which can accept configuration. A base class intended to be subclassed.
-
get
(self, pname, default=None)[source]¶ Gets a config value from this
Configureable
’s confSee also
-