I added the module solution for using entry points. It works nicely so I will leave it
for now unless someone has a better idea.
Right now any module listed under the moksha.extension_point entry point will have its
directory scanned for files ending with .js
I'm also going to work on the format of the extension points so they are easier to
write but that will have to wait until everything else is in for the fedora-community
launch.
----- "John Palmieri" <johnp(a)redhat.com> wrote:
I split the Connectors into a separate middleware so they can be
used
outside of Moksha. It still relies on Pylons for getting
configuration data but I think we should eventually add all config
options to parameters in the constructor and let the controlling WSGI
app decide how to get that configuration data.
Also the server portion of extension points is ported as its own
middleware. I haven't moved the client JavaScript yet so right now it
will only serve extensions if you request it directly in the format of
http://<your_moksha_host>/moksha_extension_point?exttype=<consumable
extension point type>. That will send you back javascript as text as
you need the client to actually run it.
One thing I want to figure out is how to configure extension point
directories. Right now only one directory is scanned when you setup
the middleware. I would really like it to work like python entry
points where multiple egginfos can specify a directory to scan. Right
now whoever sets up the middleware chooses the directory.
Unfortunately entry points are restricted to python classes, functions
and modules. One solution would be to specify that an __init__.py
file is added to the directory the extensions are in and to specify
the module as an entry point. Then we can just get the directory
mapping from the module. The only thing I don't like about this
approach is that I would want these files to reside in /usr/share not
/usr/lib/python2.5/site-packages. I'm not sure if that is possible.
--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.
_______________________________________________
moksha mailing list
moksha(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/moksha
--
--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.