Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grok finding my static folder in a plone product

Tags:

plone

grok

I discovered that in a Plone install, which had a 1.2.0 five.grok installed, I just had to have a "static" folder in my egg source, and grok would register it appropriately.

When I moved to an environment with a 1.3.0 five.grok installed, this static folder was not registered. I can, of course register it explicitly in the configure.zcml file - which works fine. Checking the source code of five.grok there is indeed a change related to this: the class StaticResourcesGrokker was removed from meta.py between 1.2.0 and 1.3.0 of five.grok.

I'm just trying to understand if there's a new way of having the static folder registered in the "grok way", or should I just revert to using explicit registration in the configure.zcml?

like image 885
luke.tunmer Avatar asked Oct 23 '22 17:10

luke.tunmer


2 Answers

I have no explanation on why such a handy feature disappeared. All I could find was this commit diff:

http://svn.zope.org/five.grok/trunk/src/five/grok/meta.py?rev=123298&r1=112163&r2=123298

As you can see from the diff, the StaticResourcesGrokker class was obliterated during a merge with the sylvain-zope213. (sic) branch, with no comments given.

Until this functionality is restored, it is best you register the static folder manually.

like image 55
Rigel Di Scala Avatar answered Oct 26 '22 20:10

Rigel Di Scala


Probably the answer is here:

  • http://grok.zope.org/doc/1.3/upgrade.html

Quote:

The ‘static’ directory is no longer automatically grokked and registered as a DirectoryResource for serving static resources. Serving static resources is being superseded by the Fanstatic library and WSGI components.

like image 24
alepisa Avatar answered Oct 26 '22 20:10

alepisa