Skip to content

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.

Notifications You must be signed in to change notification settings

getfatday/ducksoup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages