Just my 2 cents, but, if you have to register several libraries, isn't this a bit too verbose ?<br>Can't we have something grokking it all in one shot, like megrok.resourcelibrary ?<br><br><br><div class="gmail_quote">
2009/6/23 Jasper Spaans <span dir="ltr"><<a href="mailto:j@jasper.es">j@jasper.es</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
The current grok universe lacks useful documentation for<br>
grok.DirectoryResource (written by j-w), which is rather helpful when doing<br>
stuff with hurry.resource. Here's a small snippet of code which documents<br>
that for eternity in the list-archives. Here's the sample, I'll put it in<br>
the site tonight.<br>
<br>
import grok<br>
from hurry.jquery import jquery<br>
from hurry.resource import Library, ResourceInclusion<br>
<br>
class jsdir(grok.DirectoryResource):<br>
<a href="http://grok.name" target="_blank">grok.name</a>('js')<br>
grok.path('js')<br>
<br>
localjs = Library('js')<br>
<br>
sprintf = ResourceInclusion(localjs, 'jquery.sprintf.js', depends=[jquery])<br>
<br>
Now, putting something like sprintf.need() in your views at the right place<br>
will cause the publisher to include the snippets for both jquery and<br>
jquery.sprintf<br>
<br>
Cheers,<br>
--<br>
Jasper Spaans<br>
<br>
Fox-IT Experts in IT Security!<br>
I <a href="http://www.fox-it.com" target="_blank">www.fox-it.com</a><br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
</blockquote></div><br>