From 0fed74b56d1940f84e7b64c3661f21baabcb4616 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 13 Aug 2008 02:34:36 +0000 Subject: 138: Added ProxyTarget.doc property; CLI.print_commands() now uses cmd.doc instead of cmd.get_doc() --- ipalib/plugable.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 89eb423b..fbe5e638 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -128,6 +128,7 @@ class Proxy(ReadOnly): '__name_attr', '__public__', 'name', + 'doc', ) def __init__(self, base, target, name_attr='name'): @@ -146,10 +147,11 @@ class Proxy(ReadOnly): self.__target = target self.__name_attr = name_attr self.__public__ = base.__public__ - assert type(self.__public__) is frozenset self.name = getattr(target, name_attr) - check_identifier(self.name) + self.doc = target.doc self.__lock__() + assert type(self.__public__) is frozenset + check_identifier(self.name) def implements(self, arg): """ @@ -225,6 +227,13 @@ class ProxyTarget(ReadOnly): return self.__class__.__name__ name = property(__get_name) + def __get_doc(self): + """ + Convenience property to return the class docstring. + """ + return self.__class__.__doc__ + doc = property(__get_doc) + @classmethod def implements(cls, arg): """ -- cgit