How to use plugins..

Josiah Carlson jcarlson at nospam.uci.edu
Sun Feb 29 15:44:17 EST 2004


> 1.)
> Assume my package is installed on path x and has a subdirectory named
> plugins.
> If I import my package I want to scan automatically the plugin
> directory.

os.listdir(path)

> 2.) 
> Plugins should follow a common interface,  is there a way to enforce
> this?
> (Actually I think this might be easy.)

use try and except liberally:

try:
     plugin.function(args...)
except:
     #report plugin error


  - Josiah



More information about the Python-list mailing list