[Grok-dev] issueing a warning, not an error when template files are not associated

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Nov 8 08:35:45 EST 2007


The following behaviour is bothering me for, like, always, in Grok. I'd 
like to have your opinion on it:

Whenever Grok finds a template file that it cannot associate with a view 
component Grok will raise a GrokError and thus your application won't start.

Somehow this happens to me a lot; I guess I frequently copy or move or 
create templates while developing, without (yet) having a view class for 
it. Then I find Zope not starting and thus I need to somehow disable the 
template, by renaming it for example (it used to be even harder: you had 
to move it out of the dir, or prefix the filename with a dot, because 
Grok would choke on unrecognized names).

Question: what about just issueing a UserWarning for any template that 
could not be associated, instead just for the files with an unrecognized 

As a consequence of the current behaviour:

By using the module-level grok.templatedir() directive, you can instruct 
Grok to look into a specific directory for its template. I get the 
impression however, that you cannot have view components in two seperate 
modules looking for templates in the same grok.templatedir() - because 
after grokking the first module, Grok will conclude there're 
unassociated templates left.

So, another question: is it possible to raise the GrokError (or the 
afformentiond UserWarning) about unassociated templates after the 
grokkking process for a package is completed?

What do people think?

kind regards,

More information about the Grok-dev mailing list