PIES (PlugIn Extension System) is a very simple plugin framework based on the code from A Simple Plugin Framework posted in 2008 by Marty Alchin.
It may be rare for 6 lines of functional code to require their own separate source repository, the maintainer of this code has used the code in more than one project now.
The main difference between Marty's work and the code in this repository is in the documentation which is targetted at Python 3 use.
There are no dependencies
python setup.py installfrom pies import PluginMount
class EventProvider(metaclass=PluginMount):
"""mount point for events"""Any class that inherits the mount point is a plugin
class AnEvent(EventProvider):
"""an implementation of an EventProvider"""
def __init__(self):
print("initialised")
def process(self):
"""do something useful"""
events = EventProvider.get_plugins()
[e.process() for e in events]