diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-17 23:08:52 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-17 23:08:52 -0700 |
commit | 4f24f0fd8837383f4a2abc54946f6f84810807b8 (patch) | |
tree | fe210ce86abd11f693a628ff4f4fd43250fd77df /ipalib/plugable.py | |
parent | 171ed58367e58c59f9f67ef831f08ce80ba8508b (diff) | |
download | freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.gz freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.xz freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.zip |
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.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 5363a51e..e6b5c1ac 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)) |