frontend: Change doc, summary, topic and NO_CLI to class properties

Avoid need to instantiate all commands just to get information for
displaying help.

https://fedorahosted.org/freeipa/ticket/6048

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
David Kupka
2016-08-03 16:32:39 +02:00
committed by Jan Cholasta
parent 47a693d174
commit 29f7f822ab
7 changed files with 120 additions and 47 deletions
+6 -4
View File
@@ -38,7 +38,7 @@ from ipalib.errors import (ZeroArgumentError, MaxArgumentError, OverlapError,
ValidationError, ConversionError)
from ipalib import errors, messages
from ipalib.request import context, context_frame
from ipalib.util import json_serialize
from ipalib.util import classproperty, json_serialize
if six.PY3:
unicode = str
@@ -426,9 +426,11 @@ class Command(HasParam):
api_version = API_VERSION
@property
def topic(self):
return type(self).__module__.rpartition('.')[2]
@classmethod
def __topic_getter(cls):
return cls.__module__.rpartition('.')[2]
topic = classproperty(__topic_getter)
@property
def forwarded_name(self):