diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-18 22:01:04 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-18 22:01:04 +0000 |
commit | 81ebe078be56cef4c3d15e40d1b1fad01e67c0c0 (patch) | |
tree | 4e7613084207aa3257028fabaa5460166948b9f9 /ipalib/plugable.py | |
parent | e524c826db12ffed029d627bd4afcfc03e7f899a (diff) | |
download | freeipa-81ebe078be56cef4c3d15e40d1b1fad01e67c0c0.tar.gz freeipa-81ebe078be56cef4c3d15e40d1b1fad01e67c0c0.tar.xz freeipa-81ebe078be56cef4c3d15e40d1b1fad01e67c0c0.zip |
298: Cleaned up docstrings in ReadOnly methods
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 4e356783c..44653943d 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -71,22 +71,25 @@ class ReadOnly(object): def __lock__(self): """ - Puts this instance into a read-only state, after which attempting to - set or delete an attribute will raise AttributeError. + Put this instance into a read-only state. + + After the instance has been locked, attempting to set or delete an + attribute will raise AttributeError. """ assert self.__locked is False, '__lock__() can only be called once' self.__locked = True def __islocked__(self): """ - Returns True if this instance is locked, False otherwise. + Return whether instance is locked. """ return self.__locked def __setattr__(self, name, value): """ - Raises an AttributeError if `ReadOnly.__lock__()` has already been - called; otherwise calls object.__setattr__(). + If unlocked, set attribute named ``name`` to ``value``. + + If this instance is locked, AttributeError will be raised. """ if self.__locked: raise AttributeError('read-only: cannot set %s.%s' % @@ -96,8 +99,9 @@ class ReadOnly(object): def __delattr__(self, name): """ - Raises an AttributeError if `ReadOnly.__lock__()` has already been - called; otherwise calls object.__delattr__(). + If unlocked, delete attribute named ``name``. + + If this instance is locked, AttributeError will be raised. """ if self.__locked: raise AttributeError('read-only: cannot del %s.%s' % |