summaryrefslogtreecommitdiffstats
path: root/ipalib/public.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-08 16:43:24 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-08 16:43:24 +0000
commitf656e31a7ee366c57d959e4a3e4b9a935eb2cc07 (patch)
tree1e376610259d617a620bd992fdff0bea64954c43 /ipalib/public.py
parentb3fc5f9a41685f40da0702f860e6182182783150 (diff)
downloadfreeipa.git-f656e31a7ee366c57d959e4a3e4b9a935eb2cc07.tar.gz
freeipa.git-f656e31a7ee366c57d959e4a3e4b9a935eb2cc07.tar.xz
freeipa.git-f656e31a7ee366c57d959e4a3e4b9a935eb2cc07.zip
80: Cleaned up docstring for option.normalize()
Diffstat (limited to 'ipalib/public.py')
-rw-r--r--ipalib/public.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/ipalib/public.py b/ipalib/public.py
index 071d905d..07f03ef8 100644
--- a/ipalib/public.py
+++ b/ipalib/public.py
@@ -52,14 +52,17 @@ class option(object):
))
__rules = None
+ # type = unicode, int, float # Set in subclass
+
def normalize(self, value):
"""
- Normalize an input value. The base class implementation only does
- type coercion, but subclasses might do other normalization (e.g., a
- str option might strip leading and trailing white-space).
+ Returns the normalized form of `value`. If `value` cannot be
+ normalized, NormalizationError is raised, which is a subclass of
+ ValidationError.
- If value cannot be normalized, NormalizationError is raised, which
- is a subclass of ValidationError.
+ The base class implementation only does type coercion, but subclasses
+ might do other normalization (e.g., a unicode option might strip
+ leading and trailing white-space).
"""
try:
return self.type(value)