Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.32 KB

README.textile

File metadata and controls

66 lines (46 loc) · 1.32 KB

Ducksoup Module

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

Installing

Run the following shell commands:

git clone git://github.com/getfatday/ducksoup.git
cd ducksoup
./setup.py install

Usage

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)    

Feedback

Shoot me an email at getfatday@gmail.com with any feedback.