[rhmessaging-commits] rhmessaging commits: r1302 - mgmt/cumin/python/wooly.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Nov 13 13:36:02 EST 2007


Author: justi9
Date: 2007-11-13 13:36:01 -0500 (Tue, 13 Nov 2007)
New Revision: 1302

Modified:
   mgmt/cumin/python/wooly/__init__.py
Log:
More field renaming.



Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py	2007-11-13 18:26:00 UTC (rev 1301)
+++ mgmt/cumin/python/wooly/__init__.py	2007-11-13 18:36:01 UTC (rev 1302)
@@ -18,15 +18,15 @@
         self.attributes = list()
         self.parameters = list()
         
-        self.template = Template(self, "html")
+        self.__template = Template(self, "html")
 
         self.errors = Attribute(app, "errors")
         self.errors.set_default(list())
         self.add_attribute(self.errors)
 
-        self.cached_ancestors = None
-        self.cached_path = None
-        self.cached_page = None
+        self.__ancestors = None
+        self.__path = None
+        self.__page = None
         self.child_index = None
 
         app.add_widget(self)
@@ -38,36 +38,36 @@
         return self.__parent
 
     def ancestors(self):
-        if not self.cached_ancestors:
+        if not self.__ancestors:
             if not self.parent():
-                self.cached_ancestors = tuple()
+                self.__ancestors = tuple()
             else:
                 ancs = list(self.parent().ancestors())
                 ancs.append(self.parent())
 
-                self.cached_ancestors = tuple(ancs)
+                self.__ancestors = tuple(ancs)
 
-        return self.cached_ancestors
+        return self.__ancestors
 
     def path(self):
-        if self.cached_path == None:
+        if self.__path == None:
             if not self.parent():
-                self.cached_path = ""
+                self.__path = ""
             elif not self.parent().parent():
-                self.cached_path = self.name();
+                self.__path = self.name();
             else:
-                self.cached_path = self.parent().path() + "." + self.name()
+                self.__path = self.parent().path() + "." + self.name()
 
-        return self.cached_path
+        return self.__path
 
     def page(self):
-        if self.cached_page == None:
+        if self.__page == None:
             if not self.parent():
-                self.cached_page = self
+                self.__page = self
             else:
-                self.cached_page = self.parent().page()
+                self.__page = self.parent().page()
 
-        return self.cached_page
+        return self.__page
 
     def add_child(self, widget):
         self.children.append(widget)
@@ -164,7 +164,7 @@
     def do_render(self, session, object):
         writer = Writer()
 
-        self.template.render(session, object, writer)
+        self.__template.render(session, object, writer)
 
         return writer.to_string()
 
@@ -202,16 +202,16 @@
         self.default = None
         self.is_required = True
 
-        self.cached_path = None
+        self.__path = None
 
     def path(self):
-        if self.cached_path == None:
+        if self.__path == None:
             if not self.widget.parent():
-                self.cached_path = self.name
+                self.__path = self.name
             else:
-                self.cached_path = self.widget.path() + "." + self.name
+                self.__path = self.widget.path() + "." + self.name
 
-        return self.cached_path
+        return self.__path
 
     def set_required(self, is_required):
         self.is_required = is_required
@@ -490,8 +490,8 @@
             self.debug = None
 
     class Debug(object):
-        def __init__(self, app):
-            self.app = app
+        def __init__(self, session):
+            self.session = session
             self.process_stack = list()
             self.render_stack = list()
 
@@ -565,16 +565,8 @@
             vars = list()
 
             for param in params:
-                #key = param.path()
+                key = param.path()
 
-                # Inlined below saving about a half a second in a
-                # 1000-hit profile
-
-                if param.cached_path == None:
-                    key = param.path()
-                else:
-                    key = param.cached_path
-
                 if param.is_collection:
                     collection = self.get(key)
 




More information about the rhmessaging-commits mailing list