mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
committed by
Jan Cholasta
parent
47a693d174
commit
29f7f822ab
+6
-4
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user