summaryrefslogtreecommitdiffstats
path: root/ipalib/plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-17 23:08:52 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-17 23:08:52 -0700
commit4f24f0fd8837383f4a2abc54946f6f84810807b8 (patch)
treefe210ce86abd11f693a628ff4f4fd43250fd77df /ipalib/plugable.py
parent171ed58367e58c59f9f67ef831f08ce80ba8508b (diff)
downloadfreeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.zip
freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.gz
freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.xz
Plugin.doc instance attribute is now parsed out using inspect.getdoc(); added Plugin.summary instance attribute, created in Plugin.__init__()
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r--ipalib/plugable.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 5363a51..e6b5c1a 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -258,7 +258,11 @@ class Plugin(ReadOnly):
self.name = cls.__name__
self.module = cls.__module__
self.fullname = '%s.%s' % (self.module, self.name)
- self.doc = cls.__doc__
+ self.doc = inspect.getdoc(cls)
+ if self.doc is None:
+ self.summary = '<%s>' % self.fullname
+ else:
+ self.summary = self.doc.split('\n\n', 1)[0]
log = logging.getLogger('ipa')
for name in ('debug', 'info', 'warning', 'error', 'critical'):
setattr(self, name, getattr(log, name))