[Zope3-checkins] CVS: Zope3/src/zope/app/site/browser -
__init__.py:1.7
Jim Fulton
jim at zope.com
Thu Apr 8 17:02:42 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/site/browser
In directory cvs.zope.org:/tmp/cvs-serv12425/src/zope/app/site/browser
Modified Files:
__init__.py
Log Message:
Removed the id key from info. Views can compute this if they want it.
Also, got rid of the keep_dummy option to info. Clients didn't seem
to trust it anyway, so it did no good. The info method doesn't return
dummy entries (for the None stack marker) anymore,
=== Zope3/src/zope/app/site/browser/__init__.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/site/browser/__init__.py:1.6 Wed Mar 31 18:35:41 2004
+++ Zope3/src/zope/app/site/browser/__init__.py Thu Apr 8 17:02:41 2004
@@ -377,32 +377,26 @@
# XXX this code path is not being tested
result = []
- dummy = {'id': 'None',
- 'active': False,
- 'registration': None,
- 'name': '',
- 'url': '',
- 'config': '',
- }
- for info in registry.info(True):
+ for info in registry.info():
configobj = info['registration']
- if configobj is None:
- info = dummy
- dummy = None
- if not result:
- info['active'] = True
- else:
- component = configobj.getComponent()
- path = zapi.getPath(component)
- path = path.split("/")
- info['name'] = "/".join(path[-2:])
- info['url'] = str(
- zapi.getView(component, 'absolute_url', self.request))
- info['config'] = str(zapi.getView(configobj, 'absolute_url',
- self.request))
+ component = configobj.getComponent()
+ path = zapi.getPath(component)
+ path = path.split("/")
+ info['id'] = zapi.getPath(configobj)
+ info['name'] = "/".join(path[-2:])
+ info['url'] = str(
+ zapi.getView(component, 'absolute_url', self.request))
+ info['config'] = str(zapi.getView(configobj, 'absolute_url',
+ self.request))
result.append(info)
- if dummy:
- result.append(dummy)
+
+ result.append({'id': 'None',
+ 'active': False,
+ 'registration': None,
+ 'name': '',
+ 'url': '',
+ 'config': '',
+ })
return result
def update(self):
More information about the Zope3-Checkins
mailing list