[Zope3-checkins] CVS: Zope3/src/zope/app/browser -
absoluteurl.py:1.15.2.1 introspector.py:1.7.8.1
onlinehelp.py:1.14.6.1
Jim Fulton
jim at zope.com
Mon Sep 8 15:22:24 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser
In directory cvs.zope.org:/tmp/cvs-serv20092/src/zope/app/browser
Modified Files:
Tag: parentgeddon-branch
absoluteurl.py introspector.py onlinehelp.py
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing. Specific log entries will be provided
when we merge this into the head.
=== Zope3/src/zope/app/browser/absoluteurl.py 1.15 => 1.15.2.1 ===
--- Zope3/src/zope/app/browser/absoluteurl.py:1.15 Wed Sep 3 14:33:55 2003
+++ Zope3/src/zope/app/browser/absoluteurl.py Mon Sep 8 14:21:22 2003
@@ -34,7 +34,7 @@
request = self.request
# We do this here do maintain the rule that we must be wrapped
- container = zapi.getWrapperContainer(context)
+ container = getattr(context, '__parent__', None)
if container is None:
raise TypeError, _insufficientContext
@@ -43,10 +43,8 @@
url = str(zapi.getView(container, 'absolute_url', request))
- dict = zapi.getInnerWrapperData(context)
- try:
- name = dict['name']
- except KeyError:
+ name = getattr(context, '__name__', None)
+ if name is None:
raise TypeError, _insufficientContext
if name:
@@ -61,7 +59,7 @@
request = self.request
# We do this here do maintain the rule that we must be wrapped
- container = zapi.getWrapperContainer(context)
+ container = getattr(context, '__parent__', None)
if container is None:
raise TypeError, _insufficientContext
@@ -72,10 +70,8 @@
base = tuple(zapi.getView(container,
'absolute_url', request).breadcrumbs())
- dict = zapi.getInnerWrapperData(context)
- try:
- name = dict['name']
- except KeyError:
+ name = getattr(context, '__name__', None)
+ if name is None:
raise TypeError, _insufficientContext
if name:
@@ -96,12 +92,10 @@
url = request.getApplicationURL()
- dict = zapi.getInnerWrapperData(context)
- if dict:
- name = dict.get('name')
- if name:
- url += '/'+name
-
+ name = getattr(context, '__name__', None)
+ if name:
+ url += '/'+name
+
return url
__call__ = __str__
@@ -116,14 +110,10 @@
base = ({'name':'', 'url': self.request.getApplicationURL()}, )
- dict = zapi.getInnerWrapperData(context)
- if dict:
- name = dict.get('name')
-
- if name:
- base += ({'name': name,
- 'url': ("%s/%s" % (base[-1]['url'], name))
- }, )
-
-
+ name = getattr(context, '__name__', None)
+ if name:
+ base += ({'name': name,
+ 'url': ("%s/%s" % (base[-1]['url'], name))
+ }, )
+
return base
=== Zope3/src/zope/app/browser/introspector.py 1.7 => 1.7.8.1 ===
--- Zope3/src/zope/app/browser/introspector.py:1.7 Wed Aug 6 10:41:11 2003
+++ Zope3/src/zope/app/browser/introspector.py Mon Sep 8 14:21:22 2003
@@ -15,7 +15,7 @@
$Id$
"""
-from zope.publisher.browser import BrowserView
+from zope.app.publisher.browser import BrowserView
from zope.app.interfaces.introspector import IIntrospector
from zope.component import getAdapter
from zope.app import zapi
=== Zope3/src/zope/app/browser/onlinehelp.py 1.14 => 1.14.6.1 ===
--- Zope3/src/zope/app/browser/onlinehelp.py:1.14 Sun Aug 17 02:05:23 2003
+++ Zope3/src/zope/app/browser/onlinehelp.py Mon Sep 8 14:21:22 2003
@@ -21,9 +21,8 @@
from zope.component import getService, getView
from zope.component.view import viewService
-from zope.publisher.browser import BrowserView
+from zope.app.publisher.browser import BrowserView
from zope.app.traversing import getRoot
-from zope.app.context import ContextWrapper
from zope.app.traversing import getParents, getName
class OnlineHelpTopicView(BrowserView):
@@ -32,7 +31,6 @@
def _makeSubTree(self, topic):
html = '<ul>\n'
for entry in topic.items():
- entry = ContextWrapper(entry[1], topic, name=entry[0])
html += ' <li><a href="%s">%s</a></li>\n' %(
getView(entry, 'absolute_url', self.request)(),
entry.getTitle())
More information about the Zope3-Checkins
mailing list