From 43a04880e07d7e902f1a73285fff32c838140b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 24 May 2017 15:46:21 +0200 Subject: [PATCH] Allow extensions to declare their icon. The PillarExtension.icon() property returns the icon HTML class, for use like i.pi-{{ext.icon}} --- pillar/extension.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pillar/extension.py b/pillar/extension.py index 30d6531a..bb7a59b0 100644 --- a/pillar/extension.py +++ b/pillar/extension.py @@ -32,6 +32,14 @@ class PillarExtension(object, metaclass=abc.ABCMeta): :rtype: unicode """ + @property + def icon(self) -> str: + """Returns the icon HTML class, for use like i.pi-{{ext.icon}} + + Defaults to the extension name. + """ + return self.name + @abc.abstractmethod def flask_config(self): """Returns extension-specific defaults for the Flask configuration.