Allow extensions to declare their icon.

The PillarExtension.icon() property returns the icon HTML class,
for use like i.pi-{{ext.icon}}
This commit is contained in:
Sybren A. Stüvel 2017-05-24 15:46:21 +02:00
parent 0cf96e47e8
commit 43a04880e0

View File

@ -32,6 +32,14 @@ class PillarExtension(object, metaclass=abc.ABCMeta):
:rtype: unicode :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 @abc.abstractmethod
def flask_config(self): def flask_config(self):
"""Returns extension-specific defaults for the Flask configuration. """Returns extension-specific defaults for the Flask configuration.