[Zope-Checkins]
SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
simplify getting the root
Hanno Schlichting
plone at hannosch.info
Sat Jul 28 20:27:39 EDT 2007
Log message for revision 78449:
simplify getting the root
Changed:
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py 2007-07-29 00:12:25 UTC (rev 78448)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py 2007-07-29 00:27:36 UTC (rev 78449)
@@ -18,6 +18,7 @@
import zope.app.pagetemplate
from Acquisition import aq_base
+from Acquisition import aq_get
from Acquisition import aq_parent
from AccessControl import getSecurityManager
from Products.PageTemplates.Expressions import SecureModuleImporter
@@ -39,11 +40,9 @@
# get the root
obj = context['context']
root = None
- while (getattr(aq_base(obj), 'getPhysicalRoot', None) is None
- and aq_parent(obj) is not None):
- obj = aq_parent(obj)
- if getattr(obj, 'getPhysicalRoot', None) is not None:
- root = obj.getPhysicalRoot()
+ meth = aq_get(obj, 'getPhysicalRoot', None)
+ if meth is not None:
+ root = meth()
context.update(here=context['context'],
# philiKON thinks container should be the view,
More information about the Zope-Checkins
mailing list