[Distutils] listening for EntryPoints
Kevin Dangoor
dangoor at gmail.com
Tue Aug 30 17:57:05 CEST 2005
On 8/30/05, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 07:07 AM 8/30/2005 -0400, Kevin Dangoor wrote:
> >I'm planning to use the EntryPoint facility for plugins in my
> >application, and I was just thinking about what it would take to load
> >a new plugin. My best guess is that, right now, it would take a
> >restart... which is not bad, but not ideal either.
> >
> >In order to dynamically add a plugin at runtime, it seems like I would need
> >
> >1) a way to get a new egg loaded
>
> require(), or working_set.add()
>
>
> >2) a notification to go out to the parts of the code that care about
> >the entry points for a particular name or group.
>
> working_set.subscribe() adds a callback that will be invoked with a
> Distribution object whenever one is added to the working set.
Thanks, Phillip! I'm not surprised to hear that you've already worked this out!
> >Does anyone else care about being able to add plugins without a
> >restart, or is it just me?
>
> Adding plugins without a restart isn't a problem. It's removing or
> upgrading them that's not practical.
Yeah, I've been using Python long enough to know about the intracacies
of trying to reload something. That's a less critical use case than
being able to add something seamlessly.
Kevin
More information about the Distutils-SIG
mailing list