diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 19:28:01 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 19:28:01 +0000 |
commit | 0e532cd7b30023b10f97690540f4209106d7f832 (patch) | |
tree | 7b87d5d6948aa3471ef67b212d70b009443f3d76 /ipalib/plugable.py | |
parent | e756e12718a538d82de45fbba3a5e97f3a4d7d7f (diff) | |
download | freeipa-0e532cd7b30023b10f97690540f4209106d7f832.tar.gz freeipa-0e532cd7b30023b10f97690540f4209106d7f832.tar.xz freeipa-0e532cd7b30023b10f97690540f4209106d7f832.zip |
100: Cleaned up NameSpace docstrings; cleanup up NameSpace unit tests
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index b4a6fb10..63de6deb 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -278,13 +278,17 @@ class Plugin(ProxyTarget): class NameSpace(ReadOnly): """ - A read-only namespace of (key, value) pairs that can be accessed - both as instance attributes and as dictionary items. + A read-only namespace of Proxy instances. Proxy.name is used to name the + attributes pointing to the Proxy instances, which can also be accesses + through a dictionary interface, for example: + + >>> assert namespace.my_proxy is namespace['my_proxy'] # True """ def __init__(self, proxies): """ - NameSpace + `proxies` - an iterable returning the Proxy instances to be contained + in this NameSpace. """ self.__proxies = tuple(proxies) self.__d = dict() @@ -299,7 +303,7 @@ class NameSpace(ReadOnly): def __iter__(self): """ Iterates through the proxies in this NameSpace in the same order they - were passed in the contructor. + were passed to the constructor. """ for proxy in self.__proxies: yield proxy |