Python plug-in Frameworks like Eclipse RCP...

J

Jim Hargrave

Eclipse provides a very nice application framework which supports
plug-ins. It's easy to dynamically add new functionality, menu items,
property editors, options etc.. using a combination of XML and Java code.

Is there a similar framework for Python? If not any hints on how such a
framework would be implemented?

I'm building a client side tool using Python/wxPython for our
translators and would like to have a pluggable architecture similar to
Eclipse RCP


thanks!
 
J

Jim Hargrave

Hum, maybe my question was too specific. What I would really like to
know is what is the best way to implement a Python application with a
pluggable architecture. In particular, I would like to use wxPython and
have plug ins automatically register themselves with the GUI by adding
themselves to the mean or adding a tab. Again this is much like Eclipse
RCP - but forget that part :)

J
 
D

Diez B. Roggisch

Jim said:
Hum, maybe my question was too specific. What I would really like to
know is what is the best way to implement a Python application with a
pluggable architecture. In particular, I would like to use wxPython and
have plug ins automatically register themselves with the GUI by adding
themselves to the mean or adding a tab. Again this is much like Eclipse
RCP - but forget that part :)


This is close to beeing trivial in python - just utilize __import__ to
dynamically load modules that shall act as plugins. These modules then only
have to follow a sort of protocol - lets say you have a module called

pluginloader.py

that has a register-function. The loaded module could import pluginloader
and register itself, or a class defined in itself. Like this

---------plugin_example.py-------------

import pluginloader


class ExamplePlugin(pluginloader.PluginBase):
def __init__(self,...):
....



pluginloader.register(ExamplePlugin())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top