[Zope3-Users] z3c.zrtresource or zc.resourcelibrary

Jeff Shell eucci.group at gmail.com
Tue Oct 31 19:15:00 EST 2006


On 10/24/06, Gary Poster <gary at zope.com> wrote:
> It might be nice to have zc.resourcelibrary be able to somehow serve
> z3c.zrtresource files too...it doesn't right now.  FWIW, right now in
> lieu of zrtresource I just use <script ... tal:content="string:
> /* ... JS that specifies dynamic variables and calls ... */
> "></script>.  Simple, and encourages delineation between library and
> usage; but a bit hacky, and unfriendly to designers.

I do a lot inline in my Python code, using our nevow.Stan inspired tag
generation system and little bits and pieces I threw together to ease
in generating short bits of JS from within Python. In particular,
marshalling of basic Python structures to Javascript using a modified
`jsonencode` module from the `simplejson` package.

Among other things, it lets me use normal Python dictionaries,
strings, lists, numbers, etc, for use in generating code. `jsonencode`
ensures that everything is escaped properly. It gets to be handy to
build on, especially when wanting to generate a Javascript call and
supply it with a big list of generated dictionaries.

> Other JS-related bits to know about (you'll have to do your own
> reading sometime :-): http://zif.hill-street.net/headincludes (WSGI
> variation on resourcelibrary), http://zif.hill-street.net/gzipper/
> (WSGI, gzips all output for smaller browser page sizes), http://
> zif.hill-street.net/jsmin/ (WSGI, compresses JS for smaller browser
> page sizes), and http://svn.zope.org/z3c.javascript/ (resourcelibrary-
> aware collection of mochikit, dojo, et al).

Ah, the real reason for my response here: how does one use third party
WSGI "Middleware" with Zope? Alternately, does anyone have any
experience running Zope in another WSGI supporting server?

There are quite a few things out there in WSGI land that I'm
interested in, but I've never quite understood how they work together
on their own and/or with big systems like Zope.

By the way - I've had some issues with the dependency tracking in
zc.resourcelibrary. Is there a tracker where I can post said issues?
(if I can remember and reconstruct them, that is)
-- 
Jeff Shell


More information about the Zope3-users mailing list