[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/browser.py rename variable obj -> site

Philipp von Weitershausen philikon at philikon.de
Wed Mar 1 13:36:58 EST 2006


Log message for revision 65677:
  rename variable obj -> site
  don't reacquire the zpt object
  

Changed:
  U   Products.Five/branches/philikon-local-components/component/browser.py

-=-
Modified: Products.Five/branches/philikon-local-components/component/browser.py
===================================================================
--- Products.Five/branches/philikon-local-components/component/browser.py	2006-03-01 18:36:20 UTC (rev 65676)
+++ Products.Five/branches/philikon-local-components/component/browser.py	2006-03-01 18:36:57 UTC (rev 65677)
@@ -86,17 +86,16 @@
         src = self.templateSource(viewname)
 
         # find the nearest site
-        obj = self.context
-        while obj is not None and not IObjectManagerSite.providedBy(obj):
-            obj = aq_parent(obj)
-        if obj is None:
+        site = self.context
+        while site is not None and not IObjectManagerSite.providedBy(site):
+            site = aq_parent(site)
+        if site is None:
             raise TypeError("No site found")  #TODO find right exception
 
         zpt = ZPTPage()
         zpt.source = unicode(src)
-        obj._setObject(viewname, zpt) #XXX there could be a naming conflict
-        zpt = getattr(obj, viewname)
-        components = obj.getSiteManager()
+        site._setObject(viewname, zpt) #XXX there could be a naming conflict
+        components = site.getSiteManager()
 
         # find out the view registration object so we can get at the
         # provided and required interfaces



More information about the Zope-Checkins mailing list