summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2016-07-20 13:23:33 +0200
committerJan Cholasta <jcholast@redhat.com>2016-08-03 16:32:39 +0200
commit29f7f822aba674ebc4184ecc126854adb4330a89 (patch)
tree27e2da44c822334e41b1dc9ecd13d78d10840bfa /ipalib/frontend.py
parent47a693d17430e82787d9704637c022a2fcac531a (diff)
downloadfreeipa-29f7f822aba674ebc4184ecc126854adb4330a89.tar.gz
freeipa-29f7f822aba674ebc4184ecc126854adb4330a89.tar.xz
freeipa-29f7f822aba674ebc4184ecc126854adb4330a89.zip
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>
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index cb00841f2..455b222d4 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -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):