+# Copyright (c) 2013-2015 Jack Kaliko <kaliko@azylum.org>
+#
+# This file is part of sima
+#
+# sima is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# sima is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with sima. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+"""
+Plugin object to derive from
+"""
+
+
+class Plugin:
+ """
+ First non-empty line of the docstring is used as description
+ Rest of the docstring at your convenience.
+
+ The lowercased plugin Name MUST be the same as the module (file name),
+ for instance Plugin → plugin.py
+ It eases plugins discovery and simplifies the code to handle them,
+ IMHO, it's a fair trade-off.
+ """
+
+ @classmethod
+ def info(cls):
+ """self documenting class method
+ """
+ doc = 'Undocumented plugin! Fill "{}" docstring'.format(cls.__name__)
+ if cls.__doc__:
+ doc = cls.__doc__.strip(' \n').splitlines()[0]
+ return {'name': cls.__name__,
+ 'doc': doc,}