diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-18 11:21:12 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-18 11:21:12 -0700 |
commit | 46e37ab14491db06ffa46b682c079c397e644014 (patch) | |
tree | 5aa95067a1bc0d97f93406a69714ddc7d27fe41b /ipalib | |
parent | 4d1681176afc45c57fb4316892f939bda1bacf1d (diff) | |
download | freeipa-46e37ab14491db06ffa46b682c079c397e644014.tar.gz freeipa-46e37ab14491db06ffa46b682c079c397e644014.tar.xz freeipa-46e37ab14491db06ffa46b682c079c397e644014.zip |
New Param: ported Param.__repr__() and corresponding unit test
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/parameter.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipalib/parameter.py b/ipalib/parameter.py index fca95b0ef..76a9cd508 100644 --- a/ipalib/parameter.py +++ b/ipalib/parameter.py @@ -24,6 +24,7 @@ Parameter system for command plugins. from types import NoneType from plugable import ReadOnly, lock, check_name from constants import NULLS, TYPE_ERROR, CALLABLE_ERROR +from util import make_repr class DefaultFrom(ReadOnly): @@ -287,6 +288,16 @@ class Param(ReadOnly): # And we're done. lock(self) + def __repr__(self): + """ + Return an expresion that could construct this `Param` instance. + """ + return make_repr( + self.__class__.__name__, + self.param_spec, + **self.__kw + ) + def normalize(self, value): """ Normalize ``value`` using normalizer callback. |