[Checkins] SVN: grokcore.view/trunk/src/grokcore/view/te Update warning message to be move clear and more generic (it can be triggered not only for Views).

Sylvain Viollon sylvain at infrae.com
Tue Dec 7 12:11:01 EST 2010


Log message for revision 118750:
  Update warning message to be move clear and more generic (it can be triggered not only for Views).
  

Changed:
  U   grokcore.view/trunk/src/grokcore/view/templatereg.py
  U   grokcore.view/trunk/src/grokcore/view/tests/view/inline_unassociated.py
  U   grokcore.view/trunk/src/grokcore/view/tests/view/shared_template_dir.py
  U   grokcore.view/trunk/src/grokcore/view/tests/view/unassociated.py

-=-
Modified: grokcore.view/trunk/src/grokcore/view/templatereg.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/templatereg.py	2010-12-07 16:13:14 UTC (rev 118749)
+++ grokcore.view/trunk/src/grokcore/view/templatereg.py	2010-12-07 17:11:00 UTC (rev 118750)
@@ -194,18 +194,16 @@
     if unassociated:
         for dotted_name, template_name in unassociated:
             msg = (
-                "Found the following unassociated template(s) when "
-                "grokking %r: %s.  Define view classes inheriting "
-                "from grok.View to enable the template(s)." % (
-                dotted_name, template_name))
+                "Found the following unassociated template "
+                "after configuration in  %r: %s." % (
+                    dotted_name, template_name))
             warnings.warn(msg, UserWarning, 1)
     unassociated = file_template_registry.unassociated()
-    if unassociated:
+    for template_name in unassociated:
         msg = (
-            "Found the following unassociated template(s) when "
-            "grokking views: %s.  Define view classes inheriting "
-            "from grok.View to enable the template(s)." % (
-            ', '.join(unassociated)))
+            "Found the following unassociated template "
+            "after configuration: %s"  % (
+                template_name))
         warnings.warn(msg, UserWarning, 1)
 
 

Modified: grokcore.view/trunk/src/grokcore/view/tests/view/inline_unassociated.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/tests/view/inline_unassociated.py	2010-12-07 16:13:14 UTC (rev 118749)
+++ grokcore.view/trunk/src/grokcore/view/tests/view/inline_unassociated.py	2010-12-07 17:11:00 UTC (rev 118750)
@@ -9,9 +9,8 @@
 
   >>> grok.testing.grok(__name__)
   From grok.testing's warn():
-  ...UserWarning: Found the following unassociated template(s) when grokking
-  'grokcore.view.tests.view.inline_unassociated': club. Define view classes inheriting
-  from grok.View to enable the template(s)...
+  ...UserWarning: Found the following unassociated template after configuration in
+  'grokcore.view.tests.view.inline_unassociated': club...
 
   >>> warnings.warn = saved_warn
 

Modified: grokcore.view/trunk/src/grokcore/view/tests/view/shared_template_dir.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/tests/view/shared_template_dir.py	2010-12-07 16:13:14 UTC (rev 118749)
+++ grokcore.view/trunk/src/grokcore/view/tests/view/shared_template_dir.py	2010-12-07 17:11:00 UTC (rev 118750)
@@ -11,11 +11,9 @@
 
   >>> grok.testing.grok(shared_template_fixture.__name__)
   From grok.testing's warn():
-  ...UserWarning: Found the following unassociated template(s) when grokking
-  'grokcore.view.tests.view.shared_template_fixture.first_module': unassociated_instance.  Define view classes inheriting from
-  grok.View to enable the template(s)...
-  ...UserWarning: Found the following unassociated template(s) when grokking views:
-  ...shared_template_fixture...templates...unassociated.pt.  Define view classes inheriting from
-  grok.View to enable the template(s)...
+  ...UserWarning: Found the following unassociated template after configuration in
+  'grokcore.view.tests.view.shared_template_fixture.first_module': unassociated_instance...
+  ...UserWarning: Found the following unassociated template after configuration:
+  ...shared_template_fixture...templates...unassociated.pt...
 
 """

Modified: grokcore.view/trunk/src/grokcore/view/tests/view/unassociated.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/tests/view/unassociated.py	2010-12-07 16:13:14 UTC (rev 118749)
+++ grokcore.view/trunk/src/grokcore/view/tests/view/unassociated.py	2010-12-07 17:11:00 UTC (rev 118750)
@@ -9,9 +9,8 @@
 
   >>> grok.testing.grok(__name__)
   From grok.testing's warn():
-  ...UserWarning: Found the following unassociated template(s) when grokking views:
-  ...unassociated_templates...index.pt.  Define view classes inheriting from
-  grok.View to enable the template(s)...
+  ...UserWarning: Found the following unassociated template after configuration:
+  ...unassociated_templates...index.pt...
 
 Also templates of modules named equally as the package name the module
 resides in, should be found without error or warning. We check this



More information about the checkins mailing list