[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam -
xmlobject.py:1.13
Philipp von Weitershausen
philikon at philikon.de
Thu Feb 19 09:33:48 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/skins/rotterdam
In directory cvs.zope.org:/tmp/cvs-serv7937
Modified Files:
xmlobject.py
Log Message:
Test for ISiteness before blindly appending ++etc++site.
Whitespace cleanup.
=== Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py:1.12 Sun Feb 8 01:25:23 2004
+++ Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py Thu Feb 19 09:33:48 2004
@@ -17,9 +17,10 @@
"""
from zope.publisher.browser import BrowserView
+from zope.app import zapi
+from zope.app.interfaces.services.service import ISite
from zope.app.interfaces.container import IReadContainer
from zope.app.traversing import getParents, getParent, traverse
-from zope.component import queryView
from zope.interface import Interface
from rfc822 import formatdate, time
from xml.sax.saxutils import quoteattr
@@ -49,7 +50,7 @@
def getIconUrl(self, item):
result = ''
- icon = queryView(item, 'zmi_icon', self.request)
+ icon = zapi.queryView(item, 'zmi_icon', self.request)
if icon:
result = icon.url()
return result
@@ -60,8 +61,9 @@
keys = list(container.keys())
- # include the service manager
- keys.append('++etc++site')
+ if ISite.isImplementedBy(container):
+ # include the service manager
+ keys.append('++etc++site')
for name in keys:
@@ -112,8 +114,9 @@
else:
keys = []
- # include the service manager
- keys.append('++etc++site')
+ if ISite.isImplementedBy(item):
+ # include the service manager
+ keys.append('++etc++site')
for name in keys:
# Only include items we can traverse to
@@ -157,10 +160,9 @@
parent = getParent(self.context)
while parent is not None:
if IReadContainer.isImplementedBy(parent):
- view = queryView(parent,
- 'singleBranchTree.xml',
- self.request)
- return view()
+ view = zapi.queryView(parent,
+ 'singleBranchTree.xml',
+ self.request)
+ return view()
else:
parent = getParent(parent)
-
More information about the Zope3-Checkins
mailing list