Envisage and ExtensionPoints

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Envisage and ExtensionPoints

Lic. José M. Rodriguez Bacallao
hi folks, is posible in envisage to declare an extension point outside
the Plugin class, for example, in a non traits class, just like
pyutillib.plugin.core package do, and use it just like if this
extension point will be in a Plugin class?

--
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Envisage and ExtensionPoints

Martin Chilvers
Lic. José M. Rodriguez Bacallao wrote:
> hi folks, is posible in envisage to declare an extension point outside
> the Plugin class, for example, in a non traits class, just like
> pyutillib.plugin.core package do, and use it just like if this
> extension point will be in a Plugin class?

Just use the programmatic instead of the declarative API (Envisage is based on the principle of
always having a declarative way to do the 80% case, along with a programmatic way for the other 20%
- and of course, the declarative way is implemented using the programmtic one ;^)...

So... You can just create extension points on the fly:-

blargles_extension_point = ExtensionPoint(
   id='foo.bar.blargles', trait_type=List(Blargles), desc='Some blargles'
)

And add them to the application...

applicaiton.add_extension_point(blargles_extension_point)

Hope that helps,

Martin

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev