summaryrefslogtreecommitdiffstats
path: root/ipalib/config.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-05 03:28:27 -0700
committerJason Gerard DeRose <jderose@redhat.com>2009-01-05 03:28:27 -0700
commit4a24b49d5d1df0558242c4a8e7e3f9333fc007db (patch)
tree6ae6413c98babfc517168b78af5ad33f1f058365 /ipalib/config.py
parent690ad4766d9265026d46fcc50118f341776f81b0 (diff)
downloadfreeipa-4a24b49d5d1df0558242c4a8e7e3f9333fc007db.tar.gz
freeipa-4a24b49d5d1df0558242c4a8e7e3f9333fc007db.tar.xz
freeipa-4a24b49d5d1df0558242c4a8e7e3f9333fc007db.zip
A few docstring improvements in Env
Diffstat (limited to 'ipalib/config.py')
-rw-r--r--ipalib/config.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/ipalib/config.py b/ipalib/config.py
index 04f1442fd..3544331df 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -98,8 +98,8 @@ class Env(object):
Note that the automatic type conversion is case sensitive. For example:
- >>> env.false = 'false' # Not equal to repr(False)!
- >>> env.false
+ >>> env.not_false = 'false' # Not equal to repr(False)!
+ >>> env.not_false
'false'
If an ``str`` value looks like an integer, it's automatically converted to
@@ -122,8 +122,8 @@ class Env(object):
>>> env.number = ' 42 ' # Still converted to an int
>>> env.number
42
- >>> env.actually_false = ' False ' # Still equal to repr(False)
- >>> env.actually_false
+ >>> env.false = ' False ' # Still equal to repr(False)
+ >>> env.false
False
Also, empty ``str`` instances are converted to ``None``. For example:
@@ -181,17 +181,18 @@ class Env(object):
2. `Env._finalize_core()` - merge-in variables from the configuration
files and then merge-in variables from the internal defaults, after
which at least all the standard variables will be set. After this
- method is called, the plugins will be loaded, during which 3rd-party
- plugins can set additional variables they may need.
+ method is called, the plugins will be loaded, during which
+ third-party plugins can merge-in defaults for additional variables
+ they use (likely using the `Env._merge()` method).
3. `Env._finalize()` - one last chance to merge-in variables and then
the instance is locked. After this method is called, no more
environment variables can be set during the remaining life of the
process.
- However, normally none of the above methods are called directly and instead
- only `plugable.API.bootstrap()` is called, which itself takes care of
- correctly calling the `Env` bootstrapping methods.
+ However, normally none of these three bootstraping methods are called
+ directly and instead only `plugable.API.bootstrap()` is called, which itself
+ takes care of correctly calling the `Env` bootstrapping methods.
"""
__locked = False
@@ -267,7 +268,16 @@ class Env(object):
def __delattr__(self, name):
"""
- Raise AttributeError (deletion is never allowed).
+ Raise an ``AttributeError`` (deletion is never allowed).
+
+ For example:
+
+ >>> env = Env()
+ >>> env.name = 'A value'
+ >>> del env.name
+ Traceback (most recent call last):
+ ...
+ AttributeError: locked: cannot delete Env.name
"""
raise AttributeError(
DEL_ERROR % (self.__class__.__name__, name)