[rhmessaging-commits] rhmessaging commits: r3388 - mgmt/trunk/wooly/python/wooly.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed May 20 11:27:19 EDT 2009


Author: eallen
Date: 2009-05-20 11:27:19 -0400 (Wed, 20 May 2009)
New Revision: 3388

Modified:
   mgmt/trunk/wooly/python/wooly/pages.py
   mgmt/trunk/wooly/python/wooly/pages.strings
Log:
Display list of problem widgets when in debug mode (in an html comment)

Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py	2009-05-20 15:25:43 UTC (rev 3387)
+++ mgmt/trunk/wooly/python/wooly/pages.py	2009-05-20 15:27:19 UTC (rev 3388)
@@ -129,9 +129,20 @@
 
         return sess.marshal()
 
+    def do_process(self, session):
+        self.update_script.process(session)
+        self.defer_script.process(session)
+        super(HtmlPage, self).do_process(session)
+
     def render_base_name(self, session):
         return self.base_name
 
+    def render_problems(self, session):
+        if session.debug:
+            problems = session.debug.check()
+            if len(problems):
+                return "<!-- Widgets rendered but never processed: %s -->" % ", ".join([x.path for x in problems])
+
     class UpdatesAttribute(Attribute):
         def get_default(self, session):
             return list()
@@ -201,6 +212,13 @@
 
         return writer.to_string()
 
+    def render_problems(self, session):
+        sess = self.session.get(session)
+        if sess.debug:
+            problems = sess.debug.check()
+            if len(problems):
+                return "<!-- Widgets rendered but never processed: %s -->" % ", ".join([x.path for x in problems])
+
     def render_widget_id(self, session, widget):
         return widget.path
 

Modified: mgmt/trunk/wooly/python/wooly/pages.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.strings	2009-05-20 15:25:43 UTC (rev 3387)
+++ mgmt/trunk/wooly/python/wooly/pages.strings	2009-05-20 15:27:19 UTC (rev 3388)
@@ -18,13 +18,14 @@
     <script type="text/javascript" src="resource?name=wooly.js"> </script>
     <script type="text/javascript" src="resource?name=app.js"> </script>
     <script type="text/javascript" src="{base_name}.js"> </script>
+  {defer_script}
+  {update_script}
   </head>
   <body class="{class}">
     {content}
   </body>
-  {defer_script}
-  {update_script}
 </html>
+{problems}
 
 [AjaxScript.html]
 <script type="text/javascript">
@@ -49,6 +50,7 @@
   <!ENTITY nbsp "&#160;">
 ]>
 <widgets>{widgets}</widgets>
+{problems}
 
 [UpdatePage.widget_html]
 <widget id="{widget_id}">{widget}</widget>




More information about the rhmessaging-commits mailing list