Just my 2 cents, but, if you have to register several libraries, isn&#39;t this a bit too verbose ?<br>Can&#39;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">&lt;<a href="mailto:j@jasper.es">j@jasper.es</a>&gt;</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&#39;s a small snippet of code which documents<br>
that for eternity in the list-archives. Here&#39;s the sample, I&#39;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>(&#39;js&#39;)<br>
    grok.path(&#39;js&#39;)<br>
<br>
localjs = Library(&#39;js&#39;)<br>
<br>
sprintf = ResourceInclusion(localjs, &#39;jquery.sprintf.js&#39;, 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>