A ducktype plugin library for python. The module does a “ducktype” interface check on a setuptools
entry point module. If the module passes, it is listed as an available plugin.
Requires setuptools
Run the following shell commands:
git clone git://github.com/getfatday/ducksoup.git cd ducksoup ./setup.py install
Define a plugin interface and entry point for you application:
# Define an interface.
class ICommand(IPlugin):
name = ""
description = ""
def execute(*arg): pass
# Register an entry point.
class Command(plugin):
__entry_point__ = "ducksoup.plugin.commands"
__interface__ = ICommand
Register an external module as a plugin.
from setuptools import setup setup( name="mycommands", version="0.0.1", description="""My Commands""", entry_points=""" [ducksoup.plugin.commands] mycommands.command = mycommands.command:Command """ )
Search for available plugins:
for entry in Command().entries:
print """Name: %s
Description: %s
""" % (entry.name, entry.description)
Shoot me an email at [email protected] with any feedback.