On Mon, Apr 21, 2008 at 8:57 AM, bobjack <[EMAIL PROTECTED]> wrote:
>
> > The onCreate method gets called every time *any* new commander is
> created therefore the plugin controllers get recreated for *every*
> commander *every* time a new commander is created.
>
> I'm not sure whether this is a serious problem. Your solution works, as
> does keeping a module-level dictionary of controllers.
>
The idea is to create a controller once per commander, using a module-level
dictionary (typically called controllers) to keep track of whether a
controller for the commander already exists.
But it doesn't seem like most plugins that use the controllers dictionary
properly: they just do:
controllers[c] = controller(c)
More appropriate code would be:
if not controllers.get(c):
controllers[c] = controller(c)
Sigh. It looks like either
A) The conventions for calling onCreate must change or
B) Many (most) plugins will have to change.
I'll think about this. And furthermore, the example code in leoPlugins.leo
should be updated...
Edward
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---