Skip to content

garym/pies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIES

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.

Installation

There are no dependencies

python setup.py install

Usage

Specifying a mount point:

from pies import PluginMount

class EventProvider(metaclass=PluginMount):
    """mount point for events"""

Creating a plugin:

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"""

Using your plugin:

events = EventProvider.get_plugins()
[e.process() for e in events]

About

PlugIn Extension System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages