Skip to content

Commit

Permalink
More helpful errors for obvious errors
Browse files Browse the repository at this point in the history
  • Loading branch information
do3cc committed Sep 19, 2011
1 parent bd51560 commit 3d8921a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/grokcore/view/templatereg.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,16 @@ def _register_template_file(self, module_info, template_path):
# Warning when importing files. This should be
# allowed because people may be using editors that generate
# '.bak' files and such.
warnings.warn("File '%s' has an unrecognized extension in "
"directory '%s'" %
(template_file, template_dir), UserWarning, 2)
if extension == 'pt':
warnings.warn("You forgot to embed the zcml slug for "
"grokcore.view. It provides a renderer "
"for pt files. Now the file '%s' in '%s' "
"cannot be rendered" %
(template_file, template_dir), UserWarning, 2)
else:
warnings.warn("File '%s' has an unrecognized extension in "
"directory '%s'" %
(template_file, template_dir), UserWarning, 2)
return
template = template_factory(template_file, template_dir)
template._annotateGrokInfo(template_name, template_path)
Expand Down

0 comments on commit 3d8921a

Please sign in to comment.