It's very helpful if the plugin browser shows the parent class (or
classes) that a plugin subclasses from.  This small patch adds this
feature.
>From 8dc21d6f30d1466f07b38e0d015de39a8c0d29d2 Mon Sep 17 00:00:00 2001
From: Jason Gerard DeRose <jder...@redhat.com>
Date: Wed, 14 Oct 2009 15:08:30 -0600
Subject: [PATCH] Make plugin browser show plugin parent class

---
 ipalib/plugable.py  |    3 +++
 ipawebui/widgets.py |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index dceb41f..12746c1 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -163,6 +163,9 @@ class Plugin(ReadOnly):
         self.name = cls.__name__
         self.module = cls.__module__
         self.fullname = '%s.%s' % (self.module, self.name)
+        self.bases = tuple(
+            '%s.%s' % (b.__module__, b.__name__) for b in cls.__bases__
+        )
         self.doc = inspect.getdoc(cls)
         if self.doc is None:
             self.summary = '<%s>' % self.fullname
diff --git a/ipawebui/widgets.py b/ipawebui/widgets.py
index 71eee92..74b9d7e 100644
--- a/ipawebui/widgets.py
+++ b/ipawebui/widgets.py
@@ -58,6 +58,11 @@ class IPAPlugins(base.Container):
     </td>
     </tr>
 
+    <tr class="${row.next()}">
+    <td>base(s)</td>
+    <td py:content="', '.join(p.bases)" />
+    </tr>
+
     <tr py:if="p.doc" class="${row.next()}">
     <td>docstring</td>
     <td><pre py:content="p.doc" /></td>
-- 
1.6.3.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to