[Twisted-Python] plugin vs. dropin

i was going through the docs, and i found the two classes in twisted/python/plugin.py, and i was wondering what the difference is between the two. i'd like to be able to make a sort of plugin that when the plugin package is in the path, it interacts in arbitrary ways with my main application. however, i don't think i'd want it to appear in mktap, as that doesn't really make sense in this situation.....or does it? -phil

On Wed, Nov 26, 2003 at 02:49:46PM -0500, Phil Christensen wrote:
i was going through the docs, and i found the two classes in twisted/python/plugin.py, and i was wondering what the difference is between the two.
i'd like to be able to make a sort of plugin that when the plugin package is in the path, it interacts in arbitrary ways with my main application. however, i don't think i'd want it to appear in mktap, as that doesn't really make sense in this situation.....or does it?
a DropIn is an abstraction for an entire plugins.tml file. a PlugIn is a single entity, typically corresponding to a register() call in a plugins.tml file. mktap only shows plugins of type "tap" (because that is the only kind of plugin it knows how to use!), so if you make your plugins of a different type, they won't show up there. Jp
-phil
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

I've figured out that part. I created a plugin directory, and i set the type to "myPluginType"...now how do i access my plugin from within the app? i've got this in my plugins.tml file: register ("My plugin package", "core.plugin", description = """ Provides functionality to my app. """, type ="myPluginType") i did the following in the interpreter:
from twisted.python import plugin plugin.getPlugIns("myPluginType") [<Plugin 'My plugin package' core.plugin>]
so i guess my question is, what to i do with this plugin object? i see it has a property named "module", which is the string i gave it of "core.plugin". this file doesn't exist yet since i don't know what to put in it. i guess i just need a little more guidance. i'm looking through the code too, but i'm not sure what calls what... thanks for any help, -phil
On Wed, Nov 26, 2003 at 02:49:46PM -0500, Phil Christensen wrote: [snip snip snip]
i'd like to be able to make a sort of plugin that when the plugin package is in the path, it interacts in arbitrary ways with my main application. however, i don't think i'd want it to appear in mktap, as that doesn't really make sense in this situation.....or does it?
a DropIn is an abstraction for an entire plugins.tml file.
a PlugIn is a single entity, typically corresponding to a register() call in a plugins.tml file.
mktap only shows plugins of type "tap" (because that is the only kind of plugin it knows how to use!), so if you make your plugins of a different type, they won't show up there.

On Wed, Nov 26, 2003 at 04:08:14PM -0500, Phil Christensen wrote:
I've figured out that part. I created a plugin directory, and i set the type to "myPluginType"...now how do i access my plugin from within the app?
i've got this in my plugins.tml file:
register ("My plugin package", "core.plugin", description = """ Provides functionality to my app. """, type ="myPluginType")
i did the following in the interpreter:
from twisted.python import plugin plugin.getPlugIns("myPluginType") [<Plugin 'My plugin package' core.plugin>]
Call .load() on it, and do something with the result. Jp

Phil Christensen wrote:
from twisted.python import plugin plugin.getPlugIns("myPluginType")
[<Plugin 'My plugin package' core.plugin>]
so i guess my question is, what to i do with this plugin object? i see it has a property named "module", which is the string i gave it of "core.plugin". this file doesn't exist yet since i don't know what to put in it.
i guess i just need a little more guidance. i'm looking through the code too, but i'm not sure what calls what...
You may want to look at how TouRSSt uses plugins. http://ftp.debian.org/debian/pool/main/t/toursst/

On Wed, 26 Nov 2003 14:49:46 -0500 (EST) "Phil Christensen" <phil@bubblehouse.org> wrote:
i'd like to be able to make a sort of plugin that when the plugin package is in the path, it interacts in arbitrary ways with my main application. however, i don't think i'd want it to appear in mktap, as that doesn't really make sense in this situation.....or does it?
You can have different types of plugins. For example, mktap uses one kind of plugin, but twisted.lore uses another. IIRC there's a type keyword arg that indicates what kind of plugin it is. -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python & Twisted consulting
participants (4)
-
Itamar Shtull-Trauring
-
Jp Calderone
-
Phil Christensen
-
Tommi Virtanen